@ngbase/adk 0.1.4 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngbase/adk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/ng-base/ngbase.git"
@@ -40,13 +40,17 @@
40
40
  "types": "./accordion/index.d.ts",
41
41
  "default": "./fesm2022/ngbase-adk-accordion.mjs"
42
42
  },
43
+ "./avatar": {
44
+ "types": "./avatar/index.d.ts",
45
+ "default": "./fesm2022/ngbase-adk-avatar.mjs"
46
+ },
43
47
  "./autocomplete": {
44
48
  "types": "./autocomplete/index.d.ts",
45
49
  "default": "./fesm2022/ngbase-adk-autocomplete.mjs"
46
50
  },
47
- "./avatar": {
48
- "types": "./avatar/index.d.ts",
49
- "default": "./fesm2022/ngbase-adk-avatar.mjs"
51
+ "./breadcrumb": {
52
+ "types": "./breadcrumb/index.d.ts",
53
+ "default": "./fesm2022/ngbase-adk-breadcrumb.mjs"
50
54
  },
51
55
  "./bidi": {
52
56
  "types": "./bidi/index.d.ts",
@@ -56,10 +60,6 @@
56
60
  "types": "./cache/index.d.ts",
57
61
  "default": "./fesm2022/ngbase-adk-cache.mjs"
58
62
  },
59
- "./breadcrumb": {
60
- "types": "./breadcrumb/index.d.ts",
61
- "default": "./fesm2022/ngbase-adk-breadcrumb.mjs"
62
- },
63
63
  "./carousel": {
64
64
  "types": "./carousel/index.d.ts",
65
65
  "default": "./fesm2022/ngbase-adk-carousel.mjs"
@@ -232,25 +232,25 @@
232
232
  "types": "./tooltip/index.d.ts",
233
233
  "default": "./fesm2022/ngbase-adk-tooltip.mjs"
234
234
  },
235
- "./tour": {
236
- "types": "./tour/index.d.ts",
237
- "default": "./fesm2022/ngbase-adk-tour.mjs"
238
- },
239
235
  "./translate": {
240
236
  "types": "./translate/index.d.ts",
241
237
  "default": "./fesm2022/ngbase-adk-translate.mjs"
242
238
  },
239
+ "./tour": {
240
+ "types": "./tour/index.d.ts",
241
+ "default": "./fesm2022/ngbase-adk-tour.mjs"
242
+ },
243
243
  "./tree": {
244
244
  "types": "./tree/index.d.ts",
245
245
  "default": "./fesm2022/ngbase-adk-tree.mjs"
246
246
  },
247
- "./utils": {
248
- "types": "./utils/index.d.ts",
249
- "default": "./fesm2022/ngbase-adk-utils.mjs"
250
- },
251
247
  "./virtualizer": {
252
248
  "types": "./virtualizer/index.d.ts",
253
249
  "default": "./fesm2022/ngbase-adk-virtualizer.mjs"
250
+ },
251
+ "./utils": {
252
+ "types": "./utils/index.d.ts",
253
+ "default": "./fesm2022/ngbase-adk-utils.mjs"
254
254
  }
255
255
  }
256
256
  }
@@ -3,26 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.myGenerator = myGenerator;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
5
  const core_1 = require("@angular-devkit/core");
