Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce an ag-charts-core package #3328

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions external/ag-shared/scripts/watch/chartsWatch.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ function getProjectBuildTargets(project) {
['ag-charts-community', ['build'], 'watch'],
['ag-charts-enterprise', ['build'], 'watch'],
];
case 'ag-charts-core':
return [
[project, ['build'], 'watch'],
['ag-charts-community', ['build'], 'watch'],
['ag-charts-enterprise', ['build'], 'watch'],
];
case 'ag-charts-community':
return [
[project, ['build'], 'watch'],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"workspaces": {
"packages": [
"external/ag-shared",
"packages/ag-charts-core",
"packages/ag-charts-community",
"packages/ag-charts-community-examples",
"packages/ag-charts-enterprise",
Expand Down
1 change: 1 addition & 0 deletions packages/ag-charts-community/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
],
"homepage": "https://ag-grid.com/charts/",
"dependencies": {
"ag-charts-core": "11.0.3-beta.20250105",
"ag-charts-types": "11.0.3-beta.20250105",
"ag-charts-locale": "11.0.3-beta.20250105"
},
Expand Down
445 changes: 445 additions & 0 deletions packages/ag-charts-core/.dependency-cruiser.js

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions packages/ag-charts-core/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
node_modules
src
tools
.npmignore
.prettierignore
.swcrc
.dependency-cruiser.js
jest.*
tsconfig.*
project.json
.esbuild.*
.env*

dist/*.d.ts
dist/**/*.test.*
*.map
*.tgz

!dist/
!dist/package/src
!dist/types/src
dist/**/package.json
2 changes: 2 additions & 0 deletions packages/ag-charts-core/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
typings/
30 changes: 30 additions & 0 deletions packages/ag-charts-core/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"target": "es2017",
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"transform": {
"decoratorMetadata": true,
"legacyDecorator": true
},
"keepClassNames": true,
"externalHelpers": true,
"loose": true
},
"module": {
"type": "es6"
},
"sourceMaps": "inline",
"exclude": [
"jest.config.ts",
".*\\.spec.tsx?$",
".*\\.test.tsx?$",
"./src/jest-setup.ts$",
"./**/jest-setup.ts$",
".*.js$"
]
}
21 changes: 21 additions & 0 deletions packages/ag-charts-core/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2015-2024 AG GRID LTD

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions packages/ag-charts-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ag-charts-core

TBD - for internal use only
3 changes: 3 additions & 0 deletions packages/ag-charts-core/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import base, { sonarjsConfig } from '../../eslint.config.mjs';

