@tech4good/angular-schematics 13.1.0 → 13.3.0

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.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/src/collection.json +11 -0
  3. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.actions.ts.template +270 -0
  4. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.effects.ts.template +131 -0
  5. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.model.ts.template +3 -0
  6. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +13 -0
  7. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +51 -0
  8. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.service.ts.template +50 -0
  9. package/src/entity-in-example/index.d.ts +2 -0
  10. package/src/entity-in-example/index.js +141 -0
  11. package/src/entity-in-example/index.js.map +1 -0
  12. package/src/entity-in-example/index_spec.d.ts +1 -0
  13. package/src/entity-in-example/index_spec.js +23 -0
  14. package/src/entity-in-example/index_spec.js.map +1 -0
  15. package/src/entity-in-example/schema.json +42 -0
  16. package/src/init/files/.eslintrc.json +120 -0
  17. package/src/init/files/.gitattributes +11 -0
  18. package/src/init/files/.github/workflows/angular-github-ci.yml.template +60 -0
  19. package/src/init/files/angular.json.template +132 -0
  20. package/src/init/files/package.json.template +60 -0
  21. package/src/init/files/src/app/app.component.html +3 -0
  22. package/src/init/files/src/app/app.component.scss +4 -0
  23. package/src/init/files/src/app/general/e404/e404.component.html +1 -0
  24. package/src/init/files/src/app/general/e404/e404.component.scss +0 -0
  25. package/src/init/files/src/app/general/login/login.component.html +11 -0
  26. package/src/init/files/src/app/general/login/login.component.scss +29 -0
  27. package/src/init/files/src/index.html.template +19 -0
  28. package/src/init/files/src/styles/_variables.scss +0 -0
  29. package/src/init/files/src/styles.scss +13 -0
  30. package/src/init/index.d.ts +2 -0
  31. package/src/init/index.js +50 -0
  32. package/src/init/index.js.map +1 -0
  33. package/src/init/schema.json +28 -0
