-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(other): Added schematics support
- Loading branch information
Showing
10 changed files
with
1,907 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/out-tsc | ||
|
||
# dependencies | ||
/node_modules | ||
node_modules | ||
|
||
# profiling files | ||
chrome-profiler-events.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,70 @@ | ||
{ | ||
"name": "ngqp", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
"build": "ng lint && ng build", | ||
"build-core": "ng build @ngqp/core", | ||
"serve-demo": "ng serve ngqp-demo", | ||
"release": "cd projects/ngqp/core && standard-version --infile ../../../CHANGELOG.md", | ||
"publish": "yarn build-core && cd dist/ngqp/core && npm publish --access public", | ||
"publish-demo": "yarn build-core && ng build ngqp-demo --prod --base-href=\"https://Airblader.github.io/ngqp/\" && npx ngh --dir=dist/ngqp-demo", | ||
"test": "ng test", | ||
"lint": "ng lint" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@angular/animations": "~7.1.0", | ||
"@angular/common": "~7.1.0", | ||
"@angular/compiler": "~7.1.0", | ||
"@angular/core": "~7.1.0", | ||
"@angular/forms": "~7.1.0", | ||
"@angular/platform-browser": "~7.1.0", | ||
"@angular/platform-browser-dynamic": "~7.1.0", | ||
"@angular/router": "~7.1.0", | ||
"@fortawesome/angular-fontawesome": "^0.3.0", | ||
"@fortawesome/fontawesome-svg-core": "^1.2.10", | ||
"@fortawesome/free-brands-svg-icons": "^5.6.1", | ||
"@fortawesome/free-solid-svg-icons": "^5.6.1", | ||
"@ng-bootstrap/ng-bootstrap": "^4.0.0", | ||
"@ngqp/core": "./projects/ngqp/core", | ||
"add": "^2.0.6", | ||
"bootstrap": "^4.1.3", | ||
"core-js": "^2.5.4", | ||
"rxjs": "~6.3.3", | ||
"tslib": "^1.9.0", | ||
"yarn": "^1.12.3", | ||
"zone.js": "~0.8.26" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "~0.11.0", | ||
"@angular-devkit/build-ng-packagr": "~0.11.0", | ||
"@angular/cli": "~7.1.2", | ||
"@angular/compiler-cli": "~7.1.0", | ||
"@angular/language-service": "~7.1.0", | ||
"@types/jasmine": "~2.8.8", | ||
"@types/jasminewd2": "~2.0.3", | ||
"@types/node": "~8.9.4", | ||
"angular-cli-ghpages": "^0.5.3", | ||
"codelyzer": "~4.5.0", | ||
"jasmine-core": "~2.99.1", | ||
"jasmine-spec-reporter": "~4.2.1", | ||
"karma": "~3.1.1", | ||
"karma-chrome-launcher": "~2.2.0", | ||
"karma-coverage-istanbul-reporter": "~2.0.1", | ||
"karma-jasmine": "~1.1.2", | ||
"karma-jasmine-html-reporter": "^0.2.2", | ||
"ng-packagr": "^4.2.0", | ||
"protractor": "~5.4.0", | ||
"standard-version": "^4.4.0", | ||
"ts-node": "~7.0.0", | ||
"tsickle": ">=0.29.0", | ||
"tslib": "^1.9.0", | ||
"tslint": "~5.11.0", | ||
"typescript": "~3.1.6" | ||
} | ||
"name": "ngqp", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"ng": "ng", | ||
"lint": "ng lint", | ||
"test": "ng test", | ||
"core:build": "ng build @ngqp/core", | ||
"core:build:prod": "yarn core:build", | ||
"demo:build": "ng build ngqp-demo", | ||
"demo:build:prod": "yarn demo:build --prod", | ||
"demo:serve": "ng serve ngqp-demo", | ||
"schematics:build": "sh scripts/build-schematics.sh", | ||
|
||
"//release": "cd projects/ngqp/core && standard-version --infile ../../../CHANGELOG.md", | ||
"//publish": "yarn build:core && cd dist/ngqp/core && npm publish --access public", | ||
"//publish:demo": "yarn build:core && ng build ngqp-demo --prod --base-href=\"https://Airblader.github.io/ngqp/\" && npx ngh --dir=dist/ngqp-demo" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@angular/animations": "~7.1.0", | ||
"@angular/common": "~7.1.0", | ||
"@angular/compiler": "~7.1.0", | ||
"@angular/core": "~7.1.0", | ||
"@angular/forms": "~7.1.0", | ||
"@angular/platform-browser": "~7.1.0", | ||
"@angular/platform-browser-dynamic": "~7.1.0", | ||
"@angular/router": "~7.1.0", | ||
"@fortawesome/angular-fontawesome": "^0.3.0", | ||
"@fortawesome/fontawesome-svg-core": "^1.2.10", | ||
"@fortawesome/free-brands-svg-icons": "^5.6.1", | ||
"@fortawesome/free-solid-svg-icons": "^5.6.1", | ||
"@ng-bootstrap/ng-bootstrap": "^4.0.0", | ||
"@ngqp/core": "./projects/ngqp/core", | ||
"add": "^2.0.6", | ||
"bootstrap": "^4.1.3", | ||
"core-js": "^2.5.4", | ||
"rxjs": "~6.3.3", | ||
"tslib": "^1.9.0", | ||
"yarn": "^1.12.3", | ||
"zone.js": "~0.8.26" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "~0.11.0", | ||
"@angular-devkit/build-ng-packagr": "~0.11.0", | ||
"@angular/cli": "~7.1.2", | ||
"@angular/compiler-cli": "~7.1.0", | ||
"@angular/language-service": "~7.1.0", | ||
"@types/jasmine": "~2.8.8", | ||
"@types/jasminewd2": "~2.0.3", | ||
"@types/node": "~8.9.4", | ||
"angular-cli-ghpages": "^0.5.3", | ||
"codelyzer": "~4.5.0", | ||
"jasmine-core": "~2.99.1", | ||
"jasmine-spec-reporter": "~4.2.1", | ||
"karma": "~3.1.1", | ||
"karma-chrome-launcher": "~2.2.0", | ||
"karma-coverage-istanbul-reporter": "~2.0.1", | ||
"karma-jasmine": "~1.1.2", | ||
"karma-jasmine-html-reporter": "^0.2.2", | ||
"ng-packagr": "^4.2.0", | ||
"protractor": "~5.4.0", | ||
"standard-version": "^4.4.0", | ||
"ts-node": "~7.0.0", | ||
"tsickle": ">=0.29.0", | ||
"tslib": "^1.9.0", | ||
"tslint": "~5.11.0", | ||
"typescript": "~3.1.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,31 @@ | ||
{ | ||
"name": "@ngqp/core", | ||
"version": "0.0.3", | ||
"description": "Synchronizing form controls with the URL for Angular", | ||
"homepage": "https://github.com/Airblader/ngqp", | ||
"author": "Ingo Bürk", | ||
"license": "MIT", | ||
"bugs": "https://github.com/Airblader/ngqp/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Airblader/ngqp.git" | ||
}, | ||
"keywords": [ | ||
"angular", | ||
"router", | ||
"url", | ||
"queryparams", | ||
"query-params" | ||
], | ||
"peerDependencies": { | ||
"@angular/common": "^7.x.x", | ||
"@angular/core": "^7.x.x", | ||
"@angular/forms": "^7.x.x", | ||
"@angular/router": "^7.x.x", | ||
"rxjs": "^6.x.x" | ||
} | ||
"name": "@ngqp/core", | ||
"version": "0.0.3", | ||
"description": "Synchronizing form controls with the URL for Angular", | ||
"homepage": "https://github.com/Airblader/ngqp", | ||
"author": "Ingo Bürk", | ||
"license": "MIT", | ||
"bugs": "https://github.com/Airblader/ngqp/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Airblader/ngqp.git" | ||
}, | ||
"keywords": [ | ||
"angular", | ||
"router", | ||
"url", | ||
"queryparams", | ||
"query-params" | ||
], | ||
"schematics": "./schematics/collection.json", | ||
"peerDependencies": { | ||
"@angular/common": "^7.x.x", | ||
"@angular/core": "^7.x.x", | ||
"@angular/forms": "^7.x.x", | ||
"@angular/router": "^7.x.x", | ||
"rxjs": "^6.x.x" | ||
}, | ||
"devDependencies": { | ||
"schematics-utilities": "^1.1.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.js | ||
*.js.map | ||
*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "../../../../node_modules/@angular-devkit/schematics/collection-schema.json", | ||
"schematics": { | ||
"ng-add": { | ||
"description": "Adds @ngqp to a project", | ||
"factory": "./schematics/ng-add/index" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { chain, noop, Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; | ||
import { addModuleImportToRootModule, getProjectFromWorkspace, getWorkspace } from 'schematics-utilities'; | ||
|
||
const NGQP_MODULE_NAME = 'QueryParamModule'; | ||
|
||
function addModuleToImports(options: any): Rule { | ||
return (host: Tree, context: SchematicContext) => { | ||
const workspace = getWorkspace(host); | ||
const project = getProjectFromWorkspace( | ||
workspace, | ||
options.project ? options.project : Object.keys(workspace[ 'projects' ])[ 0 ] | ||
); | ||
|
||
addModuleImportToRootModule(host, NGQP_MODULE_NAME, '@ngqp/core', project); | ||
context.logger.log('info', `✅️ "${NGQP_MODULE_NAME}" has been imported`); | ||
|
||
return host; | ||
}; | ||
} | ||
|
||
export default function(options: any): Rule { | ||
return chain([ | ||
options && options.skipModuleImport ? noop() : addModuleToImports(options), | ||
]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": "./schematics", | ||
"outDir": "../../../dist/ngqp/core/schematics", | ||
"lib": [ | ||
"es2017", | ||
"dom" | ||
], | ||
"declaration": true, | ||
"module": "commonjs", | ||
"resolveJsonModule": true, | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"noEmitOnError": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"noUnusedParameters": true, | ||
"noUnusedLocals": true, | ||
"skipDefaultLibCheck": true, | ||
"skipLibCheck": true, | ||
"sourceMap": false, | ||
"strictNullChecks": true, | ||
"target": "es6", | ||
"types": [ | ||
"node" | ||
] | ||
}, | ||
"include": [ | ||
"schematics/**/*" | ||
], | ||
"exclude": [ | ||
"schematics/**/*.test.ts", | ||
"schematics/**/files/**/*" | ||
] | ||
} |
Oops, something went wrong.