Skip to content

Commit bd8e9bb

Browse files
committed
Ajout des schematics pour ng-add
1 parent f176099 commit bd8e9bb

File tree

9 files changed

+856
-4090
lines changed

9 files changed

+856
-4090
lines changed

.github/workflows/npm-publish.yml

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
registry-url: https://registry.npmjs.org/
3030
- run: npm ci
3131
- run: npm run build
32-
- run: npm run postbuild
3332
- run: cd dist/ngx-focus-entities && npm publish
3433
env:
3534
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

package-lock.json

+770-4,077
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-focus-entities",
3-
"version": "19.0.0",
3+
"version": "19.1.0",
44
"author": {
55
"email": "gilderic.deruette@kleegroup.com",
66
"name": "Gildéric Deruette"
@@ -12,28 +12,25 @@
1212
"index.d.ts",
1313
"public-api.d.ts"
1414
],
15-
"license": "LICENSE",
15+
"license": "MIT",
1616
"repository": {
1717
"type": "git",
1818
"url": "git+https://github.com/klee-contrib/ngx-focus-entities.git"
1919
},
2020
"scripts": {
2121
"ng": "ng",
2222
"start": "ng serve",
23-
"build": "ng build",
24-
"postbuild": "copyfiles -f -V projects/ngx-focus-entities/schematics/migrations/*.json ./dist/ngx-focus-entities/schematics/migrations",
23+
"build": "cd projects/ngx-focus-entities && npm run build",
2524
"watch": "ng build --watch --configuration development",
2625
"test": "ng test --no-watch --no-progress --browsers ChromeHeadless --code-coverage"
2726
},
2827
"private": false,
2928
"dependencies": {
30-
"@angular/forms": "^19.1.6",
29+
"@angular/forms": "^19",
30+
"ngx-focus-entities": "19.1.0",
3131
"tslib": "^2.3.0"
3232
},
3333
"peerDependencies": {
34-
"@angular/common": "^19.1.6",
35-
"@angular/compiler": "^19.1.6",
36-
"@angular/core": "^19.1.6",
3734
"tslib": "^2.3.0"
3835
},
3936
"devDependencies": {
@@ -52,4 +49,4 @@
5249
"typescript": "~5.6.3",
5350
"copyfiles": "2.4.1"
5451
}
55-
}
52+
}
+15-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
{
22
"name": "ngx-focus-entities",
3-
"version": "19.0.0",
3+
"version": "19.1.0",
44
"repository": "https://github.com/klee-contrib/ngx-focus-entities",
55
"license": "MIT",
66
"author": {
77
"email": "gilderic.deruette@kleegroup.com",
88
"name": "Gildéric Deruette"
99
},
10+
"scripts": {
11+
"build": "ng build && tsc -p tsconfig.schematics.json",
12+
"postbuild": "copyfiles schematics/*/schema.json schematics/*/files/** schematics/collection.json ../../dist/ngx-focus-entities"
13+
},
1014
"peerDependencies": {
11-
"@angular/forms": "^19.0.0"
15+
"@angular/forms": "^19"
1216
},
1317
"dependencies": {
1418
"tslib": "^2.3.0"
1519
},
1620
"ng-update": {
1721
"migrations": "./schematics/migrations/migration.json"
1822
},
19-
"sideEffects": false
23+
"ng-add": {
24+
"save": "dependencies"
25+
},
26+
"schematics": "./schematics/collection.json",
27+
"sideEffects": false,
28+
"devDependencies": {
29+
"copyfiles": "file:../../node_modules/copyfiles",
30+
"typescript": "file:../../node_modules/typescript"
31+
}
2032
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3+
"schematics": {
4+
"ng-add": {
5+
"description": "Add my library to the project.",
6+
"factory": "./ng-add/index#ngAdd",
7+
"schema": "./ng-add/schema.json"
8+
}
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Rule } from '@angular-devkit/schematics';
2+
import {
3+
addDependency
4+
} from '@schematics/angular/utility';
5+
import { Schema } from './schema';
6+
export function ngAdd(_options: Schema): Rule {
7+
return addDependency('ngx-focus-entities', require("../../package.json").version);
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export interface Schema {
2+
/**
3+
* The name of the project.
4+
*/
5+
project: string;
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "NgxFocusEntitiesNgAdd",
4+
"title": "ngx-focus-entities Ng Add Schema",
5+
"type": "object",
6+
"properties": {
7+
"project": {
8+
"type": "string",
9+
"description": "The name of the project.",
10+
"$default": {
11+
"$source": "projectName"
12+
}
13+
}
14+
},
15+
"required": ["project"]
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"lib": ["es2018", "dom"],
5+
"declaration": true,
6+
"module": "commonjs",
7+
"moduleResolution": "node",
8+
"noEmitOnError": true,
9+
"noFallthroughCasesInSwitch": true,
10+
"noImplicitAny": true,
11+
"noImplicitThis": true,
12+
"noUnusedParameters": true,
13+
"noUnusedLocals": true,
14+
"rootDir": "schematics",
15+
"outDir": "../../dist/ngx-focus-entities/schematics",
16+
"skipDefaultLibCheck": true,
17+
"skipLibCheck": true,
18+
"sourceMap": true,
19+
"strictNullChecks": true,
20+
"target": "es6",
21+
"types": ["jasmine", "node"]
22+
},
23+
"include": ["schematics/**/*"],
24+
"exclude": ["schematics/*/files/**/*"]
25+
}

0 commit comments

Comments
 (0)