@@ -0,0 +1,29 @@
1
+ .login-container {
2
+ max-width: 430px;
3
+ padding: 40px 0;
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ justify-content: center;
8
+ border: 1px solid #E7E7E7;
9
+ box-shadow: 0px 5px 9px rgba(0, 0, 0, 0.02);
10
+ border-radius: 12px;
11
+ margin: 40px auto;
12
+
13
+ .profile {
14
+ width: 95px;
15
+ height: 95px;
16
+ border-radius: 50%;
17
+ background: #D8D8D8;
18
+ }
19
+
20
+ input {
21
+ margin-top: 30px;
22
+ width: 115px;
23
+ height: 42px;
24
+ background: #FAFAFA;
25
+ border: 1px solid #E1E1E1;
26
+ box-sizing: border-box;
27
+ border-radius: 4px;
28
+ }
29
+ }
@@ -0,0 +1,19 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title><%= classify(project) %></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
+ <link rel="preconnect" href="https://fonts.gstatic.com">
10
+ <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
11
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
12
+
13
+ <!-- External scripts -->
14
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
15
+ </head>
16
+ <body class="mat-typography">
17
+ <app-root></app-root>
18
+ </body>
19
+ </html>
File without changes
@@ -0,0 +1,13 @@
1
+ /* You can add global styles to this file, and also import other style files */
2
+
3
+ html, body, app-root {
4
+ height: 100%;
5
+ box-sizing: border-box;
6
+ padding: 0;
7
+ margin: 0;
8
+ font-family: Roboto, "Helvetica Neue", sans-serif;
9
+ }
10
+
11
+ *, *:before, *:after {
12
+ box-sizing: inherit;
13
+ }
@@ -0,0 +1,2 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export declare function init(options: any): Rule;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.init = void 0;
13
+ const schematics_1 = require("@angular-devkit/schematics");
14
+ //import { InsertChange } from '@schematics/angular/utility/change';
15
+ //import { buildRelativePath, findModuleFromOptions } from '@schematics/angular/utility/find-module';
16
+ //import { parseName } from '@schematics/angular/utility/parse-name';
17
+ //import { validateHtmlSelector } from '@schematics/angular/utility/validation';
18
+ const workspace_1 = require("@schematics/angular/utility/workspace");
19
+ const core_1 = require("@angular-devkit/core");
20
+ //import { getSourceText, simpleInsert } from '../shared/statements-adder';
21
+ function init(options) {
22
+ return (tree, context) => __awaiter(this, void 0, void 0, function* () {
23
+ // Warn them that this should only be used on a new repo and ask if they want to proceed
24
+ if (!options.proceed) {
25
+ context.logger.info("Cancelling generation request. This schematic should only be used to generate initial files on FRESH repos created from ng new.");
26
+ return (0, schematics_1.noop)();
27
+ }
28
+ context.logger.info(`options.project: ${options.project}`);
29
+ const workspace = yield (0, workspace_1.getWorkspace)(tree);
30
+ const project = workspace.projects.get(options.project);
31
+ if (!project) {
32
+ throw new schematics_1.SchematicsException(`Project "${options.project}" does not exist.`);
33
+ }
34
+ context.logger.info(`project: ${project}`);
35
+ options.path = (0, workspace_1.buildDefaultPath)(project);
36
+ context.logger.info(`options.path: ${options.path}`);
37
+ //const parsedPath = parseName(options.path as string, options.name);
38
+ //options.name = parsedPath.name;
39
+ //options.path = parsedPath.path;
40
+ const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
41
+ (0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
42
+ //move(parsedPath.path),
43
+ ]);
44
+ return (0, schematics_1.chain)([
45
+ (0, schematics_1.mergeWith)(templateSource, schematics_1.MergeStrategy.Overwrite)
46
+ ]);
47
+ });
48
+ }
49
+ exports.init = init;
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAIoC;AACpC,oEAAoE;AACpE,qGAAqG;AACrG,qEAAqE;AACrE,gFAAgF;AAChF,qEAAuF;AAEvF,+CAA+C;AAE/C,2EAA2E;AAE3E,SAAgB,IAAI,CAAC,OAAY;IAC/B,OAAO,CAAO,IAAU,EAAE,OAAyB,EAAE,EAAE;QAErD,wFAAwF;QACxF,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iIAAiI,CAAC,CAAC;YACvJ,OAAO,IAAA,iBAAI,GAAE,CAAC;SACf;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3D,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAiB,CAAC,CAAC;QAElE,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,gCAAmB,CAAC,YAAY,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAC;SAC/E;QACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;QAE3C,OAAO,CAAC,IAAI,GAAG,IAAA,4BAAgB,EAAC,OAAO,CAAC,CAAC;QACzC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAErD,qEAAqE;QACrE,iCAAiC;QACjC,iCAAiC;QAEjC,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YAC3C,IAAA,2BAAc,kCACT,cAAO,GACP,OAAO,EACV;YACF,wBAAwB;SACzB,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,sBAAS,EAAC,cAAc,EAAE,0BAAa,CAAC,SAAS,CAAC;SACnD,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC;AArCD,oBAqCC"}
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "InitSchema",
4
+ "title": "Init Schema",
5
+ "type": "object",
6
+ "description": "Adds initial project files to a newly created repo.",
7
+ "properties": {
8
+ "index": {
9
+ "type": "number",
10
+ "default": 1
11
+ },
12
+ "project": {
13
+ "type": "string",
14
+ "description": "The name of the project.",
15
+ "$default": {
16
+ "$source": "projectName"
17
+ }
18
+ },
19
+ "proceed": {
20
+ "type": "boolean",
21
+ "x-prompt": "This schematic is only designed for generating initial files on a FRESH repo created from ng new. If you use this outside of that context, YOU WILL OVERWRITE parts of your existing code. Are you sure you want to proceed?"
22
+ }
23
+
24
+ },
25
+ "required": [
26
+ "project"
27
+ ]
28
+ }