ngx-theme-stack 0.0.14 → 0.0.15

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": "ngx-theme-stack",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "A stack of themes for Angular applications.",
5
5
  "schematics": "./schematics/collection.json",
6
6
  "ng-add": {
@@ -3,7 +3,7 @@
3
3
  "schematics": {
4
4
  "ng-add": {
5
5
  "description": "Add my library to the project.",
6
- "factory": "./ng-add/index#ngAdd",
6
+ "factory": "./ng-add/index.cjs#ngAdd",
7
7
  "schema": "./ng-add/schema.json"
8
8
  }
9
9
  }
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ngAdd = ngAdd;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ // ---------------------------------------------------------------------------
6
+ // Default configuration (mirrors DEFAULT_NG_CONFIG from the library)
7
+ // ---------------------------------------------------------------------------
8
+ const DEFAULTS = {
9
+ theme: 'system',
10
+ storageKey: 'ngx-theme-stack-theme',
11
+ themeMode: 'class',
12
+ };
13
+ // ---------------------------------------------------------------------------
14
+ // Helper: build the provideThemeStack() call string
15
+ // ---------------------------------------------------------------------------
16
+ function buildProvideCall(theme, storageKey, themeMode) {
17
+ const isDefault = theme === DEFAULTS.theme &&
18
+ storageKey === DEFAULTS.storageKey &&
19
+ themeMode === DEFAULTS.themeMode;
20
+ if (isDefault) {
21
+ // Clean call — no arguments needed, defaults will be used by the library
22
+ return `provideThemeStack()`;
23
+ }
24
+ const parts = [];
25
+ if (theme !== DEFAULTS.theme)
26
+ parts.push(`theme: '${theme}'`);
27
+ if (storageKey !== DEFAULTS.storageKey)
28
+ parts.push(`storageKey: '${storageKey}'`);
29
+ if (themeMode !== DEFAULTS.themeMode)
30
+ parts.push(`mode: '${themeMode}'`);
31
+ return `provideThemeStack({ ${parts.join(', ')} })`;
32
+ }
33
+ // ---------------------------------------------------------------------------
34
+ // Helper: patch app.config.ts (or main.ts for bootstrapApplication)
35
+ // ---------------------------------------------------------------------------
36
+ function patchAppConfig(tree, context, provideCall) {
37
+ // Try app.config.ts first (standalone Angular ≥ 17 default)
38
+ const candidates = [
39
+ 'src/app/app.config.ts',
40
+ 'src/main.ts',
41
+ 'src/app/app.module.ts',
42
+ ];
43
+ let patched = false;
44
+ for (const filePath of candidates) {
45
+ if (!tree.exists(filePath))
46
+ continue;
47
+ const content = tree.readText(filePath);
48
+ // Already configured?
49
+ if (content.includes('provideThemeStack')) {
50
+ context.logger.info(`✔ ngx-theme-stack is already configured in ${filePath}`);
51
+ patched = true;
52
+ break;
53
+ }
54
+ // -----------------------------------------------------------------------
55
+ // app.config.ts / standalone bootstrapApplication pattern
56
+ // -----------------------------------------------------------------------
57
+ if (filePath.endsWith('app.config.ts') || filePath.endsWith('main.ts')) {
58
+ // Add import statement
59
+ let updated = content;
60
+ if (!updated.includes("from 'ngx-theme-stack'")) {
61
+ const lastImportIndex = updated.lastIndexOf("import ");
62
+ const endOfLine = updated.indexOf('\n', lastImportIndex);
63
+ const importStatement = `import { provideThemeStack } from 'ngx-theme-stack';`;
64
+ updated =
65
+ updated.slice(0, endOfLine + 1) +
66
+ importStatement + '\n' +
67
+ updated.slice(endOfLine + 1);
68
+ }
69
+ // Inject into providers array
70
+ if (updated.includes('providers:')) {
71
+ // Insert before closing bracket of providers array
72
+ updated = updated.replace(/providers:\s*\[([\s\S]*?)\]/, (_match, inner) => {
73
+ const trimmed = inner.trimEnd();
74
+ const separator = trimmed.length > 0 && !trimmed.endsWith(',') ? ',\n ' : '\n ';
75
+ return `providers: [${trimmed}${separator}${provideCall}\n ]`;
76
+ });
77
+ }
78
+ else if (updated.includes('bootstrapApplication')) {
79
+ // No providers key yet — add it
80
+ updated = updated.replace(/bootstrapApplication\s*\(\s*([^,)]+)\s*\)/, `bootstrapApplication($1, {\n providers: [\n ${provideCall}\n ]\n})`);
81
+ }
82
+ tree.overwrite(filePath, updated);
83
+ context.logger.info(`✔ Added ${provideCall} to ${filePath}`);
84
+ patched = true;
85
+ break;
86
+ }
87
+ // -----------------------------------------------------------------------
88
+ // app.module.ts (legacy NgModule pattern)
89
+ // -----------------------------------------------------------------------
90
+ if (filePath.endsWith('app.module.ts')) {
91
+ let updated = content;
92
+ if (!updated.includes("from 'ngx-theme-stack'")) {
93
+ const lastImportIndex = updated.lastIndexOf("import ");
94
+ const endOfLine = updated.indexOf('\n', lastImportIndex);
95
+ const importStatement = `import { provideThemeStack } from 'ngx-theme-stack';`;
96
+ updated =
97
+ updated.slice(0, endOfLine + 1) +
98
+ importStatement + '\n' +
99
+ updated.slice(endOfLine + 1);
100
+ }
101
+ // Add to NgModule providers
102
+ updated = updated.replace(/providers:\s*\[([\s\S]*?)\]/, (_match, inner) => {
103
+ const trimmed = inner.trimEnd();
104
+ const separator = trimmed.length > 0 && !trimmed.endsWith(',') ? ',\n ' : '\n ';
105
+ return `providers: [${trimmed}${separator}${provideCall}\n ]`;
106
+ });
107
+ tree.overwrite(filePath, updated);
108
+ context.logger.info(`✔ Added ${provideCall} to ${filePath}`);
109
+ patched = true;
110
+ break;
111
+ }
112
+ }
113
+ if (!patched) {
114
+ context.logger.warn(`⚠ Could not locate app.config.ts, main.ts, or app.module.ts.\n` +
115
+ ` Please add the following manually to your providers array:\n\n` +
116
+ ` import { provideThemeStack } from 'ngx-theme-stack';\n\n` +
117
+ ` providers: [ ${provideCall} ]`);
118
+ }
119
+ }
120
+ // ---------------------------------------------------------------------------
121
+ // Schematic factory
122
+ // ---------------------------------------------------------------------------
123
+ function ngAdd(options) {
124
+ return (_tree, context) => {
125
+ var _a, _b, _c;
126
+ context.logger.info('');
127
+ context.logger.info('🎨 ngx-theme-stack — setup');
128
+ context.logger.info('');
129
+ // Resolve final config values
130
+ // In 'quick' mode the x-prompt for theme/storageKey/themeMode are never shown
131
+ // (they keep their schema defaults), so we always have usable values here.
132
+ const theme = options.mode === 'quick' ? DEFAULTS.theme : ((_a = options.theme) !== null && _a !== void 0 ? _a : DEFAULTS.theme);
133
+ const storageKey = options.mode === 'quick' ? DEFAULTS.storageKey : ((_b = options.storageKey) !== null && _b !== void 0 ? _b : DEFAULTS.storageKey);
134
+ const themeMode = options.mode === 'quick' ? DEFAULTS.themeMode : ((_c = options.themeMode) !== null && _c !== void 0 ? _c : DEFAULTS.themeMode);
135
+ if (options.mode === 'quick') {
136
+ context.logger.info('⚡ Quick setup — applying default configuration:');
137
+ }
138
+ else {
139
+ context.logger.info('🛠 Custom setup — applying your configuration:');
140
+ }
141
+ context.logger.info(` theme : ${theme}`);
142
+ context.logger.info(` storageKey : ${storageKey}`);
143
+ context.logger.info(` mode : ${themeMode}`);
144
+ context.logger.info('');
145
+ const provideCall = buildProvideCall(theme, storageKey, themeMode);
146
+ return (0, schematics_1.chain)([
147
+ (t, ctx) => {
148
+ patchAppConfig(t, ctx, provideCall);
149
+ ctx.logger.info('');
150
+ ctx.logger.info('✅ ngx-theme-stack configured successfully!');
151
+ ctx.logger.info(' Run `ng serve` to see your theme stack in action.');
152
+ ctx.logger.info('');
153
+ },
154
+ ]);
155
+ };
156
+ }
157
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,3 @@
1
1
  import { Rule } from '@angular-devkit/schematics';
