Skip to content

Commit

Permalink
chore: moved schematics to separate build
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Jul 19, 2023
1 parent 7349d05 commit 28bb710
Show file tree
Hide file tree
Showing 72 changed files with 584 additions and 223 deletions.
4 changes: 2 additions & 2 deletions _old/projects/ng2-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"build": "npx tsc -p ../../../libs/ng2-charts/tsconfig.schematics.json",
"test": "jasmine",
"copy:schemas": "rsync -R ../../libs/ng2-charts/schematics/*/schema.json ../../../dist/ng2-charts",
"copy:templates": "rsync -aR ../../../libs/ng2-charts/schematics/ng-generate --include '*.template' --include '*/' --exclude '*' ../../dist/ng2-charts/",
"copy:collection": "cp ../../../libs/ng2-charts/schematics/collection.json ../../dist/ng2-charts/schematics/collection.json",
"copy:templates": "rsync -aR ../../../libs/ng2-charts-schematics/src/ng-generate --include '*.template' --include '*/' --exclude '*' ../../dist/ng2-charts/",
"copy:collection": "cp ../../../libs/ng2-charts-schematics/src/collection.json ../../dist/ng2-charts/schematics/collection.json",
"postbuild": "npm run copy:schemas && npm run copy:templates && npm run copy:collection"
},
"peerDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion apps/ng2-charts-demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@
"buildTarget": "ng2-charts-demo:build"
}
}
}
},
"implicitDependencies": ["ng2-charts"]
}
18 changes: 18 additions & 0 deletions libs/ng2-charts-schematics/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
11 changes: 11 additions & 0 deletions libs/ng2-charts-schematics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ng2-charts-schematics

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build ng2-charts-schematics` to build the library.

## Running unit tests

Run `nx test ng2-charts-schematics` to execute the unit tests via [Jest](https://jestjs.io).
11 changes: 11 additions & 0 deletions libs/ng2-charts-schematics/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable */
export default {
displayName: 'ng2-charts-schematics',
preset: '../../jest.preset.js',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/libs/ng2-charts-schematics',
};
5 changes: 5 additions & 0 deletions libs/ng2-charts-schematics/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "ng2-charts-schematics",
"version": "0.0.1",
"type": "commonjs"
}
43 changes: 43 additions & 0 deletions libs/ng2-charts-schematics/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "ng2-charts-schematics",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/ng2-charts-schematics/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/ng2-charts/schematics",
"main": "libs/ng2-charts-schematics/src/ng-add/index.ts",
"tsConfig": "libs/ng2-charts-schematics/tsconfig.lib.json",
"assets": [
"libs/ng2-charts-schematics/*.md",
"libs/ng2-charts-schematics/src/**/*.json"
]
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/ng2-charts-schematics/**/*.ts"]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/ng2-charts-schematics/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"tags": []
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions libs/ng2-charts-schematics/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
12 changes: 12 additions & 0 deletions libs/ng2-charts-schematics/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
}
14 changes: 14 additions & 0 deletions libs/ng2-charts-schematics/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"jest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
1 change: 1 addition & 0 deletions libs/ng2-charts/ng-package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/libs/ng2-charts",
"deleteDestPath": false,
"lib": {
"entryFile": "src/index.ts"
},
Expand Down
18 changes: 3 additions & 15 deletions libs/ng2-charts/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
{
"name": "ng2-charts",
"version": "5.0.0",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"build": "npx tsc -p tsconfig.schematics.json",
"test": "nx test ng2-charts --verbose",
"copy:schemas": "rsync -R ../../libs/ng2-charts/schematics/*/schema.json ../../dist/ng2-charts/",
"copy:templates": "rsync -aR ../../libs/ng2-charts/schematics/ng-generate --include '*.template' --include '*/' --exclude '*' ../../dist/ng2-charts/",
"copy:collection": "cp ../../libs/ng2-charts/schematics/collection.json ../../dist/ng2-charts/schematics/collection.json",
"postbuild": "npm run copy:schemas && npm run copy:templates && npm run copy:collection"
},
"name": "ng2-charts",
"description": "Reactive, responsive, beautiful charts for Angular based on Chart.js",
"peerDependencies": {
"@angular/common": ">=16.0.0",
"@angular/core": ">=16.0.0",
Expand All @@ -22,8 +12,6 @@
"dependencies": {
"lodash-es": "^4.17.15"
},
"description": "Reactive, responsive, beautiful charts for Angular based on Chart.js",
"main": "../../libs/ng2-charts/src/public_api.ts",
"author": "Dmitriy Shekhovtsov <valorkin@gmail.com>",
"contributors": [
{
Expand All @@ -45,7 +33,7 @@
"type": "git",
"url": "git+https://github.com/valor-software/ng2-charts.git"
},
"schematics": "./schematics/collection.json",
"schematics": "./schematics/src/collection.json",
"ng-add": {
"save": "dependencies"
},
Expand Down
6 changes: 5 additions & 1 deletion libs/ng2-charts/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
"options": {

"project": "libs/ng2-charts/ng-package.json"
},
"configurations": {
Expand Down Expand Up @@ -46,5 +47,8 @@
]
}
}
}
},
"implicitDependencies": [
"ng2-charts-schematics"
]
}
Loading

0 comments on commit 28bb710

Please sign in to comment.