6
- function readConfigFile(tree) {
7
- const configPath = 'ngbase.config.json';
8
- if (tree.exists(configPath)) {
9
- const buffer = tree.read(configPath);
10
- if (buffer) {
11
- try {
12
- const content = JSON.parse(buffer.toString());
13
- return content;
14
- }
15
- catch (error) {
16
- console.warn(`⚠️ Failed to parse ${configPath}:`, error);
17
- }
18
- }
19
- }
20
- return {};
21
- }
22
6
  function myGenerator(options) {
23
- return (tree) => {
24
- const config = readConfigFile(tree);
25
- const finalOptions = Object.assign(Object.assign({}, config), options);
7
+ return () => {
26
8
  if (!options.component || options.component.length === 0) {
27
9
  return (0, schematics_1.noop)();
28
10
  }
@@ -30,7 +12,7 @@ function myGenerator(options) {
30
12
  const sourceTemplates = (0, schematics_1.url)(`./files/${comp}`);
31
13
  const targetPath = options.path || '';
32
14
  const sourceParametrizedTemplates = (0, schematics_1.apply)(sourceTemplates, [
33
- (0, schematics_1.applyTemplates)(Object.assign(Object.assign(Object.assign({}, core_1.strings), finalOptions), { component: comp })),
15
+ (0, schematics_1.applyTemplates)(Object.assign(Object.assign(Object.assign({}, core_1.strings), options), { component: comp })),
34
16
  (0, schematics_1.move)((0, core_1.normalize)(`/${targetPath}/${comp}`)),
35
17
  ]);
36
18
  return (0, schematics_1.mergeWith)(sourceParametrizedTemplates);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/adk/schematics/components/index.ts"],"names":[],"mappings":";;AA8BA,kCA4BC;AA1DD,2DAUoC;AACpC,+CAA0D;AAG1D,SAAS,cAAc,CAAC,IAAU;IAChC,MAAM,UAAU,GAAG,oBAAoB,CAAC;IACxC,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACrC,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC9C,OAAO,OAAO,CAAC;YACjB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,sBAAsB,UAAU,GAAG,EAAE,KAAK,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAgB,WAAW,CAAC,OAA0B;IACpD,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,YAAY,mCAAQ,MAAM,GAAK,OAAO,CAAE,CAAC;QAE/C,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzD,OAAO,IAAA,iBAAI,GAAE,CAAC;QAChB,CAAC;QAED,MAAM,KAAK,GAAW,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACjD,MAAM,eAAe,GAAG,IAAA,gBAAG,EAAC,WAAW,IAAI,EAAE,CAAC,CAAC;YAE/C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;YAEtC,MAAM,2BAA2B,GAAG,IAAA,kBAAK,EAAC,eAAe,EAAE;gBACzD,IAAA,2BAAc,gDACT,cAAO,GACP,YAAY,KACf,SAAS,EAAE,IAAI,IACf;gBACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC,CAAC;aAC1C,CAAC,CAAC;YAEH,OAAO,IAAA,sBAAS,EAAC,2BAA2B,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/adk/schematics/components/index.ts"],"names":[],"mappings":";;AAaA,kCAyBC;AAtCD,2DASoC;AACpC,+CAA0D;AAG1D,SAAgB,WAAW,CAAC,OAA0B;IACpD,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzD,OAAO,IAAA,iBAAI,GAAE,CAAC;QAChB,CAAC;QAED,MAAM,KAAK,GAAW,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACjD,MAAM,eAAe,GAAG,IAAA,gBAAG,EAAC,WAAW,IAAI,EAAE,CAAC,CAAC;YAE/C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;YAEtC,MAAM,2BAA2B,GAAG,IAAA,kBAAK,EAAC,eAAe,EAAE;gBACzD,IAAA,2BAAc,gDACT,cAAO,GACP,OAAO,KACV,SAAS,EAAE,IAAI,IACf;gBACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC,CAAC;aAC1C,CAAC,CAAC;YAEH,OAAO,IAAA,sBAAS,EAAC,2BAA2B,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC"}
@@ -7,32 +7,12 @@ import {
7
7
  url,
8
8
  chain,
9
9
  noop,
10
- Tree,
11
10
  } from '@angular-devkit/schematics';
12
11
  import { strings, normalize } from '@angular-devkit/core';
13
12
  import { MyGeneratorSchema } from './schema';
14
13
 
15
- function readConfigFile(tree: Tree): Partial<MyGeneratorSchema> {
16
- const configPath = 'ngbase.config.json';
17
- if (tree.exists(configPath)) {
18
- const buffer = tree.read(configPath);
19
- if (buffer) {
20
- try {
21
- const content = JSON.parse(buffer.toString());
22
- return content;
23
- } catch (error) {
24
- console.warn(`⚠️ Failed to parse ${configPath}:`, error);
25
- }
26
- }
27
- }
28
- return {};
29
- }
30
-
31
14
  export function myGenerator(options: MyGeneratorSchema): Rule {
32
- return (tree: Tree) => {
33
- const config = readConfigFile(tree);
34
- const finalOptions = { ...config, ...options };
35
-
15
+ return () => {
36
16
  if (!options.component || options.component.length === 0) {
37
17
  return noop();
38
18
  }
@@ -45,7 +25,7 @@ export function myGenerator(options: MyGeneratorSchema): Rule {
45
25
  const sourceParametrizedTemplates = apply(sourceTemplates, [
46
26
  applyTemplates({
47
27
  ...strings,
48
- ...finalOptions,
28
+ ...options,
49
29
  component: comp,
50
30
  }),
51
31
  move(normalize(`/${targetPath}/${comp}`)),
@@ -25,62 +25,65 @@
25
25
  },
26
26
  "component": {
27
27
  "description": "The file extension or preprocessor to use for style files.",
28
- "type": "string",
29
- "default": "accordion",
30
- "enum": [
31
- "accordion",
32
- "alert",
33
- "autocomplete",
34
- "avatar",
35
- "badge",
36
- "breadcrumb",
37
- "button",
38
- "card",
39
- "carousel",
40
- "checkbox",
41
- "chip",
42
- "color-picker",
43
- "command",
44
- "datepicker",
45
- "dialog",
46
- "drawer",
47
- "form-field",
48
- "hover-card",
49
- "icon",
50
- "inline-edit",
51
- "keys",
52
- "list",
53
- "mask",
54
- "menu",
55
- "otp",
56
- "pagination",
57
- "popover",
58
- "progress",
59
- "radio",
60
- "resizable",
61
- "scroll-area",
62
- "select",
63
- "selectable",
64
- "separator",
65
- "sheet",
66
- "sidenav",
67
- "skeleton",
68
- "slider",
69
- "sonner",
70
- "spinner",
71
- "stepper",
72
- "switch",
73
- "table",
74
- "tabs",
75
- "toggle",
76
- "toggle-group",
77
- "tooltip",
78
- "tour",
79
- "tree"
80
- ],
28
+ "type": "array",
29
+ "items": {
30
+ "type": "string",
31
+ "enum": [
32
+ "accordion",
33
+ "alert",
34
+ "autocomplete",
35
+ "avatar",
36
+ "badge",
37
+ "breadcrumb",
38
+ "button",
39
+ "card",
40
+ "carousel",
41
+ "checkbox",
42
+ "chip",
43
+ "color-picker",
44
+ "command",
45
+ "datepicker",
46
+ "dialog",
47
+ "drawer",
48
+ "form-field",
49
+ "hover-card",
50
+ "icon",
51
+ "inline-edit",
52
+ "keys",
53
+ "list",
54
+ "mask",
55
+ "menu",
56
+ "otp",
57
+ "pagination",
58
+ "popover",
59
+ "progress",
60
+ "radio",
61
+ "resizable",
62
+ "scroll-area",
63
+ "select",
64
+ "selectable",
65
+ "separator",
66
+ "sheet",
67
+ "sidenav",
68
+ "skeleton",
69
+ "slider",
70
+ "sonner",
71
+ "spinner",
72
+ "stepper",
73
+ "switch",
74
+ "table",
75
+ "tabs",
76
+ "toggle",
77
+ "toggle-group",
78
+ "tooltip",
79
+ "tour",
80
+ "tree"
81
+ ]
82
+ },
81
83
  "x-prompt": {
82
84
  "message": "Which component would you like to create?",
83
- "type": "checkbox",
85
+ "type": "list",
86
+ "multiselect": true,
84
87
  "items": [
85
88
  { "value": "accordion", "label": "Accordion" },
86
89
  { "value": "alert", "label": "Alert" },
@@ -132,14 +135,8 @@
132
135
  { "value": "tour", "label": "Tour" },
133
136
  { "value": "tree", "label": "Tree" }
134
137
  ]
135
- },
136
- "project": {
137
- "type": "string",
138
- "description": "The name of the project.",
139
- "$default": {
140
- "$source": "projectName"
141
- }
142
138
  }
143
139
  }
144
- }
140
+ },
141
+ "required": ["name", "path", "basepath", "component"]
145
142
  }