@loomweaver/devkit 0.7.5 → 0.7.7
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 +1 -1
- package/src/generators/auth-source/generator.js +4 -7
- package/src/generators/auth-source/generator.js.map +1 -1
- package/src/generators/distribution/generator.js +51 -53
- package/src/generators/distribution/generator.js.map +1 -1
- package/src/generators/distribution/nx-files.js +23 -16
- package/src/generators/distribution/nx-files.js.map +1 -1
- package/src/generators/frame-plugin/generator.js +7 -10
- package/src/generators/frame-plugin/generator.js.map +1 -1
- package/src/generators/layout/generator.js +4 -7
- package/src/generators/layout/generator.js.map +1 -1
- package/src/generators/nx-scaffold-shared.js +2 -3
- package/src/generators/nx-scaffold-shared.js.map +1 -1
- package/src/generators/settings-store/generator.js +4 -7
- package/src/generators/settings-store/generator.js.map +1 -1
- package/src/generators/shared.d.ts +1 -1
- package/src/generators/shared.js +23 -20
- package/src/generators/shared.js.map +1 -1
- package/src/generators/theme/generator.js +4 -7
- package/src/generators/theme/generator.js.map +1 -1
- package/src/generators/weaver/generator.d.ts +2 -2
- package/src/generators/weaver/generator.js +66 -56
- package/src/generators/weaver/generator.js.map +1 -1
- package/src/generators/weaver/nx-files.js +20 -15
- package/src/generators/weaver/nx-files.js.map +1 -1
- package/src/generators/weaver/schema.json +5 -0
- package/src/index.d.ts +6 -6
- package/src/index.js +2 -1
- package/src/index.js.map +1 -1
- package/src/lib/amend/compose.js +37 -8
- package/src/lib/amend/compose.js.map +1 -1
- package/src/lib/amend/describe.js +3 -0
- package/src/lib/amend/describe.js.map +1 -1
- package/src/lib/amend/merge.d.ts +8 -1
- package/src/lib/amend/merge.js +64 -22
- package/src/lib/amend/merge.js.map +1 -1
- package/src/lib/amend/types.d.ts +12 -1
- package/src/lib/generate/generate.js +2 -3
- package/src/lib/generate/generate.js.map +1 -1
- package/src/lib/scaffolds/inputs.d.ts +1 -0
- package/src/lib/scaffolds/inputs.js +5 -5
- package/src/lib/scaffolds/inputs.js.map +1 -1
- package/src/lib/scaffolds/scaffolds.js +24 -18
- package/src/lib/scaffolds/scaffolds.js.map +1 -1
- package/src/lib/validate/catalog.js +20 -6
- package/src/lib/validate/catalog.js.map +1 -1
- package/src/lib/validate/i18n.js +1 -1
- package/src/lib/validate/i18n.js.map +1 -1
- package/src/recipes/angular-distribution/recipe.js +16 -5
- package/src/recipes/angular-distribution/recipe.js.map +1 -1
- package/src/recipes/angular-weaver/agent-files.d.ts +12 -0
- package/src/recipes/angular-weaver/agent-files.js +169 -0
- package/src/recipes/angular-weaver/agent-files.js.map +1 -0
- package/src/recipes/angular-weaver/agent-panel.d.ts +3 -0
- package/src/recipes/angular-weaver/agent-panel.js +193 -0
- package/src/recipes/angular-weaver/agent-panel.js.map +1 -0
- package/src/recipes/angular-weaver/agent-stand-in.d.ts +2 -0
- package/src/recipes/angular-weaver/agent-stand-in.js +93 -0
- package/src/recipes/angular-weaver/agent-stand-in.js.map +1 -0
- package/src/recipes/angular-weaver/amendments.d.ts +1 -1
- package/src/recipes/angular-weaver/amendments.js +19 -2
- package/src/recipes/angular-weaver/amendments.js.map +1 -1
- package/src/recipes/angular-weaver/recipe.d.ts +2 -0
- package/src/recipes/angular-weaver/recipe.js +48 -136
- package/src/recipes/angular-weaver/recipe.js.map +1 -1
- package/src/recipes/angular-weaver/weaver-i18n.d.ts +1 -1
- package/src/recipes/angular-weaver/weaver-i18n.js +11 -0
- package/src/recipes/angular-weaver/weaver-i18n.js.map +1 -1
- package/src/recipes/angular-weaver/weaver-readme.d.ts +2 -0
- package/src/recipes/angular-weaver/weaver-readme.js +142 -0
- package/src/recipes/angular-weaver/weaver-readme.js.map +1 -0
- package/src/recipes/angular-weaver/weaver-terms.d.ts +2 -0
- package/src/recipes/angular-weaver/weaver-terms.js +9 -0
- package/src/recipes/angular-weaver/weaver-terms.js.map +1 -0
- package/src/recipes/frame-plugin/recipe.js +1 -2
- package/src/recipes/frame-plugin/recipe.js.map +1 -1
- package/src/recipes/layout/recipe.js +2 -3
- package/src/recipes/layout/recipe.js.map +1 -1
- package/src/recipes/theme/recipe.js +1 -2
- package/src/recipes/theme/recipe.js.map +1 -1
|
@@ -1,69 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.weaverGenerator = weaverGenerator;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const generate_1 = require("../../lib/generate/generate");
|
|
7
6
|
const shared_1 = require("../shared");
|
|
7
|
+
const amendments_1 = require("../../recipes/angular-weaver/amendments");
|
|
8
8
|
const recipe_1 = require("../../recipes/angular-weaver/recipe");
|
|
9
9
|
const nx_files_1 = require("./nx-files");
|
|
10
|
-
function weaverGenerator(tree, options) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
10
|
+
async function weaverGenerator(tree, options) {
|
|
11
|
+
const baseTsconfig = (0, shared_1.tsconfigPathsFile)(tree);
|
|
12
|
+
const app = appFor(tree, options);
|
|
13
|
+
const project = (0, nx_files_1.nxWeaverProject)({
|
|
14
|
+
id: options.id,
|
|
15
|
+
projectName: options.projectName,
|
|
16
|
+
directory: options.directory,
|
|
17
|
+
importPath: options.importPath,
|
|
18
|
+
scope: (0, shared_1.workspaceScope)(tree),
|
|
19
|
+
tags: options.tags?.split(',').map((tag) => tag.trim()),
|
|
20
|
+
prefix: options.prefix,
|
|
21
|
+
buildTarget: app ? `${app}:build:development` : undefined,
|
|
22
|
+
baseTsconfig,
|
|
23
|
+
});
|
|
24
|
+
if (tree.exists(`${project.projectRoot}/project.json`)) {
|
|
25
|
+
throw new Error(`A project already exists at ${project.projectRoot}.`);
|
|
26
|
+
}
|
|
27
|
+
const input = {
|
|
28
|
+
id: options.id,
|
|
29
|
+
name: options.name,
|
|
30
|
+
prefix: project.prefix,
|
|
31
|
+
importPath: project.importPath,
|
|
32
|
+
features: {
|
|
33
|
+
command: options.command,
|
|
34
|
+
menu: options.menu,
|
|
35
|
+
settings: options.settings,
|
|
36
|
+
access: options.access,
|
|
37
|
+
shortcut: options.shortcut,
|
|
38
|
+
barItem: options.barItem,
|
|
39
|
+
about: options.about,
|
|
40
|
+
instanceable: options.instanceable,
|
|
41
|
+
container: options.container,
|
|
42
|
+
agent: options.agent,
|
|
43
|
+
spec: options.spec,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
const source = (0, generate_1.generate)(recipe_1.angularWeaver, input);
|
|
47
|
+
(0, shared_1.writeFiles)(tree, project.projectRoot, source, (0, nx_files_1.nxWeaverFiles)(project));
|
|
48
|
+
(0, devkit_1.updateJson)(tree, baseTsconfig, (json) => {
|
|
49
|
+
json.compilerOptions ??= {};
|
|
50
|
+
json.compilerOptions.paths ??= {};
|
|
51
|
+
json.compilerOptions.paths[project.importPath] = [
|
|
52
|
+
`./${project.projectRoot}/src/index.ts`,
|
|
53
|
+
];
|
|
54
|
+
return json;
|
|
55
|
+
});
|
|
56
|
+
if (app) {
|
|
57
|
+
(0, shared_1.addI18nAssetsGlob)(tree, app, {
|
|
58
|
+
input: `${project.projectRoot}/src/lib/i18n`,
|
|
59
|
+
output: `i18n/${options.id}`,
|
|
57
60
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
(0, shared_1.addTailwindSource)(tree, app, `${project.projectRoot}/src`);
|
|
62
|
+
}
|
|
63
|
+
const installed = addPackages(tree, (0, amendments_1.weaverAmendments)(input, project.projectRoot));
|
|
64
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
65
|
+
return installed;
|
|
66
|
+
}
|
|
67
|
+
function addPackages(tree, amendments) {
|
|
68
|
+
const wanted = {};
|
|
69
|
+
for (const amendment of amendments) {
|
|
70
|
+
if (amendment.kind === 'package') {
|
|
71
|
+
wanted[amendment.name] = amendment.version;
|
|
64
72
|
}
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
}
|
|
74
|
+
return Object.keys(wanted).length === 0
|
|
75
|
+
? undefined
|
|
76
|
+
: (0, devkit_1.addDependenciesToPackageJson)(tree, wanted, {});
|
|
67
77
|
}
|
|
68
78
|
function appFor(tree, options) {
|
|
69
79
|
if (options.unitTestRunner === 'none') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/generators/weaver/generator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/generators/weaver/generator.ts"],"names":[],"mappings":";;AAsBA,0CAmEC;AAzFD,uCAMoB;AAEpB,0DAAuD;AACvD,sCAOmB;AACnB,wEAA2E;AAC3E,gEAAoE;AACpE,yCAA4D;AAGrD,KAAK,UAAU,eAAe,CACnC,IAAU,EACV,OAA8B;IAE9B,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM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CAAC;QACnC,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;QAC7C,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QACrC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAA,qCAA4B,EAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,MAAM,CACb,IAAU,EACV,OAA8B;IAE9B,IAAI,OAAO,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,IAAA,mBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;AAC5C,CAAC;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -4,18 +4,18 @@ exports.nxWeaverProject = nxWeaverProject;
|
|
|
4
4
|
exports.nxWeaverFiles = nxWeaverFiles;
|
|
5
5
|
const nx_scaffold_shared_1 = require("../nx-scaffold-shared");
|
|
6
6
|
function nxWeaverProject(options) {
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const projectRoot = (_b = options.directory) !== null && _b !== void 0 ? _b : `libs/${projectName}`;
|
|
7
|
+
const projectName = options.projectName ?? `${options.id}-weaver`;
|
|
8
|
+
const projectRoot = options.directory ?? `libs/${projectName}`;
|
|
10
9
|
return {
|
|
11
10
|
id: options.id,
|
|
12
11
|
projectName,
|
|
13
12
|
projectRoot,
|
|
14
|
-
importPath:
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
importPath: options.importPath ??
|
|
14
|
+
(options.scope ? `${options.scope}/${projectName}` : projectName),
|
|
15
|
+
tags: options.tags ?? [],
|
|
16
|
+
prefix: options.prefix ?? 'lw',
|
|
17
17
|
buildTarget: options.buildTarget,
|
|
18
|
-
baseTsconfig:
|
|
18
|
+
baseTsconfig: options.baseTsconfig ?? 'tsconfig.base.json',
|
|
19
19
|
depth: (0, nx_scaffold_shared_1.depthFor)(projectRoot),
|
|
20
20
|
};
|
|
21
21
|
}
|
|
@@ -27,15 +27,16 @@ function projectJson(p) {
|
|
|
27
27
|
prefix: p.prefix,
|
|
28
28
|
projectType: 'library',
|
|
29
29
|
tags: p.tags,
|
|
30
|
-
targets:
|
|
31
|
-
|
|
30
|
+
targets: {
|
|
31
|
+
...(p.buildTarget && {
|
|
32
32
|
test: {
|
|
33
33
|
executor: '@nx/angular:unit-test',
|
|
34
34
|
outputs: ['{workspaceRoot}/coverage/{projectName}'],
|
|
35
35
|
options: { buildTarget: p.buildTarget, watch: false },
|
|
36
36
|
},
|
|
37
|
-
}
|
|
38
|
-
|
|
37
|
+
}),
|
|
38
|
+
lint: { executor: '@nx/eslint:lint' },
|
|
39
|
+
},
|
|
39
40
|
}, null, 2);
|
|
40
41
|
}
|
|
41
42
|
function tsconfig(p) {
|
|
@@ -51,7 +52,7 @@ function tsconfig(p) {
|
|
|
51
52
|
],
|
|
52
53
|
}, null, 2);
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function tsconfigLibrary(p) {
|
|
55
56
|
return JSON.stringify({
|
|
56
57
|
extends: './tsconfig.json',
|
|
57
58
|
compilerOptions: {
|
|
@@ -66,8 +67,12 @@ function tsconfigLib(p) {
|
|
|
66
67
|
}, null, 2);
|
|
67
68
|
}
|
|
68
69
|
function nxWeaverFiles(p) {
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
return {
|
|
71
|
+
'project.json': projectJson(p) + '\n',
|
|
72
|
+
'tsconfig.json': tsconfig(p) + '\n',
|
|
73
|
+
'tsconfig.lib.json': tsconfigLibrary(p) + '\n',
|
|
74
|
+
...(p.buildTarget && { 'tsconfig.spec.json': (0, nx_scaffold_shared_1.sharedTsconfigSpec)(p.depth) + '\n' }),
|
|
75
|
+
'eslint.config.mjs': (0, nx_scaffold_shared_1.sharedEslintConfig)(p.depth, p.prefix),
|
|
76
|
+
};
|
|
72
77
|
}
|
|
73
78
|
//# sourceMappingURL=nx-files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-files.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/generators/weaver/nx-files.ts"],"names":[],"mappings":";;AAkCA,0CAgBC;
|
|
1
|
+
{"version":3,"file":"nx-files.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/generators/weaver/nx-files.ts"],"names":[],"mappings":";;AAkCA,0CAgBC;AAgED,sCAQC;AAzHD,8DAO+B;AA0B/B,SAAgB,eAAe,CAAC,OAAwB;IACtD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,GAAG,OAAO,CAAC,EAAE,SAAS,CAAC;IAClE,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,IAAI,QAAQ,WAAW,EAAE,CAAC;IAC/D,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,WAAW;QACX,WAAW;QACX,UAAU,EACR,OAAO,CAAC,UAAU;YAClB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;QACnE,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI;QAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,oBAAoB;QAC1D,KAAK,EAAE,IAAA,6BAAQ,EAAC,WAAW,CAAC;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,CAAkB;IACrC,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,IAAI,EAAE,CAAC,CAAC,WAAW;QACnB,OAAO,EAAE,GAAG,CAAC,CA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EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;YACnB,KAAK,EAAE,EAAE;SACV;QACD,OAAO,EAAE,CAAC,aAAa,CAAC;QACxB,OAAO,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;KAClD,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa,CAAC,CAAkB;IAC9C,OAAO;QACL,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI;QACrC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;QACnC,mBAAmB,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI;QAC9C,GAAG,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,oBAAoB,EAAE,IAAA,uCAAkB,EAAC,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC;QAClF,mBAAmB,EAAE,IAAA,uCAAkB,EAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;KAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -51,6 +51,11 @@
|
|
|
51
51
|
"description": "Make the surface a container: a routable tab at '<id>/:id' holding a nested pane tree of child surfaces, which the host draws. Not combinable with --instanceable.",
|
|
52
52
|
"default": false
|
|
53
53
|
},
|
|
54
|
+
"agent": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"description": "Also scaffold the connection that lets an AG-UI agent run the commands this workbench offers: a docked panel, the seam where a call is decided before it runs, and a local stand-in that speaks the protocol so the whole path works on the first serve. Implies --command.",
|
|
57
|
+
"default": false
|
|
58
|
+
},
|
|
54
59
|
"access": {
|
|
55
60
|
"type": "string",
|
|
56
61
|
"description": "Auth-gate the surface and rail item: 'authenticated', 'anonymous' or 'role:<name>'."
|
package/src/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export type { FileMap, Recipe } from './lib/generate/types';
|
|
2
2
|
export { amendments, generate } from './lib/generate/generate';
|
|
3
|
-
export type { Amendment, AssetGlob, ComposePluginAmendment, BuildTargetAmendment, PostcssAmendment, StylesheetSourceAmendment, } from './lib/amend/types';
|
|
4
|
-
export { ensureBuildTarget, ensurePostcssPlugin, ensureStylesheetSource, joinProjectPath, resolveAssetInput, type MergeResult, } from './lib/amend/merge';
|
|
5
|
-
export { composeLines, composePlugin, type ComposeResult } from './lib/amend/compose';
|
|
3
|
+
export type { Amendment, AssetGlob, ComposePluginAmendment, BuildTargetAmendment, PackageAmendment, PostcssAmendment, StylesheetSourceAmendment, } from './lib/amend/types';
|
|
4
|
+
export { ensureBuildTarget, ensureDependency, ensurePostcssPlugin, ensureStylesheetSource, joinProjectPath, resolveAssetInput, type MergeResult, } from './lib/amend/merge';
|
|
5
|
+
export { composeLines, composePlugin, type ComposeResult, } from './lib/amend/compose';
|
|
6
6
|
export { describeAmendment } from './lib/amend/describe';
|
|
7
|
-
export { isKebabId, toCamelCase, toPascalCase, toTitleCase } from './lib/generate/casing';
|
|
7
|
+
export { isKebabId, toCamelCase, toPascalCase, toTitleCase, } from './lib/generate/casing';
|
|
8
8
|
export { angularWeaver, resolveWeaverInput, type WeaverInput, type ResolvedWeaver, } from './recipes/angular-weaver/recipe';
|
|
9
9
|
export { framePlugin, resolveFramePluginInput, type FramePluginInput, type ResolvedFramePlugin, } from './recipes/frame-plugin/recipe';
|
|
10
10
|
export { angularDistribution, resolveDistributionInput, type DistributionInput, type ResolvedDistribution, } from './recipes/angular-distribution/recipe';
|
|
11
11
|
export { authSource, resolveAuthSourceInput, type AuthSourceInput, type ResolvedAuthSource, } from './recipes/auth-source/recipe';
|
|
12
12
|
export { settingsStore, resolveSettingsStoreInput, type SettingsStoreInput, type ResolvedSettingsStore, } from './recipes/settings-store/recipe';
|
|
13
|
-
export { theme, resolveThemeInput, type ThemeInput, type ResolvedTheme } from './recipes/theme/recipe';
|
|
13
|
+
export { theme, resolveThemeInput, type ThemeInput, type ResolvedTheme, } from './recipes/theme/recipe';
|
|
14
14
|
export { layout, resolveLayoutInput, type LayoutInput, type ResolvedLayout, } from './recipes/layout/recipe';
|
|
15
15
|
export { SCAFFOLDS, findScaffold, kebabCase, nxSchemaFor, portableOptions, usageFor, type ScaffoldDescriptor, type ScaffoldOption, type ScaffoldValues, } from './lib/scaffolds/scaffolds';
|
|
16
16
|
export type { Finding, FindingLevel } from './lib/validate/types';
|
|
17
|
-
export { validateManifest, KNOWN_CAPABILITIES, type ManifestLike } from './lib/validate/manifest';
|
|
17
|
+
export { validateManifest, KNOWN_CAPABILITIES, type ManifestLike, } from './lib/validate/manifest';
|
|
18
18
|
export { validateI18nParity, type I18nBundle } from './lib/validate/i18n';
|
|
19
19
|
export { validateCatalog, CATALOG_ENTRY_KEYS } from './lib/validate/catalog';
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CATALOG_ENTRY_KEYS = exports.validateCatalog = exports.validateI18nParity = exports.KNOWN_CAPABILITIES = exports.validateManifest = exports.usageFor = exports.portableOptions = exports.nxSchemaFor = exports.kebabCase = exports.findScaffold = exports.SCAFFOLDS = exports.resolveLayoutInput = exports.layout = exports.resolveThemeInput = exports.theme = exports.resolveSettingsStoreInput = exports.settingsStore = exports.resolveAuthSourceInput = exports.authSource = exports.resolveDistributionInput = exports.angularDistribution = exports.resolveFramePluginInput = exports.framePlugin = exports.resolveWeaverInput = exports.angularWeaver = exports.toTitleCase = exports.toPascalCase = exports.toCamelCase = exports.isKebabId = exports.describeAmendment = exports.composePlugin = exports.composeLines = exports.resolveAssetInput = exports.joinProjectPath = exports.ensureStylesheetSource = exports.ensurePostcssPlugin = exports.ensureBuildTarget = exports.generate = exports.amendments = void 0;
|
|
3
|
+
exports.CATALOG_ENTRY_KEYS = exports.validateCatalog = exports.validateI18nParity = exports.KNOWN_CAPABILITIES = exports.validateManifest = exports.usageFor = exports.portableOptions = exports.nxSchemaFor = exports.kebabCase = exports.findScaffold = exports.SCAFFOLDS = exports.resolveLayoutInput = exports.layout = exports.resolveThemeInput = exports.theme = exports.resolveSettingsStoreInput = exports.settingsStore = exports.resolveAuthSourceInput = exports.authSource = exports.resolveDistributionInput = exports.angularDistribution = exports.resolveFramePluginInput = exports.framePlugin = exports.resolveWeaverInput = exports.angularWeaver = exports.toTitleCase = exports.toPascalCase = exports.toCamelCase = exports.isKebabId = exports.describeAmendment = exports.composePlugin = exports.composeLines = exports.resolveAssetInput = exports.joinProjectPath = exports.ensureStylesheetSource = exports.ensurePostcssPlugin = exports.ensureDependency = exports.ensureBuildTarget = exports.generate = exports.amendments = void 0;
|
|
4
4
|
var generate_1 = require("./lib/generate/generate");
|
|
5
5
|
Object.defineProperty(exports, "amendments", { enumerable: true, get: function () { return generate_1.amendments; } });
|
|
6
6
|
Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return generate_1.generate; } });
|
|
7
7
|
var merge_1 = require("./lib/amend/merge");
|
|
8
8
|
Object.defineProperty(exports, "ensureBuildTarget", { enumerable: true, get: function () { return merge_1.ensureBuildTarget; } });
|
|
9
|
+
Object.defineProperty(exports, "ensureDependency", { enumerable: true, get: function () { return merge_1.ensureDependency; } });
|
|
9
10
|
Object.defineProperty(exports, "ensurePostcssPlugin", { enumerable: true, get: function () { return merge_1.ensurePostcssPlugin; } });
|
|
10
11
|
Object.defineProperty(exports, "ensureStylesheetSource", { enumerable: true, get: function () { return merge_1.ensureStylesheetSource; } });
|
|
11
12
|
Object.defineProperty(exports, "joinProjectPath", { enumerable: true, get: function () { return merge_1.joinProjectPath; } });
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/tooling/devkit/src/index.ts"],"names":[],"mappings":";;;AACA,oDAA+D;AAAtD,sGAAA,UAAU,OAAA;AAAE,oGAAA,QAAQ,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"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AAkB,OAAA;AAGpB,4CAA0E;AAAjE,0GAAA,kBAAkB,OAAA;AAC3B,kDAA6E;AAApE,0GAAA,eAAe,OAAA;AAAE,6GAAA,kBAAkB,OAAA"}
|
package/src/lib/amend/compose.js
CHANGED
|
@@ -2,8 +2,34 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.composePlugin = composePlugin;
|
|
4
4
|
exports.composeLines = composeLines;
|
|
5
|
-
const
|
|
5
|
+
const APP_CONFIG = /export\s+const\s+appConfig\s*:[^=]*=\s*\{/;
|
|
6
|
+
const PROVIDERS_OPEN = /providers\s*:\s*\[/g;
|
|
6
7
|
const SHELL_IMPORT = /import\s*\{([^}]*)\}\s*from\s*'@loomweaver\/shell';/;
|
|
8
|
+
function closingLine(source, from) {
|
|
9
|
+
let close = source.indexOf('],', from);
|
|
10
|
+
while (close !== -1) {
|
|
11
|
+
let start = close;
|
|
12
|
+
while (start > from && source.charAt(start - 1).trim() === '') {
|
|
13
|
+
start -= 1;
|
|
14
|
+
}
|
|
15
|
+
const gap = source.slice(start, close);
|
|
16
|
+
const newline = gap.indexOf('\n');
|
|
17
|
+
if (newline !== -1) {
|
|
18
|
+
return { insertAt: start + newline, indent: gap.slice(newline + 1) };
|
|
19
|
+
}
|
|
20
|
+
close = source.indexOf('],', close + 2);
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
function providersBlock(source) {
|
|
25
|
+
const declaration = APP_CONFIG.exec(source);
|
|
26
|
+
if (!declaration) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
PROVIDERS_OPEN.lastIndex = declaration.index + declaration[0].length;
|
|
30
|
+
const open = PROVIDERS_OPEN.exec(source);
|
|
31
|
+
return open ? closingLine(source, open.index + open[0].length) : null;
|
|
32
|
+
}
|
|
7
33
|
/**
|
|
8
34
|
* Registers a generated plugin in a composition root we generated ourselves. Recognition is the
|
|
9
35
|
* whole safety mechanism: the providers array and the shell import are matched by the shape the
|
|
@@ -13,13 +39,16 @@ function composePlugin(source, amendment, importPath) {
|
|
|
13
39
|
if (source.includes(amendment.symbol)) {
|
|
14
40
|
return { source, composed: true };
|
|
15
41
|
}
|
|
16
|
-
const providers = PROVIDERS.exec(source);
|
|
17
42
|
const shellImport = SHELL_IMPORT.exec(source);
|
|
18
|
-
if (!
|
|
43
|
+
if (!shellImport || !providersBlock(source)) {
|
|
44
|
+
return { source, composed: false };
|
|
45
|
+
}
|
|
46
|
+
const withImports = source.replace(SHELL_IMPORT, () => `import {${withShellSymbols(shellImport[1])}} from '@loomweaver/shell';\nimport { ${amendment.symbol} } from '${importPath}';`);
|
|
47
|
+
const block = providersBlock(withImports);
|
|
48
|
+
if (!block) {
|
|
19
49
|
return { source, composed: false };
|
|
20
50
|
}
|
|
21
|
-
const
|
|
22
|
-
const indent = `${providers[4]} `;
|
|
51
|
+
const indent = `${block.indent} `;
|
|
23
52
|
const lines = [
|
|
24
53
|
`${indent}provideTranslationNamespaces('${amendment.id}'),`,
|
|
25
54
|
`${indent}provideCapabilityGrants({ ${amendment.id}: [${amendment.capabilities
|
|
@@ -28,7 +57,7 @@ function composePlugin(source, amendment, importPath) {
|
|
|
28
57
|
`${indent}...providePlugins(${amendment.symbol}),`,
|
|
29
58
|
].join('\n');
|
|
30
59
|
return {
|
|
31
|
-
source: withImports.
|
|
60
|
+
source: `${withImports.slice(0, block.insertAt)}\n${lines}${withImports.slice(block.insertAt)}`,
|
|
32
61
|
composed: true,
|
|
33
62
|
};
|
|
34
63
|
}
|
|
@@ -53,12 +82,12 @@ function withShellSymbols(existing) {
|
|
|
53
82
|
.split(',')
|
|
54
83
|
.map((symbol) => symbol.trim())
|
|
55
84
|
.filter(Boolean);
|
|
56
|
-
const missing = wanted.filter((symbol) =>
|
|
85
|
+
const missing = wanted.filter((symbol) => present.every((entry) => entry.replace(/^type\s+/, '') !== symbol));
|
|
57
86
|
if (missing.length === 0) {
|
|
58
87
|
return existing;
|
|
59
88
|
}
|
|
60
89
|
const multiline = existing.includes('\n');
|
|
61
|
-
const all = [...present, ...missing].
|
|
90
|
+
const all = [...present, ...missing].toSorted((a, b) => a.localeCompare(b));
|
|
62
91
|
return multiline ? `\n ${all.join(',\n ')},\n` : ` ${all.join(', ')} `;
|
|
63
92
|
}
|
|
64
93
|
//# sourceMappingURL=compose.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/lib/amend/compose.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/lib/amend/compose.ts"],"names":[],"mappings":";;AAgDA,sCAiCC;AAED,oCAaC;AAzFD,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAC/D,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAC7C,MAAM,YAAY,GAAG,qDAAqD,CAAC;AAO3E,SAAS,WAAW,CAAC,MAAc,EAAE,IAAY;IAC/C,IAAI,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACvC,OAAO,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACpB,IAAI,KAAK,GAAG,KAAK,CAAC;QAClB,OAAO,KAAK,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC9D,KAAK,IAAI,CAAC,CAAC;QACb,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACvC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC;YACnB,OAAO,EAAE,QAAQ,EAAE,KAAK,GAAG,OAAO,EAAE,MAAM,EAAE,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1C,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,QAAgB;IACxC,MAAM,MAAM,GAAG;QACb,yBAAyB;QACzB,gBAAgB;QAChB,8BAA8B;KAC/B,CAAC;IACF,MAAM,OAAO,GAAG,QAAQ;SACrB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;SAC9B,MAAM,CAAC,OAAO,CAAC,CAAC;IACnB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAC3B,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,KAAK,MAAM,CAAC,CAC/E,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,GAAG,GAAG,CAAC,GAAG,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,SAAS,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAC3E,CAAC"}
|
|
@@ -10,6 +10,9 @@ function describeAmendment(amendment) {
|
|
|
10
10
|
if (amendment.kind === 'postcss') {
|
|
11
11
|
return `Write ${amendment.file} beside your package.json, naming ${amendment.plugin}. Without it the stylesheet is read as plain CSS: no utility class is emitted, the workbench renders unstyled, and the build still reports success.`;
|
|
12
12
|
}
|
|
13
|
+
if (amendment.kind === 'package') {
|
|
14
|
+
return `Add ${amendment.name}@${amendment.version} to your project's dependencies and install it. Without it the generated files import a package that is not there, so the very first build fails.`;
|
|
15
|
+
}
|
|
13
16
|
if (amendment.kind === 'stylesheet-source') {
|
|
14
17
|
return `Add an @source entry for '${amendment.sourceRoot}' to the application's entry stylesheet, resolved from that stylesheet. Without it none of that code's utilities are emitted.`;
|
|
15
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/lib/amend/describe.ts"],"names":[],"mappings":";;AAOA,
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/lib/amend/describe.ts"],"names":[],"mappings":";;AAOA,8CA2CC;AAhDD;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,SAAoB;IACpD,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO,SAAS,SAAS,CAAC,IAAI,qCAAqC,SAAS,CAAC,MAAM,qJAAqJ,CAAC;IAC3O,CAAC;IACD,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO,OAAO,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,OAAO,mJAAmJ,CAAC;IACvM,CAAC;IACD,IAAI,SAAS,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;QAC3C,OAAO,6BAA6B,SAAS,CAAC,UAAU,+HAA+H,CAAC;IAC1L,CAAC;IACD,IAAI,SAAS,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACxC,OAAO,YAAY,SAAS,CAAC,EAAE,sCAAsC,SAAS,CAAC,MAAM,qCAAqC,SAAS,CAAC,EAAE,iCAAiC,SAAS,CAAC,EAAE,MAAM,SAAS,CAAC,YAAY;aAC5M,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,UAAU,GAAG,CAAC;aACtC,IAAI,CACH,IAAI,CACL,8BAA8B,SAAS,CAAC,MAAM,iDAAiD,CAAC;IACrG,CAAC;IACD,OAAO;QACL,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YAC7B,CAAC,CAAC,CAAC,QAAQ,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;YACnD,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YAC7B,CAAC,CAAC;gBACE,kBAAkB,SAAS,CAAC,MAAM;qBAC/B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;qBAC3B,IAAI,CACH,IAAI,CACL,oIAAoI;aACxI;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,SAAS,CAAC,aAAa;YACzB,CAAC,CAAC;gBACE,wBAAwB,SAAS,CAAC,aAAa,wFAAwF;aACxI;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,SAAS,CAAC,cAAc,KAAK,SAAS;YACxC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE,6CAA6C,SAAS,CAAC,cAAc,8KAA8K;aACpP,CAAC;KACP;SACE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SAC7C,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
package/src/lib/amend/merge.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetGlob, BuildTargetAmendment, PostcssAmendment } from './types';
|
|
1
|
+
import { AssetGlob, BuildTargetAmendment, PackageAmendment, PostcssAmendment } from './types';
|
|
2
2
|
export type JsonObject = Record<string, unknown>;
|
|
3
3
|
export interface MergeResult {
|
|
4
4
|
readonly value: JsonObject;
|
|
@@ -7,8 +7,15 @@ export interface MergeResult {
|
|
|
7
7
|
/** What could not be added because the consumer's value occupies the place it would go. */
|
|
8
8
|
readonly declined: readonly string[];
|
|
9
9
|
}
|
|
10
|
+
export declare function normalizeProjectRoot(value: string): string;
|
|
10
11
|
export declare function joinProjectPath(projectRoot: string, path: string): string;
|
|
11
12
|
export declare function resolveAssetInput(glob: AssetGlob, projectRoot: string): string;
|
|
12
13
|
export declare function ensurePostcssPlugin(existing: unknown, amendment: PostcssAmendment): MergeResult;
|
|
14
|
+
/**
|
|
15
|
+
* Records a package the generated files need in the project's manifest. A version already recorded
|
|
16
|
+
* wins wherever it stands — a consumer who pinned it, or moved it to devDependencies, chose that on
|
|
17
|
+
* purpose and this is an "ensure it is present", not a "set it to".
|
|
18
|
+
*/
|
|
19
|
+
export declare function ensureDependency(manifest: unknown, amendment: PackageAmendment): MergeResult;
|
|
13
20
|
export declare function ensureBuildTarget(target: unknown, amendment: BuildTargetAmendment, projectRoot: string): MergeResult;
|
|
14
21
|
export declare function ensureStylesheetSource(css: string, source: string): string;
|