@ihk-gfi/lux-components-update 15.0.2 → 15.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@angular-devkit/schematics-cli/schematic/files/README.md +28 -0
- package/@angular-devkit/schematics-cli/schematic/files/__dot__gitignore +18 -0
- package/@angular-devkit/schematics-cli/schematic/files/__dot__npmignore +3 -0
- package/@angular-devkit/schematics-cli/schematic/files/package.json +25 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/collection.json +36 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/my-full-schematic/files/test2 +6 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/my-full-schematic/files/test__INDEX__ +2 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/my-full-schematic/index.ts +53 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/my-full-schematic/index_spec.ts +24 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/my-full-schematic/schema.json +16 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/my-other-schematic/index.ts +27 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/my-other-schematic/index_spec.ts +14 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/my-schematic/index.ts +26 -0
- package/@angular-devkit/schematics-cli/schematic/files/src/my-schematic/index_spec.ts +14 -0
- package/@angular-devkit/schematics-cli/schematic/files/tsconfig.json +23 -0
- package/@schematics/angular/application/files/src/favicon.ico.template +0 -0
- package/@schematics/angular/application/files/src/index.html.template +13 -0
- package/@schematics/angular/application/files/src/main.ts.template +13 -0
- package/@schematics/angular/application/files/src/styles.__style__.template +1 -0
- package/@schematics/angular/application/files/tsconfig.app.json.template +14 -0
- package/@schematics/angular/application/files/tsconfig.spec.json.template +14 -0
- package/@schematics/angular/class/files/__name@dasherize____type__.spec.ts.template +7 -0
- package/@schematics/angular/class/files/__name@dasherize____type__.ts.template +2 -0
- package/@schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.__style__.template +6 -0
- package/@schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.html.template +1 -0
- package/@schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template +23 -0
- package/@schematics/angular/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template +27 -0
- package/@schematics/angular/config/files/karma.conf.js.template +39 -0
- package/@schematics/angular/directive/files/__name@dasherize@if-flat__/__name@dasherize__.directive.spec.ts.template +8 -0
- package/@schematics/angular/directive/files/__name@dasherize@if-flat__/__name@dasherize__.directive.ts.template +11 -0
- package/@schematics/angular/e2e/files/protractor.conf.js.template +37 -0
- package/@schematics/angular/e2e/files/src/app.e2e-spec.ts.template +23 -0
- package/@schematics/angular/e2e/files/src/app.po.ts.template +11 -0
- package/@schematics/angular/e2e/files/tsconfig.json.template +13 -0
- package/@schematics/angular/enum/files/__name@dasherize____type__.ts.template +2 -0
- package/@schematics/angular/interface/files/__name@dasherize____type__.ts.template +2 -0
- package/@schematics/angular/library/files/README.md.template +24 -0
- package/@schematics/angular/library/files/ng-package.json.template +7 -0
- package/@schematics/angular/library/files/package.json.template +12 -0
- package/@schematics/angular/library/files/src/__entryFile__.ts.template +7 -0
- package/@schematics/angular/library/files/tsconfig.lib.json.template +14 -0
- package/@schematics/angular/library/files/tsconfig.lib.prod.json.template +10 -0
- package/@schematics/angular/library/files/tsconfig.spec.json.template +14 -0
- package/@schematics/angular/module/files/__name@dasherize@if-flat__/__name@dasherize__-routing.module.ts.template +11 -0
- package/@schematics/angular/module/files/__name@dasherize@if-flat__/__name@dasherize__.module.ts.template +19 -0
- package/@schematics/angular/pipe/files/__name@dasherize@if-flat__/__name@dasherize__.pipe.spec.ts.template +8 -0
- package/@schematics/angular/pipe/files/__name@dasherize@if-flat__/__name@dasherize__.pipe.ts.template +13 -0
- package/@schematics/angular/service/files/__name@dasherize@if-flat__/__name@dasherize__.service.spec.ts.template +16 -0
- package/@schematics/angular/service/files/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
- package/@schematics/angular/service-worker/files/ngsw-config.json.template +30 -0
- package/@schematics/angular/universal/files/root/tsconfig.server.json.template +14 -0
- package/@schematics/angular/universal/files/src/__main@stripTsExtension__.ts.template +2 -0
- package/@schematics/angular/universal/files/src/app/__rootModuleFileName__.template +14 -0
- package/@schematics/angular/web-worker/files/worker/__name@dasherize__.worker.ts.template +6 -0
- package/@schematics/angular/web-worker/files/worker-tsconfig/tsconfig.worker.json.template +15 -0
- package/@schematics/angular/workspace/files/README.md.template +27 -0
- package/@schematics/angular/workspace/files/__dot__editorconfig.template +16 -0
- package/@schematics/angular/workspace/files/__dot__gitignore.template +42 -0
- package/@schematics/angular/workspace/files/__dot__vscode/extensions.json.template +4 -0
- package/@schematics/angular/workspace/files/__dot__vscode/launch.json.template +20 -0
- package/@schematics/angular/workspace/files/__dot__vscode/tasks.json.template +42 -0
- package/@schematics/angular/workspace/files/angular.json.template +10 -0
- package/@schematics/angular/workspace/files/package.json.template +37 -0
- package/@schematics/angular/workspace/files/tsconfig.json.template +33 -0
- package/add-lux-components/files/app/base/license-hint/license-hint.component.html +8 -0
- package/add-lux-components/files/app/base/license-hint/license-hint.component.ts +24 -0
- package/add-lux-components/files/app/error/error.component.html +10 -0
- package/add-lux-components/files/app/error/error.component.scss +3 -0
- package/add-lux-components/files/app/error/error.component.spec.ts +49 -0
- package/add-lux-components/files/app/error/error.component.ts +17 -0
- package/add-lux-components/files/app/home/home.component.html +11 -0
- package/add-lux-components/files/app/home/home.component.scss +7 -0
- package/add-lux-components/files/app/home/home.component.ts +13 -0
- package/add-lux-components/files/app/profil/profil.component.html +1 -0
- package/add-lux-components/files/app/profil/profil.component.scss +0 -0
- package/add-lux-components/files/app/profil/profil.component.spec.ts +24 -0
- package/add-lux-components/files/app/profil/profil.component.ts +11 -0
- package/add-lux-components/files/assets/svg/Example.svg +6 -0
- package/add-lux-components/files/assets/svg/android.svg +2 -0
- package/add-lux-components/files/assets/svg/box.svg +690 -0
- package/add-lux-components/files/assets/svg/demoAppLogo.svg +1 -0
- package/add-lux-components/files/assets/svg/red_power_button.svg +67 -0
- package/add-lux-components/files/assets/svg/svg2009.svg +57457 -0
- package/package.json +3 -3
- package/update-dependencies/index.js +1 -1
- package/updates/15.0.0/files/src/main.ts +17 -0
- package/updates/15.0.0/files/src/test.ts +4 -0
- package/updates/15.0.0/index.js +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Getting Started With Schematics
|
|
2
|
+
|
|
3
|
+
This repository is a basic Schematic implementation that serves as a starting point to create and publish Schematics to NPM.
|
|
4
|
+
|
|
5
|
+
### Testing
|
|
6
|
+
|
|
7
|
+
To test locally, install `@angular-devkit/schematics-cli` globally and use the `schematics` command line tool. That tool acts the same as the `generate` command of the Angular CLI, but also has a debug mode.
|
|
8
|
+
|
|
9
|
+
Check the documentation with
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
schematics --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Unit Testing
|
|
16
|
+
|
|
17
|
+
`npm run test` will run the unit tests, using Jasmine as a runner and test framework.
|
|
18
|
+
|
|
19
|
+
### Publishing
|
|
20
|
+
|
|
21
|
+
To publish, simply do:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run build
|
|
25
|
+
npm publish
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
That's it!
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= dasherize(name) %>",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "A schematics",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsc -p tsconfig.json",
|
|
7
|
+
"test": "npm run build && jasmine src/**/*_spec.js"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"schematics"
|
|
11
|
+
],
|
|
12
|
+
"author": "<%= author %>",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"schematics": "./src/collection.json",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@angular-devkit/core": "^<%= coreVersion %>",
|
|
17
|
+
"@angular-devkit/schematics": "^<%= schematicsVersion %>",
|
|
18
|
+
"typescript": "~4.9.3"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^14.15.0",
|
|
22
|
+
"@types/jasmine": "~4.3.0",
|
|
23
|
+
"jasmine": "~4.5.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// By default, collection.json is a Loose-format JSON5 format, which means it's loaded using a
|
|
2
|
+
// special loader and you can use comments, as well as single quotes or no-quotes for standard
|
|
3
|
+
// JavaScript identifiers.
|
|
4
|
+
// Note that this is only true for collection.json and it depends on the tooling itself.
|
|
5
|
+
// We read package.json using a require() call, which is standard JSON.
|
|
6
|
+
{
|
|
7
|
+
// This is just to indicate to your IDE that there is a schema for collection.json.
|
|
8
|
+
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
9
|
+
|
|
10
|
+
// Schematics are listed as a map of schematicName => schematicDescription.
|
|
11
|
+
// Each description contains a description field which is required, a factory reference,
|
|
12
|
+
// an extends field and a schema reference.
|
|
13
|
+
// The extends field points to another schematic (either in the same collection or a
|
|
14
|
+
// separate collection using the format collectionName:schematicName).
|
|
15
|
+
// The factory is required, except when using the extends field. Then the factory can
|
|
16
|
+
// overwrite the extended schematic factory.
|
|
17
|
+
"schematics": {
|
|
18
|
+
"my-schematic": {
|
|
19
|
+
"description": "An example schematic",
|
|
20
|
+
"factory": "./my-schematic/index#mySchematic"
|
|
21
|
+
},
|
|
22
|
+
"my-other-schematic": {
|
|
23
|
+
"description": "A schematic that uses another schematics.",
|
|
24
|
+
"factory": "./my-other-schematic"
|
|
25
|
+
},
|
|
26
|
+
"my-full-schematic": {
|
|
27
|
+
"description": "A schematic using a source and a schema to validate options.",
|
|
28
|
+
"factory": "./my-full-schematic",
|
|
29
|
+
"schema": "./my-full-schematic/schema.json"
|
|
30
|
+
},
|
|
31
|
+
"my-extend-schematic": {
|
|
32
|
+
"description": "A schematic that extends another schematic.",
|
|
33
|
+
"extends": "my-full-schematic"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Rule,
|
|
3
|
+
SchematicContext,
|
|
4
|
+
Tree,
|
|
5
|
+
apply,
|
|
6
|
+
chain,
|
|
7
|
+
mergeWith,
|
|
8
|
+
schematic,
|
|
9
|
+
template,
|
|
10
|
+
url,
|
|
11
|
+
} from '@angular-devkit/schematics';
|
|
12
|
+
|
|
13
|
+
// Instead of `any`, it would make sense here to get a schema-to-dts package and output the
|
|
14
|
+
// interfaces so you get type-safe options.
|
|
15
|
+
export default function (options: any): Rule {
|
|
16
|
+
// The chain rule allows us to chain multiple rules and apply them one after the other.
|
|
17
|
+
return chain([
|
|
18
|
+
(_tree: Tree, context: SchematicContext) => {
|
|
19
|
+
// Show the options for this Schematics.
|
|
20
|
+
context.logger.info('My Full Schematic: ' + JSON.stringify(options));
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// The schematic Rule calls the schematic from the same collection, with the options
|
|
24
|
+
// passed in. Please note that if the schematic has a schema, the options will be
|
|
25
|
+
// validated and could throw, e.g. if a required option is missing.
|
|
26
|
+
schematic('my-other-schematic', { option: true }),
|
|
27
|
+
|
|
28
|
+
// The mergeWith() rule merge two trees; one that's coming from a Source (a Tree with no
|
|
29
|
+
// base), and the one as input to the rule. You can think of it like rebasing a Source on
|
|
30
|
+
// top of your current set of changes. In this case, the Source is that apply function.
|
|
31
|
+
// The apply() source takes a Source, and apply rules to it. In our case, the Source is
|
|
32
|
+
// url(), which takes an URL and returns a Tree that contains all the files from that URL
|
|
33
|
+
// in it. In this case, we use the relative path `./files`, and so two files are going to
|
|
34
|
+
// be created (test1, and test2).
|
|
35
|
+
// We then apply the template() rule, which takes a tree and apply two templates to it:
|
|
36
|
+
// path templates: this template replaces instances of __X__ in paths with the value of
|
|
37
|
+
// X from the options passed to template(). If the value of X is a
|
|
38
|
+
// function, the function will be called. If the X is undefined or it
|
|
39
|
+
// returns null (not empty string), the file or path will be removed.
|
|
40
|
+
// content template: this is similar to EJS, but does so in place (there's no special
|
|
41
|
+
// extension), does not support additional functions if you don't pass
|
|
42
|
+
// them in, and only work on text files (we use an algorithm to detect
|
|
43
|
+
// if a file is binary or not).
|
|
44
|
+
mergeWith(
|
|
45
|
+
apply(url('./files'), [
|
|
46
|
+
template({
|
|
47
|
+
INDEX: options.index,
|
|
48
|
+
name: options.name,
|
|
49
|
+
}),
|
|
50
|
+
]),
|
|
51
|
+
),
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
|
|
5
|
+
// SchematicTestRunner needs an absolute path to the collection to test.
|
|
6
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
7
|
+
|
|
8
|
+
describe('my-full-schematic', () => {
|
|
9
|
+
it('requires required option', async () => {
|
|
10
|
+
// We test that
|
|
11
|
+
const runner = new SchematicTestRunner('schematics', collectionPath);
|
|
12
|
+
await expectAsync(
|
|
13
|
+
runner.runSchematic('my-full-schematic', {}, Tree.empty())
|
|
14
|
+
).toBeRejected();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('works', async () => {
|
|
18
|
+
const runner = new SchematicTestRunner('schematics', collectionPath);
|
|
19
|
+
const tree = await runner.runSchematic('my-full-schematic', { name: 'str' }, Tree.empty());
|
|
20
|
+
|
|
21
|
+
// Listing files
|
|
22
|
+
expect(tree.files.sort()).toEqual(['/allo', '/hola', '/test1', '/test2']);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "MyFullSchematicsSchema",
|
|
4
|
+
"title": "My Full Schematics Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"index": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"default": 1
|
|
10
|
+
},
|
|
11
|
+
"name": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": ["name"]
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Rule, SchematicContext, Tree, chain, schematic } from '@angular-devkit/schematics';
|
|
2
|
+
|
|
3
|
+
// A factory is a RuleFactory. It takes the options that might have been coming from the command
|
|
4
|
+
// line or another schematic. These can be defined in a schema.json, which will validate
|
|
5
|
+
export default function (options: any): Rule {
|
|
6
|
+
// The chain rule allows us to chain multiple rules and apply them one after the other.
|
|
7
|
+
return chain([
|
|
8
|
+
(tree: Tree, context: SchematicContext) => {
|
|
9
|
+
// Show the options for this Schematics.
|
|
10
|
+
context.logger.info('My Other Schematic: ' + JSON.stringify(options));
|
|
11
|
+
|
|
12
|
+
// Create a single file. Since this tree is not branched, we are working in the
|
|
13
|
+
// same staging area as the other schematic, and as such cannot create the same
|
|
14
|
+
// file twice.
|
|
15
|
+
tree.create('hola', 'mundo');
|
|
16
|
+
},
|
|
17
|
+
// The schematic Rule calls the schematic from the same collection, with the options
|
|
18
|
+
// passed in. Please note that if the schematic has a schema, the options will be
|
|
19
|
+
// validated and could throw, e.g. if a required option is missing.
|
|
20
|
+
schematic('my-schematic', { option: true }),
|
|
21
|
+
(tree: Tree) => {
|
|
22
|
+
// But since we're working off the same staging area, we can move the file created
|
|
23
|
+
// by the schematic above.
|
|
24
|
+
tree.rename('hello', 'allo');
|
|
25
|
+
},
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
|
|
5
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
6
|
+
|
|
7
|
+
describe('my-other-schematic', () => {
|
|
8
|
+
it('works', async () => {
|
|
9
|
+
const runner = new SchematicTestRunner('schematics', collectionPath);
|
|
10
|
+
const tree = await runner.runSchematic('my-other-schematic', {}, Tree.empty());
|
|
11
|
+
|
|
12
|
+
expect(tree.files.sort()).toEqual(['/allo', '/hola']);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
|
|
3
|
+
// You don't have to export the function as default. You can also have more than one rule factory
|
|
4
|
+
// per file.
|
|
5
|
+
export function mySchematic(options: any): Rule {
|
|
6
|
+
return (tree: Tree, context: SchematicContext) => {
|
|
7
|
+
// Show the options for this Schematics.
|
|
8
|
+
// The logging here is at the discretion of the tooling. It can be ignored or only showing
|
|
9
|
+
// info/warnings/errors. If you use console.log() there is not guarantee it will be
|
|
10
|
+
// propagated to a user in any way (for example, an IDE running this schematic might
|
|
11
|
+
// have a logging window but no support for console.log).
|
|
12
|
+
context.logger.info('My Schematic: ' + JSON.stringify(options));
|
|
13
|
+
|
|
14
|
+
// Create a single file. This is the simplest example of transforming the tree.
|
|
15
|
+
// If a file with that name already exists, the generation will NOT fail until the tool
|
|
16
|
+
// is trying to commit this to disk. This is because we allow you to work on what is
|
|
17
|
+
// called a "staging" area, and only finalize those changes when the schematics is
|
|
18
|
+
// done. This allows you to create files without having to verify if they exist
|
|
19
|
+
// already, then rename them later. Templating works in a similar fashion.
|
|
20
|
+
tree.create('hello', 'world');
|
|
21
|
+
|
|
22
|
+
// At the end, you can either return a Tree (that will be used), or an observable of a
|
|
23
|
+
// Tree (if you have some asynchronous tasks).
|
|
24
|
+
return tree;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
|
|
5
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
6
|
+
|
|
7
|
+
describe('my-schematic', () => {
|
|
8
|
+
it('works', async () => {
|
|
9
|
+
const runner = new SchematicTestRunner('schematics', collectionPath);
|
|
10
|
+
const tree = await runner.runSchematic('my-schematic', {}, Tree.empty());
|
|
11
|
+
|
|
12
|
+
expect(tree.files).toEqual(['/hello']);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": "tsconfig",
|
|
4
|
+
"lib": ["es2018", "dom"],
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"noEmitOnError": true,
|
|
8
|
+
"noFallthroughCasesInSwitch": true,
|
|
9
|
+
"noImplicitAny": true,
|
|
10
|
+
"noImplicitThis": true,
|
|
11
|
+
"noUnusedParameters": true,
|
|
12
|
+
"noUnusedLocals": true,
|
|
13
|
+
"rootDir": "src/",
|
|
14
|
+
"skipDefaultLibCheck": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"strictNullChecks": true,
|
|
18
|
+
"target": "es6",
|
|
19
|
+
"types": ["jasmine", "node"]
|
|
20
|
+
},
|
|
21
|
+
"include": ["src/**/*"],
|
|
22
|
+
"exclude": ["src/*/files/**/*"]
|
|
23
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title><%= utils.classify(name) %></title>
|
|
6
|
+
<base href="/">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<<%= prefix %>-root></<%= prefix %>-root>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<% if(!!viewEncapsulation) { %>import { ViewEncapsulation } from '@angular/core';
|
|
2
|
+
<% }%>import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
3
|
+
|
|
4
|
+
import { AppModule } from './app/app.module';
|
|
5
|
+
|
|
6
|
+
<% if(!!viewEncapsulation) { %>
|
|
7
|
+
platformBrowserDynamic().bootstrapModule(AppModule, {
|
|
8
|
+
defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %>
|
|
9
|
+
})
|
|
10
|
+
.catch(err => console.error(err));<% } else { %>
|
|
11
|
+
platformBrowserDynamic().bootstrapModule(AppModule)
|
|
12
|
+
.catch(err => console.error(err));
|
|
13
|
+
<% } %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/app",
|
|
6
|
+
"types": []
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"src/main.ts"
|
|
10
|
+
],
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*.d.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"src/**/*.spec.ts",
|
|
12
|
+
"src/**/*.d.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<p><%= dasherize(name) %> works!</p>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { <%= classify(name) %><%= classify(type) %> } from './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>';
|
|
4
|
+
|
|
5
|
+
describe('<%= classify(name) %><%= classify(type) %>', () => {
|
|
6
|
+
let component: <%= classify(name) %><%= classify(type) %>;
|
|
7
|
+
let fixture: ComponentFixture<<%= classify(name) %><%= classify(type) %>>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
<%= standalone ? 'imports' : 'declarations' %>: [ <%= classify(name) %><%= classify(type) %> ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(<%= classify(name) %><%= classify(type) %>);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { <% if(changeDetection !== 'Default') { %>ChangeDetectionStrategy, <% }%>Component<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%> } from '@angular/core';<% if(standalone) {%>
|
|
2
|
+
import { CommonModule } from '@angular/common';<% } %>
|
|
3
|
+
|
|
4
|
+
@Component({<% if(!skipSelector) {%>
|
|
5
|
+
selector: '<%= selector %>',<%}%><% if(standalone) {%>
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [CommonModule],<%}%><% if(inlineTemplate) { %>
|
|
8
|
+
template: `
|
|
9
|
+
<p>
|
|
10
|
+
<%= dasherize(name) %> works!
|
|
11
|
+
</p>
|
|
12
|
+
`<% } else { %>
|
|
13
|
+
templateUrl: './<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.html'<% } if(inlineStyle) { %>,
|
|
14
|
+
styles: [<% if(displayBlock){ %>
|
|
15
|
+
`
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
`<% } %>
|
|
20
|
+
]<% } else if (style !== 'none') { %>,
|
|
21
|
+
styleUrls: ['./<%= dasherize(name) %><%= type ? '.' + dasherize(type): '' %>.<%= style %>']<% } %><% if(!!viewEncapsulation) { %>,
|
|
22
|
+
encapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } if (changeDetection !== 'Default') { %>,
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.<%= changeDetection %><% } %>
|
|
24
|
+
})
|
|
25
|
+
export class <%= classify(name) %><%= classify(type) %> {
|
|
26
|
+
|
|
27
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Karma configuration file, see link for more information
|
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
+
|
|
4
|
+
module.exports = function (config) {
|
|
5
|
+
config.set({
|
|
6
|
+
basePath: '',
|
|
7
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
+
plugins: [
|
|
9
|
+
require('karma-jasmine'),
|
|
10
|
+
require('karma-chrome-launcher'),
|
|
11
|
+
require('karma-jasmine-html-reporter'),
|
|
12
|
+
require('karma-coverage'),
|
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
+
],
|
|
15
|
+
client: {
|
|
16
|
+
jasmine: {
|
|
17
|
+
// you can add configuration options for Jasmine here
|
|
18
|
+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
19
|
+
// for example, you can disable the random execution with `random: false`
|
|
20
|
+
// or set a specific seed with `seed: 4321`
|
|
21
|
+
},
|
|
22
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
23
|
+
},
|
|
24
|
+
jasmineHtmlReporter: {
|
|
25
|
+
suppressAll: true // removes the duplicated traces
|
|
26
|
+
},
|
|
27
|
+
coverageReporter: {
|
|
28
|
+
dir: require('path').join(__dirname, '<%= relativePathToWorkspaceRoot %>/coverage/<%= folderName %>'),
|
|
29
|
+
subdir: '.',
|
|
30
|
+
reporters: [
|
|
31
|
+
{ type: 'html' },
|
|
32
|
+
{ type: 'text-summary' }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
reporters: ['progress', 'kjhtml'],
|
|
36
|
+
browsers: ['Chrome'],
|
|
37
|
+
restartOnFileChange: true
|
|
38
|
+
});
|
|
39
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { <%= classify(name) %>Directive } from './<%= dasherize(name) %>.directive';
|
|
2
|
+
|
|
3
|
+
describe('<%= classify(name) %>Directive', () => {
|
|
4
|
+
it('should create an instance', () => {
|
|
5
|
+
const directive = new <%= classify(name) %>Directive();
|
|
6
|
+
expect(directive).toBeTruthy();
|
|
7
|
+
});
|
|
8
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
// Protractor configuration file, see link for more information
|
|
3
|
+
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
|
4
|
+
|
|
5
|
+
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @type { import("protractor").Config }
|
|
9
|
+
*/
|
|
10
|
+
exports.config = {
|
|
11
|
+
allScriptsTimeout: 11000,
|
|
12
|
+
specs: [
|
|
13
|
+
'./src/**/*.e2e-spec.ts'
|
|
14
|
+
],
|
|
15
|
+
capabilities: {
|
|
16
|
+
browserName: 'chrome'
|
|
17
|
+
},
|
|
18
|
+
directConnect: true,
|
|
19
|
+
SELENIUM_PROMISE_MANAGER: false,
|
|
20
|
+
baseUrl: 'http://localhost:4200/',
|
|
21
|
+
framework: 'jasmine',
|
|
22
|
+
jasmineNodeOpts: {
|
|
23
|
+
showColors: true,
|
|
24
|
+
defaultTimeoutInterval: 30000,
|
|
25
|
+
print: function() {}
|
|
26
|
+
},
|
|
27
|
+
onPrepare() {
|
|
28
|
+
require('ts-node').register({
|
|
29
|
+
project: require('path').join(__dirname, './tsconfig.json')
|
|
30
|
+
});
|
|
31
|
+
jasmine.getEnv().addReporter(new SpecReporter({
|
|
32
|
+
spec: {
|
|
33
|
+
displayStacktrace: StacktraceOption.PRETTY
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { browser, logging } from 'protractor';
|
|
2
|
+
import { AppPage } from './app.po';
|
|
3
|
+
|
|
4
|
+
describe('workspace-project App', () => {
|
|
5
|
+
let page: AppPage;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
page = new AppPage();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should display welcome message', async () => {
|
|
12
|
+
await page.navigateTo();
|
|
13
|
+
expect(await page.getTitleText()).toEqual('<%= relatedAppName %> app is running!');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
afterEach(async () => {
|
|
17
|
+
// Assert that there are no errors emitted from the browser
|
|
18
|
+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
|
|
19
|
+
expect(logs).not.toContain(jasmine.objectContaining({
|
|
20
|
+
level: logging.Level.SEVERE,
|
|
21
|
+
} as logging.Entry));
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { browser, by, element } from 'protractor';
|
|
2
|
+
|
|
3
|
+
export class AppPage {
|
|
4
|
+
async navigateTo(): Promise<unknown> {
|
|
5
|
+
return browser.get(browser.baseUrl);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
async getTitleText(): Promise<string> {
|
|
9
|
+
return element(by.css('<%= rootSelector %> .content span')).getText();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/e2e",
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"target": "es2019",
|
|
8
|
+
"types": [
|
|
9
|
+
"jasmine",
|
|
10
|
+
"node"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|