@loomweaver/devkit 0.7.2
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/README.md +127 -0
- package/generators.json +41 -0
- package/package.json +38 -0
- package/src/generators/auth-source/generator.d.ts +4 -0
- package/src/generators/auth-source/generator.js +17 -0
- package/src/generators/auth-source/generator.js.map +1 -0
- package/src/generators/auth-source/schema.json +18 -0
- package/src/generators/distribution/generator.d.ts +4 -0
- package/src/generators/distribution/generator.js +61 -0
- package/src/generators/distribution/generator.js.map +1 -0
- package/src/generators/distribution/nx-files.d.ts +22 -0
- package/src/generators/distribution/nx-files.js +133 -0
- package/src/generators/distribution/nx-files.js.map +1 -0
- package/src/generators/distribution/schema.json +48 -0
- package/src/generators/frame-plugin/generator.d.ts +4 -0
- package/src/generators/frame-plugin/generator.js +20 -0
- package/src/generators/frame-plugin/generator.js.map +1 -0
- package/src/generators/frame-plugin/schema.json +22 -0
- package/src/generators/layout/generator.d.ts +4 -0
- package/src/generators/layout/generator.js +17 -0
- package/src/generators/layout/generator.js.map +1 -0
- package/src/generators/layout/schema.json +17 -0
- package/src/generators/nx-scaffold-shared.d.ts +32 -0
- package/src/generators/nx-scaffold-shared.js +87 -0
- package/src/generators/nx-scaffold-shared.js.map +1 -0
- package/src/generators/settings-store/generator.d.ts +4 -0
- package/src/generators/settings-store/generator.js +17 -0
- package/src/generators/settings-store/generator.js.map +1 -0
- package/src/generators/settings-store/schema.json +18 -0
- package/src/generators/shared.d.ts +47 -0
- package/src/generators/shared.js +152 -0
- package/src/generators/shared.js.map +1 -0
- package/src/generators/theme/generator.d.ts +4 -0
- package/src/generators/theme/generator.js +17 -0
- package/src/generators/theme/generator.js.map +1 -0
- package/src/generators/theme/schema.json +24 -0
- package/src/generators/weaver/generator.d.ts +4 -0
- package/src/generators/weaver/generator.js +75 -0
- package/src/generators/weaver/generator.js.map +1 -0
- package/src/generators/weaver/nx-files.d.ts +26 -0
- package/src/generators/weaver/nx-files.js +73 -0
- package/src/generators/weaver/nx-files.js.map +1 -0
- package/src/generators/weaver/schema.json +97 -0
- package/src/index.d.ts +15 -0
- package/src/index.js +47 -0
- package/src/index.js.map +1 -0
- package/src/lib/generate/casing.d.ts +4 -0
- package/src/lib/generate/casing.js +27 -0
- package/src/lib/generate/casing.js.map +1 -0
- package/src/lib/generate/generate.d.ts +2 -0
- package/src/lib/generate/generate.js +18 -0
- package/src/lib/generate/generate.js.map +1 -0
- package/src/lib/generate/types.d.ts +5 -0
- package/src/lib/generate/types.js +3 -0
- package/src/lib/generate/types.js.map +1 -0
- package/src/lib/scaffolds/scaffolds.d.ts +37 -0
- package/src/lib/scaffolds/scaffolds.js +357 -0
- package/src/lib/scaffolds/scaffolds.js.map +1 -0
- package/src/lib/validate/catalog.d.ts +15 -0
- package/src/lib/validate/catalog.js +247 -0
- package/src/lib/validate/catalog.js.map +1 -0
- package/src/lib/validate/i18n.d.ts +3 -0
- package/src/lib/validate/i18n.js +41 -0
- package/src/lib/validate/i18n.js.map +1 -0
- package/src/lib/validate/manifest.d.ts +8 -0
- package/src/lib/validate/manifest.js +74 -0
- package/src/lib/validate/manifest.js.map +1 -0
- package/src/lib/validate/types.d.ts +7 -0
- package/src/lib/validate/types.js +3 -0
- package/src/lib/validate/types.js.map +1 -0
- package/src/recipes/angular-distribution/logo.d.ts +1 -0
- package/src/recipes/angular-distribution/logo.js +9 -0
- package/src/recipes/angular-distribution/logo.js.map +1 -0
- package/src/recipes/angular-distribution/recipe.d.ts +25 -0
- package/src/recipes/angular-distribution/recipe.js +407 -0
- package/src/recipes/angular-distribution/recipe.js.map +1 -0
- package/src/recipes/angular-weaver/recipe.d.ts +48 -0
- package/src/recipes/angular-weaver/recipe.js +568 -0
- package/src/recipes/angular-weaver/recipe.js.map +1 -0
- package/src/recipes/angular-weaver/weaver-i18n.d.ts +3 -0
- package/src/recipes/angular-weaver/weaver-i18n.js +24 -0
- package/src/recipes/angular-weaver/weaver-i18n.js.map +1 -0
- package/src/recipes/auth-source/recipe.d.ts +11 -0
- package/src/recipes/auth-source/recipe.js +61 -0
- package/src/recipes/auth-source/recipe.js.map +1 -0
- package/src/recipes/frame-plugin/recipe.d.ts +11 -0
- package/src/recipes/frame-plugin/recipe.js +143 -0
- package/src/recipes/frame-plugin/recipe.js.map +1 -0
- package/src/recipes/layout/recipe.d.ts +10 -0
- package/src/recipes/layout/recipe.js +35 -0
- package/src/recipes/layout/recipe.js.map +1 -0
- package/src/recipes/settings-store/recipe.d.ts +10 -0
- package/src/recipes/settings-store/recipe.js +51 -0
- package/src/recipes/settings-store/recipe.js.map +1 -0
- package/src/recipes/shell-regions.d.ts +9 -0
- package/src/recipes/shell-regions.js +23 -0
- package/src/recipes/shell-regions.js.map +1 -0
- package/src/recipes/theme/recipe.d.ts +13 -0
- package/src/recipes/theme/recipe.js +142 -0
- package/src/recipes/theme/recipe.js.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# @loomweaver/devkit
|
|
2
|
+
|
|
3
|
+
Dev-time scaffolding + validation for LoomWeaver. Not a runtime package — it is never
|
|
4
|
+
imported by `@loomweaver/shell` or a weaver at runtime; it only generates and checks author code.
|
|
5
|
+
|
|
6
|
+
Install it as a dev dependency of an Nx workspace:
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm i -D @loomweaver/devkit
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
It is the fullest of the three scaffolding adapters, because Nx hands it a virtual tree of your
|
|
13
|
+
workspace: it is the only one that can also *change* files — register the project, add the tsconfig
|
|
14
|
+
path alias. `@loomweaver/cli` writes files but knows no workspace; `@loomweaver/mcp` returns a file map and lets
|
|
15
|
+
your assistant place it. All three read the same scaffold descriptors, so the generated source is
|
|
16
|
+
identical.
|
|
17
|
+
|
|
18
|
+
Placement is read from your workspace, not assumed: `--directory` (default `libs/<project name>`),
|
|
19
|
+
`--import-path` (default: your root manifest's npm scope), `--app` (inferred when the workspace has
|
|
20
|
+
exactly one application, an error naming the candidates when it has several), plus `--tags`,
|
|
21
|
+
`--prefix` and `--unit-test-runner`.
|
|
22
|
+
|
|
23
|
+
## Architecture
|
|
24
|
+
|
|
25
|
+
- **Generation core** (`src/lib/generate`) — a pure `generate(recipe, input) → FileMap` (path →
|
|
26
|
+
content). No filesystem, no Nx, no framework: deterministic and unit-testable. This is the seam a
|
|
27
|
+
CLI or an MCP server wraps later.
|
|
28
|
+
- **Recipes** (`src/recipes`) — templates + a typed input per target: `angular-weaver` (a trusted
|
|
29
|
+
in-process weaver) and `frame-plugin` (a framework-agnostic iframe/Penpal plugin — drop
|
|
30
|
+
any framework into `view.html`).
|
|
31
|
+
- **Validation core** (`src/lib/validate`) — pure `validateManifest` / `validateI18nParity` /
|
|
32
|
+
`validateCatalog` returning MCP-shaped `Finding[]`. They cover the three places the platform
|
|
33
|
+
swallows a mistake on purpose: an ungranted capability, a missing translation key, and a plugin
|
|
34
|
+
store catalog, which the shell parses defensively — unknown fields, malformed values and whole
|
|
35
|
+
entries disappear without a word.
|
|
36
|
+
- **Nx generator adapter** (`src/generators`) — writes a recipe's `FileMap` (plus the Nx project
|
|
37
|
+
files) into the workspace `Tree`.
|
|
38
|
+
|
|
39
|
+
## Scaffold a weaver
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
nx g @loomweaver/devkit:weaver --id=notes --name="Notes"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Creates a weaver library at `libs/notes-weaver/` — a manifest, a routable surface, a rail item, i18n
|
|
46
|
+
stubs and a test — plus the import alias under your workspace scope, and an assets glob on the
|
|
47
|
+
composing application's build so the i18n bundle is served under `/i18n/<id>/`. The generated
|
|
48
|
+
`README.md` explains how to wire it into a distribution (`providePlugins`,
|
|
49
|
+
`provideCapabilityGrants`, `provideTranslationNamespaces`).
|
|
50
|
+
|
|
51
|
+
Compose more contributions with flags — the generator assembles the `activate()` body, derives the
|
|
52
|
+
required capabilities and adds the matching i18n keys:
|
|
53
|
+
|
|
54
|
+
| Flag | Adds |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| `--command` | a registered command (with a keyboard shortcut) that toasts (→ capability `ui`) |
|
|
57
|
+
| `--shortcut=<chord>` | override the command's chord, e.g. `mod+shift+k` (implies `--command`; `mod` = ⌘/Ctrl) |
|
|
58
|
+
| `--menu=<slot>` | a menu item in the slot running the command (e.g. `content/tab/context`; implies `--command`) |
|
|
59
|
+
| `--bar-item` | a status-bar button that triggers the command (implies `--command`) |
|
|
60
|
+
| `--settings` | a settings section (toggle + text) with signal-backed value owners |
|
|
61
|
+
| `--about` | an About dialog (reads `ctx.host` version) + a command + a bottom rail item (→ `ui`, `host`) |
|
|
62
|
+
| `--instanceable` | named saved instances of the surface (switcher) |
|
|
63
|
+
| `--access=<req>` | auth-gate the surface + rail: `authenticated`, `anonymous`, or `role:<name>` |
|
|
64
|
+
| `--no-spec` | skip the generated starter unit test |
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
nx g @loomweaver/devkit:weaver --id=notes --command --menu=content/tab/context --settings --about --access=role:admin
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Keyboard chords use the platform-neutral `mod` token (⌘ on macOS, Ctrl elsewhere); the host both
|
|
71
|
+
binds and **displays** them per platform (`formatShortcut` → `⌘⇧K` vs `Ctrl+Shift+K`). A literal
|
|
72
|
+
`cmd`/`ctrl` in `--shortcut` is rejected with an error pointing at `mod`.
|
|
73
|
+
|
|
74
|
+
## Scaffold a frame plugin (any framework)
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
nx g @loomweaver/devkit:frame-plugin --id=notes --app=loom-testbed
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Writes an iframe/Penpal plugin (`plugin.html`, `plugin.js`, `view.html`) into
|
|
81
|
+
`apps/loom-testbed/public/notes/`. Replace `view.html` with any framework; the generated `README.md`
|
|
82
|
+
covers registering it via `provideFramePlugins` and supplying `penpal.global.js`.
|
|
83
|
+
|
|
84
|
+
## Scaffold a distribution
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
nx g @loomweaver/devkit:distribution --name=acme-studio --title="Acme Studio"
|
|
88
|
+
nx g @loomweaver/devkit:distribution --name=acme-studio --styles=precompiled # no Tailwind at all
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Creates a runnable composition-root app at `apps/acme-studio/` (bootstraps the shell, stylesheet,
|
|
92
|
+
PWA manifest, build/serve/lint/test). `nx serve acme-studio` renders the bare shell; the generated
|
|
93
|
+
`LOOMWEAVER.md` shows how to add weavers, layout, capability grants and branding — it is named that
|
|
94
|
+
so scaffolding over an existing app can never overwrite the app's own `README.md`.
|
|
95
|
+
|
|
96
|
+
`--styles` decides how the app is styled. The default `tailwind` compiles the shell's source theme,
|
|
97
|
+
which is also what lets you write Tailwind utilities of your own. `precompiled` imports the
|
|
98
|
+
stylesheet we compiled instead — no `tailwindcss`, no `.postcssrc.json`, no `@source` paths — which
|
|
99
|
+
is what you want if the product is themed with Bootstrap, Bulma or hand-written CSS.
|
|
100
|
+
|
|
101
|
+
## Scaffold backend-integration ports
|
|
102
|
+
|
|
103
|
+
The platform ships local/anonymous defaults; the product implements two frontend ports against its
|
|
104
|
+
own backend. Scaffold either into a distribution's `src/`:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
nx g @loomweaver/devkit:auth-source --name=dev --app=acme-studio # provider-neutral AuthSource
|
|
108
|
+
nx g @loomweaver/devkit:settings-store --name=backend --app=acme-studio # backend-backed settings store
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Wire them in `app.config.ts` with `provideAuthSource(() => devAuthSource())` and
|
|
112
|
+
`provideSettingsStore(new BackendSettingsStore())`.
|
|
113
|
+
|
|
114
|
+
## Scaffold a theme + a layout
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
nx g @loomweaver/devkit:theme --name=midnight --app=acme-studio # a token-override CSS (@import after ours)
|
|
118
|
+
nx g @loomweaver/devkit:theme --name=acme --preset=bootstrap # the same, mapped onto Bootstrap 5.3
|
|
119
|
+
nx g @loomweaver/devkit:layout --app=acme-studio # a ShellLayout for provideLayout(baseLayout)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`--preset bootstrap` points all 29 `--lw-*` tokens at Bootstrap's `--bs-*` variables instead of
|
|
123
|
+
emitting literal colours, so the shell follows your Bootstrap theme live — including its dark mode,
|
|
124
|
+
provided you mirror `ThemeService.resolvedTheme()` onto `data-bs-theme`. The generated file says how.
|
|
125
|
+
|
|
126
|
+
The layout's region ids (`primary` rail, `status` bar) match the weaver defaults, so a scaffolded
|
|
127
|
+
weaver's rail + bar items land in it out of the box.
|
package/generators.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../node_modules/nx/schemas/collection.schema.json",
|
|
3
|
+
"name": "@loomweaver/devkit",
|
|
4
|
+
"generators": {
|
|
5
|
+
"weaver": {
|
|
6
|
+
"factory": "./src/generators/weaver/generator",
|
|
7
|
+
"schema": "./src/generators/weaver/schema.json",
|
|
8
|
+
"description": "Scaffold a LoomWeaver weaver (Angular plugin bundle)."
|
|
9
|
+
},
|
|
10
|
+
"frame-plugin": {
|
|
11
|
+
"factory": "./src/generators/frame-plugin/generator",
|
|
12
|
+
"schema": "./src/generators/frame-plugin/schema.json",
|
|
13
|
+
"description": "Scaffold a sandboxed, framework-agnostic (iframe) LoomWeaver plugin."
|
|
14
|
+
},
|
|
15
|
+
"distribution": {
|
|
16
|
+
"factory": "./src/generators/distribution/generator",
|
|
17
|
+
"schema": "./src/generators/distribution/schema.json",
|
|
18
|
+
"description": "Scaffold a LoomWeaver distribution (a composition-root Angular app)."
|
|
19
|
+
},
|
|
20
|
+
"auth-source": {
|
|
21
|
+
"factory": "./src/generators/auth-source/generator",
|
|
22
|
+
"schema": "./src/generators/auth-source/schema.json",
|
|
23
|
+
"description": "Scaffold a provider-neutral AuthSource."
|
|
24
|
+
},
|
|
25
|
+
"settings-store": {
|
|
26
|
+
"factory": "./src/generators/settings-store/generator",
|
|
27
|
+
"schema": "./src/generators/settings-store/schema.json",
|
|
28
|
+
"description": "Scaffold a backend-backed settings-store port implementation."
|
|
29
|
+
},
|
|
30
|
+
"theme": {
|
|
31
|
+
"factory": "./src/generators/theme/generator",
|
|
32
|
+
"schema": "./src/generators/theme/schema.json",
|
|
33
|
+
"description": "Scaffold a token-override theme (CSS) for a distribution."
|
|
34
|
+
},
|
|
35
|
+
"layout": {
|
|
36
|
+
"factory": "./src/generators/layout/generator",
|
|
37
|
+
"schema": "./src/generators/layout/schema.json",
|
|
38
|
+
"description": "Scaffold a distribution base layout (ShellLayout regions)."
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@loomweaver/devkit",
|
|
3
|
+
"version": "0.7.2",
|
|
4
|
+
"description": "LoomWeaver scaffolding for Nx workspaces: generators for weavers, distributions, frame plugins and the integration seams, plus the manifest and i18n validators.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"loomweaver",
|
|
7
|
+
"nx",
|
|
8
|
+
"nx-plugin",
|
|
9
|
+
"generator",
|
|
10
|
+
"scaffolding",
|
|
11
|
+
"angular",
|
|
12
|
+
"plugin-platform"
|
|
13
|
+
],
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"author": "Norbert Rosenwinkel (https://loomweaver.dev)",
|
|
16
|
+
"main": "./src/index.js",
|
|
17
|
+
"types": "./src/index.d.ts",
|
|
18
|
+
"generators": "./generators.json",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"tslib": "^2.3.0"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@nx/devkit": ">=23.0.0"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://loomweaver.dev",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/yesbert/loomweaver/issues"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/yesbert/loomweaver.git",
|
|
35
|
+
"directory": "platform/libs/tooling/devkit"
|
|
36
|
+
},
|
|
37
|
+
"type": "commonjs"
|
|
38
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authSourceGenerator = authSourceGenerator;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const generate_1 = require("../../lib/generate/generate");
|
|
7
|
+
const recipe_1 = require("../../recipes/auth-source/recipe");
|
|
8
|
+
const shared_1 = require("../shared");
|
|
9
|
+
function authSourceGenerator(tree, options) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const root = `${(0, shared_1.resolveApp)(tree, options.app).root}/src/auth`;
|
|
12
|
+
(0, shared_1.writeFilesGuarded)(tree, root, (0, generate_1.generate)(recipe_1.authSource, { name: options.name }));
|
|
13
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
exports.default = authSourceGenerator;
|
|
17
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/generators/auth-source/generator.ts"],"names":[],"mappings":";;AAMA,kDAOC;;AAbD,uCAA+C;AAC/C,0DAAuD;AACvD,6DAA8D;AAC9D,sCAA0D;AAG1D,SAAsB,mBAAmB,CACvC,IAAU,EACV,OAAkC;;QAElC,MAAM,IAAI,GAAG,GAAG,IAAA,mBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,CAAC;QAC9D,IAAA,0BAAiB,EAAC,IAAI,EAAE,IAAI,EAAE,IAAA,mBAAQ,EAAC,mBAAU,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC5E,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAED,kBAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "LoomWeaverAuthSource",
|
|
4
|
+
"title": "Scaffold a provider-neutral AuthSource that feeds the session",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Source name in kebab-case, e.g. 'dev'.",
|
|
10
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
11
|
+
},
|
|
12
|
+
"app": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Application to drop into. Inferred when the workspace has exactly one."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": ["name"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.distributionGenerator = distributionGenerator;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const generate_1 = require("../../lib/generate/generate");
|
|
7
|
+
const shared_1 = require("../shared");
|
|
8
|
+
const recipe_1 = require("../../recipes/angular-distribution/recipe");
|
|
9
|
+
const nx_files_1 = require("./nx-files");
|
|
10
|
+
function distributionGenerator(tree, options) {
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
var _a;
|
|
13
|
+
const distribution = (0, nx_files_1.nxDistribution)({
|
|
14
|
+
name: options.name,
|
|
15
|
+
directory: options.directory,
|
|
16
|
+
tags: (_a = options.tags) === null || _a === void 0 ? void 0 : _a.split(',').map((tag) => tag.trim()),
|
|
17
|
+
prefix: options.prefix,
|
|
18
|
+
baseTsconfig: (0, shared_1.tsconfigPathsFile)(tree),
|
|
19
|
+
withTests: options.unitTestRunner !== 'none',
|
|
20
|
+
});
|
|
21
|
+
const projectFile = `${distribution.projectRoot}/project.json`;
|
|
22
|
+
const composingIntoExisting = tree.exists(projectFile);
|
|
23
|
+
if (composingIntoExisting) {
|
|
24
|
+
if (!options.force) {
|
|
25
|
+
throw new Error(`A project already exists at ${distribution.projectRoot}. Pass --force to compose the ` +
|
|
26
|
+
'distribution into it, replacing the bootstrap files this scaffold owns.');
|
|
27
|
+
}
|
|
28
|
+
const occupantName = (0, devkit_1.readJson)(tree, projectFile).name;
|
|
29
|
+
if (typeof occupantName === 'string' && occupantName !== options.name) {
|
|
30
|
+
throw new Error(`The project at ${distribution.projectRoot} is named "${occupantName}", not "${options.name}". ` +
|
|
31
|
+
'Renaming it here would break every reference to it in the workspace — pass ' +
|
|
32
|
+
`--name ${occupantName}.`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const source = (0, generate_1.generate)(recipe_1.angularDistribution, {
|
|
36
|
+
name: options.name,
|
|
37
|
+
title: options.title,
|
|
38
|
+
directory: distribution.projectRoot,
|
|
39
|
+
withTests: distribution.withTests,
|
|
40
|
+
styles: options.styles,
|
|
41
|
+
});
|
|
42
|
+
const scaffold = (0, nx_files_1.nxDistributionFiles)(distribution);
|
|
43
|
+
if (composingIntoExisting) {
|
|
44
|
+
const { 'project.json': ours } = scaffold, rest = tslib_1.__rest(scaffold, ['project.json']);
|
|
45
|
+
(0, shared_1.writeFiles)(tree, distribution.projectRoot, source, rest);
|
|
46
|
+
mergeProjectJson(tree, projectFile, JSON.parse(ours));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
(0, shared_1.writeFiles)(tree, distribution.projectRoot, source, scaffold);
|
|
50
|
+
}
|
|
51
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function mergeProjectJson(tree, projectFile, ours) {
|
|
55
|
+
(0, devkit_1.updateJson)(tree, projectFile, (existing) => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
return (Object.assign(Object.assign(Object.assign({}, existing), ours), { tags: ((_a = ours.tags) === null || _a === void 0 ? void 0 : _a.length) ? ours.tags : ((_b = existing.tags) !== null && _b !== void 0 ? _b : []), targets: Object.assign(Object.assign({}, existing.targets), ours.targets) }));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
exports.default = distributionGenerator;
|
|
61
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/generators/distribution/generator.ts"],"names":[],"mappings":";;AAOA,sDAgDC;;AAvDD,uCAAqE;AACrE,0DAAuD;AACvD,sCAA0D;AAC1D,sEAAgF;AAChF,yCAAiE;AAGjE,SAAsB,qBAAqB,CACzC,IAAU,EACV,OAAoC;;;QAEpC,MAAM,YAAY,GAAG,IAAA,yBAAc,EAAC;YAClC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YACvD,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,YAAY,EAAE,IAAA,0BAAiB,EAAC,IAAI,CAAC;YACrC,SAAS,EAAE,OAAO,CAAC,cAAc,KAAK,MAAM;SAC7C,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,GAAG,YAAY,CAAC,WAAW,eAAe,CAAC;QAC/D,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AAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,IAAA,mBAAU,EAAC,IAAI,EAAE,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAQD,SAAS,gBAAgB,CACvB,IAAU,EACV,WAAmB,EACnB,IAAiB;IAEjB,IAAA,mBAAU,EAAC,IAAI,EAAE,WAAW,EAAE,CAAC,QAAqB,EAAE,EAAE;;QAAC,OAAA,+CACpD,QAAQ,GACR,IAAI,KACP,IAAI,EAAE,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,EAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAA,QAAQ,CAAC,IAAI,mCAAI,EAAE,CAAC,EAC3D,OAAO,kCAAO,QAAQ,CAAC,OAAO,GAAK,IAAI,CAAC,OAAO,KAC/C,CAAA;KAAA,CAAC,CAAC;AACN,CAAC;AAED,kBAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FileMap } from '../../lib/generate/types';
|
|
2
|
+
import { NxScaffoldDepth } from '../nx-scaffold-shared';
|
|
3
|
+
export interface NxDistributionOptions {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly directory?: string;
|
|
6
|
+
readonly tags?: readonly string[];
|
|
7
|
+
readonly prefix?: string;
|
|
8
|
+
readonly baseTsconfig?: string;
|
|
9
|
+
readonly withTests?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface NxDistribution {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly projectRoot: string;
|
|
14
|
+
readonly outputPath: string;
|
|
15
|
+
readonly tags: readonly string[];
|
|
16
|
+
readonly prefix: string;
|
|
17
|
+
readonly baseTsconfig: string;
|
|
18
|
+
readonly withTests: boolean;
|
|
19
|
+
readonly depth: NxScaffoldDepth;
|
|
20
|
+
}
|
|
21
|
+
export declare function nxDistribution(options: NxDistributionOptions): NxDistribution;
|
|
22
|
+
export declare function nxDistributionFiles(d: NxDistribution): FileMap;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nxDistribution = nxDistribution;
|
|
4
|
+
exports.nxDistributionFiles = nxDistributionFiles;
|
|
5
|
+
const nx_scaffold_shared_1 = require("../nx-scaffold-shared");
|
|
6
|
+
function nxDistribution(options) {
|
|
7
|
+
var _a, _b, _c, _d, _e;
|
|
8
|
+
const projectRoot = (_a = options.directory) !== null && _a !== void 0 ? _a : `apps/${options.name}`;
|
|
9
|
+
return {
|
|
10
|
+
name: options.name,
|
|
11
|
+
projectRoot,
|
|
12
|
+
outputPath: `dist/${projectRoot}`,
|
|
13
|
+
tags: (_b = options.tags) !== null && _b !== void 0 ? _b : [],
|
|
14
|
+
prefix: (_c = options.prefix) !== null && _c !== void 0 ? _c : 'lw',
|
|
15
|
+
baseTsconfig: (_d = options.baseTsconfig) !== null && _d !== void 0 ? _d : 'tsconfig.base.json',
|
|
16
|
+
withTests: (_e = options.withTests) !== null && _e !== void 0 ? _e : true,
|
|
17
|
+
depth: (0, nx_scaffold_shared_1.depthFor)(projectRoot),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function projectJson(d) {
|
|
21
|
+
const root = d.projectRoot;
|
|
22
|
+
return JSON.stringify({
|
|
23
|
+
name: d.name,
|
|
24
|
+
$schema: `${d.depth.toRoot}/node_modules/nx/schemas/project-schema.json`,
|
|
25
|
+
projectType: 'application',
|
|
26
|
+
prefix: d.prefix,
|
|
27
|
+
sourceRoot: `${root}/src`,
|
|
28
|
+
tags: d.tags,
|
|
29
|
+
targets: Object.assign(Object.assign({ build: {
|
|
30
|
+
executor: '@angular/build:application',
|
|
31
|
+
outputs: ['{options.outputPath}'],
|
|
32
|
+
defaultConfiguration: 'production',
|
|
33
|
+
options: {
|
|
34
|
+
outputPath: d.outputPath,
|
|
35
|
+
browser: `${root}/src/main.ts`,
|
|
36
|
+
tsConfig: `${root}/tsconfig.app.json`,
|
|
37
|
+
serviceWorker: `${root}/ngsw-config.json`,
|
|
38
|
+
assets: [
|
|
39
|
+
{ glob: '**/*', input: `${root}/public` },
|
|
40
|
+
{
|
|
41
|
+
glob: '**/*',
|
|
42
|
+
input: 'node_modules/@loomweaver/shell/i18n',
|
|
43
|
+
output: 'i18n',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
glob: '**/*',
|
|
47
|
+
input: 'node_modules/@loomweaver/frame-kit/dist',
|
|
48
|
+
output: 'frame-kit',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
styles: [`${root}/src/styles.css`],
|
|
52
|
+
},
|
|
53
|
+
configurations: {
|
|
54
|
+
production: {
|
|
55
|
+
budgets: [
|
|
56
|
+
{
|
|
57
|
+
type: 'initial',
|
|
58
|
+
maximumWarning: '500kb',
|
|
59
|
+
maximumError: '1mb',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: 'anyComponentStyle',
|
|
63
|
+
maximumWarning: '4kb',
|
|
64
|
+
maximumError: '8kb',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
outputHashing: 'all',
|
|
68
|
+
optimization: {
|
|
69
|
+
scripts: true,
|
|
70
|
+
fonts: true,
|
|
71
|
+
styles: { minify: true, inlineCritical: false },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
development: {
|
|
75
|
+
optimization: false,
|
|
76
|
+
extractLicenses: false,
|
|
77
|
+
sourceMap: true,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
}, serve: {
|
|
81
|
+
continuous: true,
|
|
82
|
+
executor: '@angular/build:dev-server',
|
|
83
|
+
defaultConfiguration: 'development',
|
|
84
|
+
configurations: {
|
|
85
|
+
production: { buildTarget: `${d.name}:build:production` },
|
|
86
|
+
development: { buildTarget: `${d.name}:build:development` },
|
|
87
|
+
},
|
|
88
|
+
}, lint: { executor: '@nx/eslint:lint' } }, (d.withTests
|
|
89
|
+
? {
|
|
90
|
+
test: {
|
|
91
|
+
executor: '@nx/angular:unit-test',
|
|
92
|
+
outputs: ['{workspaceRoot}/coverage/{projectName}'],
|
|
93
|
+
options: { watch: false },
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
: {})), { 'serve-static': {
|
|
97
|
+
continuous: true,
|
|
98
|
+
executor: '@nx/web:file-server',
|
|
99
|
+
options: {
|
|
100
|
+
buildTarget: `${d.name}:build`,
|
|
101
|
+
staticFilePath: `${d.outputPath}/browser`,
|
|
102
|
+
spa: true,
|
|
103
|
+
},
|
|
104
|
+
} }),
|
|
105
|
+
}, null, 2);
|
|
106
|
+
}
|
|
107
|
+
function tsconfig(d) {
|
|
108
|
+
return JSON.stringify({
|
|
109
|
+
extends: `${d.depth.toRoot}/${d.baseTsconfig}`,
|
|
110
|
+
compilerOptions: nx_scaffold_shared_1.SHARED_COMPILER_OPTIONS,
|
|
111
|
+
angularCompilerOptions: nx_scaffold_shared_1.SHARED_ANGULAR_COMPILER_OPTIONS,
|
|
112
|
+
files: [],
|
|
113
|
+
include: [],
|
|
114
|
+
references: [
|
|
115
|
+
{ path: './tsconfig.app.json' },
|
|
116
|
+
...(d.withTests ? [{ path: './tsconfig.spec.json' }] : []),
|
|
117
|
+
],
|
|
118
|
+
}, null, 2);
|
|
119
|
+
}
|
|
120
|
+
function tsconfigApp(d) {
|
|
121
|
+
return JSON.stringify({
|
|
122
|
+
extends: './tsconfig.json',
|
|
123
|
+
compilerOptions: { outDir: `${d.depth.toRoot}/dist/out-tsc`, types: [] },
|
|
124
|
+
include: ['src/**/*.ts'],
|
|
125
|
+
exclude: ['src/**/*.spec.ts', 'src/**/*.test.ts'],
|
|
126
|
+
}, null, 2);
|
|
127
|
+
}
|
|
128
|
+
function nxDistributionFiles(d) {
|
|
129
|
+
return Object.assign(Object.assign({ 'project.json': projectJson(d) + '\n', 'tsconfig.json': tsconfig(d) + '\n', 'tsconfig.app.json': tsconfigApp(d) + '\n' }, (d.withTests
|
|
130
|
+
? { 'tsconfig.spec.json': (0, nx_scaffold_shared_1.sharedTsconfigSpec)(d.depth) + '\n' }
|
|
131
|
+
: {})), { 'eslint.config.mjs': (0, nx_scaffold_shared_1.sharedEslintConfig)(d.depth, [d.prefix, 'app']) });
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=nx-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx-files.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/generators/distribution/nx-files.ts"],"names":[],"mappings":";;AA8BA,wCAcC;AAmID,kDAUC;AAxLD,8DAO+B;AAsB/B,SAAgB,cAAc,CAC5B,OAA8B;;IAE9B,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;IAChE,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW;QACX,UAAU,EAAE,QAAQ,WAAW,EAAE;QACjC,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,EAAE;QACxB,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI;QAC9B,YAAY,EAAE,MAAA,OAAO,CAAC,YAAY,mCAAI,oBAAoB;QAC1D,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,IAAI;QACpC,KAAK,EAAE,IAAA,6BAAQ,EAAC,WAAW,CAAC;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,CAAiB;IACpC,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC;IAC3B,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,8CAA8C;QACxE,WAAW,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S,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3D;KACF,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,CAAiB;IACpC,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,OAAO,EAAE,iBAAiB;QAC1B,eAAe,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE;QACxE,OAAO,EAAE,CAAC,aAAa,CAAC;QACxB,OAAO,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;KAClD,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,SAAgB,mBAAmB,CAAC,CAAiB;IACnD,qCACE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,EACrC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,EACnC,mBAAmB,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,IACvC,CAAC,CAAC,CAAC,SAAS;QACb,CAAC,CAAC,EAAE,oBAAoB,EAAE,IAAA,uCAAkB,EAAC,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE;QAC9D,CAAC,CAAC,EAAE,CAAC,KACP,mBAAmB,EAAE,IAAA,uCAAkB,EAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,IACnE;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "LoomWeaverDistribution",
|
|
4
|
+
"title": "Scaffold a runnable composition root that boots the shell",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Distribution name in kebab-case, e.g. 'acme-studio'.",
|
|
10
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
11
|
+
},
|
|
12
|
+
"title": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Product display title. Defaults to a title-cased name."
|
|
15
|
+
},
|
|
16
|
+
"styles": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Which stylesheet to emit. 'tailwind' compiles the shell's source theme and lets you write Tailwind utilities of your own; 'precompiled' imports the stylesheet we compiled, so the application needs no Tailwind and can be themed with Bootstrap or anything else.",
|
|
19
|
+
"enum": ["tailwind", "precompiled"],
|
|
20
|
+
"default": "tailwind"
|
|
21
|
+
},
|
|
22
|
+
"force": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "Compose into the application already at that path, replacing the bootstrap files this scaffold owns and merging its build targets. Without it an existing project is an error."
|
|
25
|
+
},
|
|
26
|
+
"directory": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "Project root, relative to the workspace root."
|
|
29
|
+
},
|
|
30
|
+
"tags": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Comma-separated Nx tags for the project."
|
|
33
|
+
},
|
|
34
|
+
"prefix": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Selector prefix for generated components and directives.",
|
|
37
|
+
"default": "lw",
|
|
38
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
39
|
+
},
|
|
40
|
+
"unitTestRunner": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Test wiring to emit. 'vitest' uses @nx/angular:unit-test; 'none' emits no test target.",
|
|
43
|
+
"enum": ["vitest", "none"],
|
|
44
|
+
"default": "vitest"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": ["name"]
|
|
48
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.framePluginGenerator = framePluginGenerator;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const generate_1 = require("../../lib/generate/generate");
|
|
7
|
+
const recipe_1 = require("../../recipes/frame-plugin/recipe");
|
|
8
|
+
const shared_1 = require("../shared");
|
|
9
|
+
function framePluginGenerator(tree, options) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const root = `${(0, shared_1.resolveApp)(tree, options.app).root}/public/${options.id}`;
|
|
12
|
+
if (tree.exists(`${root}/plugin.html`)) {
|
|
13
|
+
throw new Error(`A frame plugin already exists at ${root}.`);
|
|
14
|
+
}
|
|
15
|
+
(0, shared_1.writeFiles)(tree, root, (0, generate_1.generate)(recipe_1.framePlugin, { id: options.id, name: options.name }));
|
|
16
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.default = framePluginGenerator;
|
|
20
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/generators/frame-plugin/generator.ts"],"names":[],"mappings":";;AAMA,oDAgBC;;AAtBD,uCAA+C;AAC/C,0DAAuD;AACvD,8DAAgE;AAChE,sCAAmD;AAGnD,SAAsB,oBAAoB,CACxC,IAAU,EACV,OAAqC;;QAErC,MAAM,IAAI,GAAG,GAAG,IAAA,mBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,WAAW,OAAO,CAAC,EAAE,EAAE,CAAC;QAC1E,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,cAAc,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,GAAG,CAAC,CAAC;QAC/D,CAAC;QAED,IAAA,mBAAU,EACR,IAAI,EACJ,IAAI,EACJ,IAAA,mBAAQ,EAAC,oBAAW,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAC9D,CAAC;QAEF,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "LoomWeaverFramePlugin",
|
|
4
|
+
"title": "Scaffold a framework-agnostic iframe plugin (Penpal + the frame UI kit)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"id": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Plugin id in kebab-case, e.g. 'notes'.",
|
|
10
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
11
|
+
},
|
|
12
|
+
"name": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Human-readable name. Defaults to a title-cased id."
|
|
15
|
+
},
|
|
16
|
+
"app": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Application to drop into. Inferred when the workspace has exactly one."
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": ["id"]
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.layoutGenerator = layoutGenerator;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const generate_1 = require("../../lib/generate/generate");
|
|
7
|
+
const recipe_1 = require("../../recipes/layout/recipe");
|
|
8
|
+
const shared_1 = require("../shared");
|
|
9
|
+
function layoutGenerator(tree, options) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const root = `${(0, shared_1.resolveApp)(tree, options.app).root}/src`;
|
|
12
|
+
(0, shared_1.writeFilesGuarded)(tree, root, (0, generate_1.generate)(recipe_1.layout, { name: options.name }));
|
|
13
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
exports.default = layoutGenerator;
|
|
17
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/tooling/devkit/src/generators/layout/generator.ts"],"names":[],"mappings":";;AAMA,0CAOC;;AAbD,uCAA+C;AAC/C,0DAAuD;AACvD,wDAAqD;AACrD,sCAA0D;AAG1D,SAAsB,eAAe,CACnC,IAAU,EACV,OAA8B;;QAE9B,MAAM,IAAI,GAAG,GAAG,IAAA,mBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC;QACzD,IAAA,0BAAiB,EAAC,IAAI,EAAE,IAAI,EAAE,IAAA,mBAAQ,EAAC,eAAM,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACxE,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "LoomWeaverLayout",
|
|
4
|
+
"title": "Scaffold a ShellLayout with the regions a weaver expects",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Layout name. Defaults to a base layout."
|
|
10
|
+
},
|
|
11
|
+
"app": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Application to drop into. Inferred when the workspace has exactly one."
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"required": []
|
|
17
|
+
}
|