Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 15f16d6

Browse files
iklimisbampakoa
authored andcommittedJan 20, 2022
feat: add schematics
1 parent eba359e commit 15f16d6

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed
 

‎projects/ngx-grapesjs/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"name": "@developer-plexscape/ngx-grapesjs",
33
"version": "0.0.4",
44
"description": "Angular wrapper library for GrapesJS",
5+
"scripts": {
6+
"build": "tsc -p tsconfig.schematics.json",
7+
"postbuild": "copyfiles schematics/*/schema.json schematics/*/files/** schematics/collection.json ../../dist/ngx-grapesjs/"
8+
},
59
"peerDependencies": {
610
"@angular/common": "^13.0.0",
711
"@angular/core": "^13.0.0",
@@ -22,5 +26,13 @@
2226
"homepage": "https://github.com/Developer-Plexscape/ngx-grapesjs#readme",
2327
"publishConfig": {
2428
"registry":"https://npm.pkg.github.com"
29+
},
30+
"schematics": "./schematics/collection.json",
31+
"ng-add": {
32+
"save": "devDependencies"
33+
},
34+
"devDependencies": {
35+
"copyfiles": "file:../../node_modules/copyfiles",
36+
"typescript": "file:../../node_modules/typescript"
2537
}
2638
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
}
8+
}
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
2+
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
3+
4+
// Just return the tree
5+
export function ngAdd(): Rule {
6+
return (tree: Tree, context: SchematicContext) => {
7+
context.addTask(new NodePackageInstallTask());
8+
return tree;
9+
};
10+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"lib": [
5+
"es2018",
6+
"dom"
7+
],
8+
"declaration": true,
9+
"module": "commonjs",
10+
"moduleResolution": "node",
11+
"noEmitOnError": true,
12+
"noFallthroughCasesInSwitch": true,
13+
"noImplicitAny": true,
14+
"noImplicitThis": true,
15+
"noUnusedParameters": true,
16+
"noUnusedLocals": true,
17+
"rootDir": "schematics",
18+
"outDir": "../../dist/ngx-grapesjs/schematics",
19+
"skipDefaultLibCheck": true,
20+
"skipLibCheck": true,
21+
"sourceMap": true,
22+
"strictNullChecks": true,
23+
"target": "es6",
24+
"types": [
25+
"jasmine",
26+
"node"
27+
]
28+
},
29+
"include": [
30+
"schematics/**/*"
31+
],
32+
"exclude": [
33+
"schematics/*/files/**/*"
34+
]
35+
}

0 commit comments

Comments
 (0)
Please sign in to comment.