export default [...sonarjsConfig, ...base];
56 changes: 56 additions & 0 deletions packages/ag-charts-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "ag-charts-core",
"version": "11.0.3-beta.20250105",
"description": "Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue",
"sideEffects": false,
"main": "./dist/package/main.cjs.js",
"types": "./dist/types/src/main.d.ts",
"module": "./dist/package/main.esm.mjs",
"exports": {
".": {
"import": "./dist/package/main.esm.mjs",
"require": "./dist/package/main.cjs.js",
"types": "./dist/types/src/main.d.ts",
"default": "./dist/package/main.cjs.js"
}
},
"scripts": {
"lint:prune": "npx ts-prune -p tsconfig.lib.json"
},
"repository": {
"type": "git",
"url": "https://github.com/ag-grid/ag-charts.git"
},
"keywords": [
"chart",
"charts",
"data",
"angular",
"angular-component",
"react",
"react-component",
"reactjs",
"vue",
"vuejs"
],
"author": "AG Grid <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ag-grid/ag-charts/issues"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie >= 0",
"not ie_mob >= 0",
"not blackberry > 0",
"not op_mini all",
"not operamobile >= 0"
],
"homepage": "https://ag-grid.com/charts/",
"dependencies": {},
"devDependencies": {},
"publishConfig": {
"access": "public"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we mark this as private, to avoid accidental publishing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern was that it may cause issues with the way we publish packages, but I can set it private and we can find out if it does 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'd prefer that way around. We publish to the private Verdaccio routinely, so I would hope any issues in that respect should show up there; if ag-charts-core is a devDependency I don't foresee any issue with publishing of dependents either?

On another note, as long as we don't generate a .tgz when nx pack --prod is run, then nothing in the publishing pipeline should care AFAIK

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a heads-up, I followed up by removing the package and package:verify targets to ensure we don't generate publishable artifacts: 45b0457

}
}
85 changes: 85 additions & 0 deletions packages/ag-charts-core/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"name": "ag-charts-core",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/ag-charts-core/src",
"projectType": "library",
"targets": {
"build": {
"executor": "nx:noop",
"dependsOn": ["build:types", "build:package"],
"inputs": [],
"outputs": [],
"configurations": {
"watch": {},
"production": {}
}
},
"build:types": {
"options": {}
},
"build:package": {
"options": {}
},
"docs-debug-interfaces": {
"executor": "ag-charts-generate-code-reference-files:generate",
"dependsOn": ["ag-charts-generate-code-reference-files:build"],
"inputs": ["{projectRoot}/src/**/*.ts", { "dependentTasksOutputFiles": "**/*", "transitive": false }],
"outputs": ["{options.output}"],
"cache": true,
"options": {
"mode": "debug-interfaces",
"inputs": ["{projectRoot}/src"],
"output": "dist/{projectRoot}/debug-interfaces.AUTO.json"
}
},
"docs-resolved-interfaces": {
"executor": "ag-charts-generate-code-reference-files:generate",
"dependsOn": ["ag-charts-generate-code-reference-files:build"],
"inputs": ["{projectRoot}/src/**/*.ts", { "dependentTasksOutputFiles": "**/*", "transitive": false }],
"outputs": ["{options.output}"],
"cache": true,
"options": {
"mode": "docs-interfaces",
"inputs": ["{projectRoot}/src"],
"output": "dist/{projectRoot}/resolved-interfaces.AUTO.json"
}
},
"lint:eslint": {},
"lint:circular": {},
"lint:depcruise": {},
"lint": {
"executor": "nx:noop",
"dependsOn": ["lint:eslint", "lint:circular", "lint:depcruise"],
"configurations": {
"fix": {}
}
},
"pack": {
"executor": "nx:run-commands",
"dependsOn": ["build"],
"inputs": ["allTransitiveOutputs"],
"outputs": ["{workspaceRoot}/dist/{projectRoot}.tgz"],
"options": {
"cwd": "{projectRoot}",
"parallel": false,
"commands": ["mkdir -p ../../dist/packages", "yarn pack -f ../../dist/{projectRoot}.tgz"]
}
},
"pack:extract": {
"executor": "nx:run-commands",
"dependsOn": ["pack"],
"inputs": ["allOutputs"],
"outputs": ["{workspaceRoot}/dist/packages/contents/ag-charts-core/"],
"options": { "command": "tools/package/extract-contents.sh {projectRoot}" }
},
"pack:verify": {
"executor": "nx:run-commands",
"dependsOn": ["pack:extract"],
"inputs": ["allOutputs"],
"options": {
"commands": ["node tools/package/sanity-check-package.js dist/packages/contents/ag-charts-core/package"]
}
}
},
"tags": ["no-batching"]
}
Empty file.
20 changes: 20 additions & 0 deletions packages/ag-charts-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"strict": true,
"forceConsistentCasingInFileNames": false,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": false,
"noUnusedParameters": true,
"noUnusedLocals": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}
9 changes: 9 additions & 0 deletions packages/ag-charts-core/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"verbatimModuleSyntax": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "src/**/test/**"]
}
9 changes: 9 additions & 0 deletions packages/ag-charts-core/tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"verbatimModuleSyntax": true,
"types": ["node"],
"noEmit": true
},
"include": ["src/**/*.ts", "benchmarks/**/*.ts", "jest.config.ts", "jest.setup.ts"]
}
10 changes: 10 additions & 0 deletions packages/ag-charts-core/tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "jest.setup.ts", "src/main-test.ts", "**/*.test.ts", "**/test/**"]
}
4 changes: 4 additions & 0 deletions packages/ag-charts-core/tsconfig.types.watch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.types.json",
"compilerOptions": {}
}
4 changes: 4 additions & 0 deletions packages/ag-charts-core/tsconfig.watch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {}
}
1 change: 1 addition & 0 deletions packages/ag-charts-enterprise/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"typescript": "^5.4.5"
},
"dependencies": {
"ag-charts-core": "11.0.3-beta.20250105",
"ag-charts-community": "11.0.3-beta.20250105"
},
"publishConfig": {
Expand Down
1 change: 1 addition & 0 deletions packages/all/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
}
},
"implicitDependencies": [
"ag-charts-core",
"ag-charts-community",
"ag-charts-enterprise",
"ag-charts-community-examples",
Expand Down
1 change: 1 addition & 0 deletions tools/bump-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TOOLS_DIR=$(dirname $0)

PACKAGES=(
ag-charts
ag-charts-core
ag-charts-community
ag-charts-enterprise
ag-charts-types
Expand Down
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"ag-charts-community": ["packages/ag-charts-community/src/main.ts"],
"ag-charts-community-examples": ["packages/ag-charts-community-examples/src/index.ts"],
"ag-charts-community-test": ["packages/ag-charts-community/src/main-test.ts"],
"ag-charts-core": ["packages/ag-charts-core/src/main.ts"],
"ag-charts-enterprise": ["packages/ag-charts-enterprise/src/main.ts"],
"ag-charts-locale": ["packages/ag-charts-locale/src/main.ts"],
"ag-charts-types": ["packages/ag-charts-types/src/main.ts"]
Expand Down
Loading