Skip to content

Commit

Permalink
Merge pull request #109 from SwabianCoder/feature/96-add-ng-add-schem…
Browse files Browse the repository at this point in the history
…atic-to-ngx-toolset-api-token-interceptor

Feature/96 add ng add schematic to ngx toolset api token interceptor
  • Loading branch information
SwabianCoder authored Aug 19, 2022
2 parents a2f3cfc + f8f7467 commit 3f65891
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 1 deletion.
6 changes: 6 additions & 0 deletions projects/api-token-interceptor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0-rc.7] - 2022-08-19

### Added

- Support for ng add schematic

## [1.0.0-rc.6] - 2022-08-19

### Changed
Expand Down
14 changes: 13 additions & 1 deletion projects/api-token-interceptor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"name": "@ngx-toolset/api-token-interceptor",
"version": "1.0.0-rc.6",
"version": "1.0.0-rc.7",
"scripts": {
"build": "tsc -p tsconfig.schematics.json",
"postbuild": "copyfiles schematics/*/schema.json schematics/*/files/** schematics/collection.json ../../dist/api-token-interceptor/"
},
"schematics": "./schematics/collection.json",
"ng-add": {
"save": "dependencies"
},
"description": "Angular API token interceptor",
"homepage": "https://github.com/SwabianCoder/ngx-toolset",
"license": "MIT",
Expand Down Expand Up @@ -32,5 +40,9 @@
},
"dependencies": {
"tslib": "^2.3.0"
},
"devDependencies": {
"copyfiles": "file:../../node_modules/copyfiles",
"typescript": "file:../../node_modules/typescript"
}
}
9 changes: 9 additions & 0 deletions projects/api-token-interceptor/schematics/collection.json
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": "Add my library to the project.",
"factory": "./ng-add/index#ngAdd"
}
}
}
10 changes: 10 additions & 0 deletions projects/api-token-interceptor/schematics/ng-add/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';

export function ngAdd(): Rule {
return (tree: Tree, context: SchematicContext) => {
context.addTask(new NodePackageInstallTask());

return tree;
};
}
35 changes: 35 additions & 0 deletions projects/api-token-interceptor/tsconfig.schematics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"compilerOptions": {
"baseUrl": ".",
"lib": [
"es2018",
"dom"
],
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noUnusedParameters": true,
"noUnusedLocals": true,
"rootDir": "schematics",
"outDir": "../../dist/api-token-interceptor/schematics",
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"target": "es6",
"types": [
"jasmine",
"node"
]
},
"include": [
"schematics/**/*"
],
"exclude": [
"schematics/*/files/**/*"
]
}

0 comments on commit 3f65891

Please sign in to comment.