2
- export declare function ngAdd(): Rule;
2
+ import { Schema } from './schema';
3
+ export declare function ngAdd(options: Schema): Rule;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngx-theme-stack/schematics/ng-add/index.ts"],"names":[],"mappings":";;AACA,sBAGC;AAJD,2DAAuD;AACvD,SAAgB,KAAK;IACnB,wFAAwF;IACxF,OAAO,IAAA,kBAAK,EAAC,EAAE,CAAC,CAAC;AACnB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngx-theme-stack/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAmJA,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,IAAI,CAAC,6CAA6C,CAAC,CAAC;gBAC/D,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;gBACxE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACtB,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1,17 @@
1
+ /** Options passed to the ng-add schematic by the Angular CLI. */
2
+ export interface Schema {
3
+ /** Name of the Angular project to configure. */
4
+ project: string;
5
+ /**
6
+ * Installation mode:
7
+ * - 'quick' → apply defaults immediately, no further questions
8
+ * - 'custom' → prompt the user for each individual option
9
+ */
10
+ mode: 'quick' | 'custom';
11
+ /** Default theme applied on startup. Only used in custom mode. */
12
+ theme: 'system' | 'light' | 'dark' | string;
13
+ /** localStorage key used to persist the theme. Only used in custom mode. */
14
+ storageKey: string;
15
+ /** Strategy used to apply the theme to the <html> element. Only used in custom mode. */
16
+ themeMode: 'class' | 'attribute' | 'both';
17
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "NgxThemeStackNgAdd",
4
+ "title": "ngx-theme-stack ng-add",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "The name of the Angular project to configure.",
10
+ "$default": {
11
+ "$source": "projectName"
12
+ }
13
+ },
14
+ "mode": {
15
+ "type": "string",
16
+ "description": "Installation mode: quick uses defaults, custom asks each option.",
17
+ "default": "quick",
18
+ "enum": ["quick", "custom"],
19
+ "x-prompt": {
20
+ "message": "How do you want to configure ngx-theme-stack?",
21
+ "type": "list",
22
+ "items": [
23
+ {
24
+ "value": "quick",
25
+ "label": "Quick – use default settings (theme: system, mode: class, storageKey: ngx-theme-stack-theme)"
26
+ },
27
+ {
28
+ "value": "custom",
29
+ "label": "Custom – choose each option interactively"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ "theme": {
35
+ "type": "string",
36
+ "description": "Default theme to apply on startup.",
37
+ "default": "system",
38
+ "x-prompt": {
39
+ "message": "Which default theme should be applied on startup?",
40
+ "type": "list",
41
+ "items": [
42
+ { "value": "system", "label": "system – follow OS preference (recommended)" },
43
+ { "value": "light", "label": "light – always light" },
44
+ { "value": "dark", "label": "dark – always dark" }
45
+ ]
46
+ }
47
+ },
48
+ "storageKey": {
49
+ "type": "string",
50
+ "description": "localStorage key used to persist the selected theme.",
51
+ "default": "ngx-theme-stack-theme",
52
+ "x-prompt": "What localStorage key should be used to persist the theme? (default: ngx-theme-stack-theme)"
53
+ },
54
+ "themeMode": {
55
+ "type": "string",
56
+ "description": "Strategy used to apply the theme to the <html> element.",
57
+ "default": "class",
58
+ "enum": ["class", "attribute", "both"],
59
+ "x-prompt": {
60
+ "message": "How should the theme be applied to the <html> element?",
61
+ "type": "list",
62
+ "items": [
63
+ { "value": "class", "label": "class – add/remove CSS class (e.g. .dark)" },
64
+ { "value": "attribute", "label": "attribute – set data-theme attribute" },
65
+ { "value": "both", "label": "both – apply class AND attribute simultaneously" }
66
+ ]
67
+ }
68
+ }
69
+ },
70
+ "required": ["project"]
71
+ }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ngAdd = ngAdd;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- function ngAdd() {
6
- // Add an import `MyLibModule` from `ngx-theme-stack` to the root of the user's project.
7
- return (0, schematics_1.chain)([]);
8
- }
9
- //# sourceMappingURL=index.js.map
@@ -1,5 +0,0 @@
1
- import {chain, Rule} from '@angular-devkit/schematics';
2
- export function ngAdd(): Rule {
3
- // Add an import `MyLibModule` from `ngx-theme-stack` to the root of the user's project.
4
- return chain([]);
5
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=schema.js.map
File without changes
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }