@weave-framework/nx 0.2.162
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/LICENSE +21 -0
- package/README.md +71 -0
- package/dist/executors/check/executor.d.ts +7 -0
- package/dist/executors/check/executor.d.ts.map +1 -0
- package/dist/executors/check/executor.js +6 -0
- package/dist/executors/check/executor.js.map +1 -0
- package/dist/executors/check/schema.json +9 -0
- package/dist/executors/run-weave.d.ts +29 -0
- package/dist/executors/run-weave.d.ts.map +1 -0
- package/dist/executors/run-weave.js +50 -0
- package/dist/executors/run-weave.js.map +1 -0
- package/dist/executors/serve/executor.d.ts +7 -0
- package/dist/executors/serve/executor.d.ts.map +1 -0
- package/dist/executors/serve/executor.js +6 -0
- package/dist/executors/serve/executor.js.map +1 -0
- package/dist/executors/serve/schema.json +18 -0
- package/dist/generators/application/generator.d.ts +16 -0
- package/dist/generators/application/generator.d.ts.map +1 -0
- package/dist/generators/application/generator.js +54 -0
- package/dist/generators/application/generator.js.map +1 -0
- package/dist/generators/application/schema.json +25 -0
- package/dist/generators/component/files.d.ts +8 -0
- package/dist/generators/component/files.d.ts.map +1 -0
- package/dist/generators/component/files.js +25 -0
- package/dist/generators/component/files.js.map +1 -0
- package/dist/generators/component/generator.d.ts +14 -0
- package/dist/generators/component/generator.d.ts.map +1 -0
- package/dist/generators/component/generator.js +19 -0
- package/dist/generators/component/generator.js.map +1 -0
- package/dist/generators/component/schema.json +30 -0
- package/dist/generators/library/generator.d.ts +16 -0
- package/dist/generators/library/generator.d.ts.map +1 -0
- package/dist/generators/library/generator.js +35 -0
- package/dist/generators/library/generator.js.map +1 -0
- package/dist/generators/library/schema.json +25 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +28 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +75 -0
- package/dist/plugin.js.map +1 -0
- package/executors.json +20 -0
- package/generators.json +23 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aidas Josas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @weave-framework/nx
|
|
2
|
+
|
|
3
|
+
An [Nx](https://nx.dev) plugin that makes a [Weave](https://weaveframework.dev) app a first-class
|
|
4
|
+
project in an Nx monorepo — **inferred targets**, **executors**, and **generators**. Drop it into an
|
|
5
|
+
existing Nx workspace and your Weave apps get Nx caching, `nx affected`, and the project graph with
|
|
6
|
+
zero hand-wiring.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
nx add @weave-framework/nx
|
|
12
|
+
# or: npm i -D @weave-framework/nx and add the plugin to nx.json (below)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Register the inference plugin in `nx.json`:
|
|
16
|
+
|
|
17
|
+
```jsonc
|
|
18
|
+
{
|
|
19
|
+
"plugins": ["@weave-framework/nx/plugin"]
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Inferred targets (crystal)
|
|
24
|
+
|
|
25
|
+
For every `weave.config.{ts,js,json}` in a project, the plugin infers three targets — no
|
|
26
|
+
`project.json` boilerplate:
|
|
27
|
+
|
|
28
|
+
| Target | Runs | Cached |
|
|
29
|
+
|--------|------|--------|
|
|
30
|
+
| `build` | `weave build` (output = the config's `outDir`) | ✓ |
|
|
31
|
+
| `serve` | `weave dev` (watch + live-reload) | — |
|
|
32
|
+
| `check` | `weave check` | ✓ |
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
nx build my-app
|
|
36
|
+
nx serve my-app
|
|
37
|
+
nx check my-app
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Each target runs the existing `weave` CLI with `cwd` set to the project root, so it resolves that
|
|
41
|
+
project's own config — the Weave CLI itself needs no Nx-specific changes.
|
|
42
|
+
|
|
43
|
+
Override the inferred target names in `nx.json` if they collide with another plugin:
|
|
44
|
+
|
|
45
|
+
```jsonc
|
|
46
|
+
{ "plugins": [{ "plugin": "@weave-framework/nx/plugin", "options": { "buildTargetName": "bundle" } }] }
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Generators
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
nx g @weave-framework/nx:application my-app # a Weave app project (+ build/serve/check)
|
|
53
|
+
nx g @weave-framework/nx:library ui-kit # a component library (imported from source)
|
|
54
|
+
nx g @weave-framework/nx:component UserCard --project my-app # a component into a project
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Executors (explicit wiring)
|
|
58
|
+
|
|
59
|
+
Prefer explicit `project.json` targets over inference? The same three are available as executors:
|
|
60
|
+
`@weave-framework/nx:build`, `:serve`, `:check`.
|
|
61
|
+
|
|
62
|
+
## Zero-dependency note
|
|
63
|
+
|
|
64
|
+
`@nx/devkit` is a dev-time dependency of **this plugin** — correct and unavoidable for an Nx plugin
|
|
65
|
+
(it's tooling, only pulled in by Nx users). The Weave runtime, compiler, and router stay
|
|
66
|
+
zero-dependency; the executors shell out to the existing `weave` CLI rather than re-implementing the
|
|
67
|
+
build.
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { type CheckOptions } from '../run-weave.js';
|
|
3
|
+
/** `@weave-framework/nx:check` — run `weave check` (type-check templates + components). */
|
|
4
|
+
export default function checkExecutor(_options: CheckOptions, context: ExecutorContext): Promise<{
|
|
5
|
+
success: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/check/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEnE,2FAA2F;AAC3F,wBAA8B,aAAa,CACzC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAE/B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runForProject } from '../run-weave.js';
|
|
2
|
+
/** `@weave-framework/nx:check` — run `weave check` (type-check templates + components). */
|
|
3
|
+
export default async function checkExecutor(_options, context) {
|
|
4
|
+
return runForProject('check', {}, context);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/executors/check/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAqB,MAAM,iBAAiB,CAAC;AAEnE,2FAA2F;AAC3F,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,aAAa,CACzC,QAAsB,EACtB,OAAwB;IAExB,OAAO,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Weave check executor",
|
|
5
|
+
"description": "Run `weave check` — type-check a Weave project's templates and components.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {},
|
|
8
|
+
"additionalProperties": false
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared executor plumbing: build the `weave` CLI argument list for a command, and spawn the
|
|
3
|
+
* CLI with `cwd` = the project root (so it resolves that project's `weave.config.*`). Kept thin
|
|
4
|
+
* — the CLI does the real work (RFC 0004). The arg-builder is pure and unit-tested.
|
|
5
|
+
*/
|
|
6
|
+
import type { ExecutorContext } from '@nx/devkit';
|
|
7
|
+
export interface BuildOptions {
|
|
8
|
+
config?: string;
|
|
9
|
+
noMinify?: boolean;
|
|
10
|
+
outDir?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ServeOptions {
|
|
13
|
+
config?: string;
|
|
14
|
+
port?: number;
|
|
15
|
+
}
|
|
16
|
+
export type CheckOptions = Record<string, never>;
|
|
17
|
+
/** Build the `weave <command> …` argument list from a command + options. Pure. */
|
|
18
|
+
export declare function buildArgs(command: 'build' | 'dev' | 'check', options?: BuildOptions & ServeOptions): string[];
|
|
19
|
+
/** Resolve the project root (relative to the workspace) from an executor context. */
|
|
20
|
+
export declare function projectRootOf(context: ExecutorContext): string;
|
|
21
|
+
/** Spawn the `weave` CLI with the given args in `cwd`. Resolves `{ success }` on exit. */
|
|
22
|
+
export declare function runWeave(args: string[], cwd: string): Promise<{
|
|
23
|
+
success: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
/** Run a weave command for the current project (context.cwd = its root). */
|
|
26
|
+
export declare function runForProject(command: 'build' | 'dev' | 'check', options: BuildOptions & ServeOptions, context: ExecutorContext): Promise<{
|
|
27
|
+
success: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
//# sourceMappingURL=run-weave.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-weave.d.ts","sourceRoot":"","sources":["../../src/executors/run-weave.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEjD,kFAAkF;AAClF,wBAAgB,SAAS,CACvB,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,EAClC,OAAO,GAAE,YAAY,GAAG,YAAiB,GACxC,MAAM,EAAE,CASV;AAED,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAM9D;AAED,0FAA0F;AAC1F,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAYnF;AAED,4EAA4E;AAC5E,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,EAClC,OAAO,EAAE,YAAY,GAAG,YAAY,EACpC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAG/B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared executor plumbing: build the `weave` CLI argument list for a command, and spawn the
|
|
3
|
+
* CLI with `cwd` = the project root (so it resolves that project's `weave.config.*`). Kept thin
|
|
4
|
+
* — the CLI does the real work (RFC 0004). The arg-builder is pure and unit-tested.
|
|
5
|
+
*/
|
|
6
|
+
import { spawn } from 'node:child_process';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
/** Build the `weave <command> …` argument list from a command + options. Pure. */
|
|
9
|
+
export function buildArgs(command, options = {}) {
|
|
10
|
+
const args = [command];
|
|
11
|
+
if (options.config)
|
|
12
|
+
args.push('--config', options.config);
|
|
13
|
+
if (command === 'build') {
|
|
14
|
+
if (options.outDir)
|
|
15
|
+
args.push('--out', options.outDir);
|
|
16
|
+
if (options.noMinify)
|
|
17
|
+
args.push('--no-minify');
|
|
18
|
+
}
|
|
19
|
+
if (command === 'dev' && options.port != null)
|
|
20
|
+
args.push('--port', String(options.port));
|
|
21
|
+
return args;
|
|
22
|
+
}
|
|
23
|
+
/** Resolve the project root (relative to the workspace) from an executor context. */
|
|
24
|
+
export function projectRootOf(context) {
|
|
25
|
+
const name = context.projectName;
|
|
26
|
+
const root = name
|
|
27
|
+
? context.projectsConfigurations?.projects?.[name]?.root
|
|
28
|
+
: undefined;
|
|
29
|
+
return root ?? '.';
|
|
30
|
+
}
|
|
31
|
+
/** Spawn the `weave` CLI with the given args in `cwd`. Resolves `{ success }` on exit. */
|
|
32
|
+
export function runWeave(args, cwd) {
|
|
33
|
+
return new Promise((resolve) => {
|
|
34
|
+
// `npx --no-install weave` resolves the workspace-local CLI; shell:true so Windows finds
|
|
35
|
+
// the .cmd shim. The CLI is long-lived for `dev` — Nx tears it down via the process tree.
|
|
36
|
+
const child = spawn('npx', ['--no-install', 'weave', ...args], {
|
|
37
|
+
cwd,
|
|
38
|
+
stdio: 'inherit',
|
|
39
|
+
shell: true,
|
|
40
|
+
});
|
|
41
|
+
child.on('error', () => resolve({ success: false }));
|
|
42
|
+
child.on('close', (code) => resolve({ success: code === 0 }));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** Run a weave command for the current project (context.cwd = its root). */
|
|
46
|
+
export async function runForProject(command, options, context) {
|
|
47
|
+
const cwd = join(context.root, projectRootOf(context));
|
|
48
|
+
return runWeave(buildArgs(command, options), cwd);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=run-weave.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-weave.js","sourceRoot":"","sources":["../../src/executors/run-weave.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAcjC,kFAAkF;AAClF,MAAM,UAAU,SAAS,CACvB,OAAkC,EAClC,UAAuC,EAAE;IAEzC,MAAM,IAAI,GAAa,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,OAAO,CAAC,MAAM;QAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,IAAI,OAAO,CAAC,MAAM;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACvD,IAAI,OAAO,CAAC,QAAQ;YAAE,IAAI,CAAC,IAAI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ACpC,OAAwB;IAExB,MAAM,GAAG,GAAW,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,OAAO,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { type ServeOptions } from '../run-weave.js';
|
|
3
|
+
/** `@weave-framework/nx:serve` — run `weave dev` (watch + live-reload) for the project. */
|
|
4
|
+
export default function serveExecutor(options: ServeOptions, context: ExecutorContext): Promise<{
|
|
5
|
+
success: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/serve/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEnE,2FAA2F;AAC3F,wBAA8B,aAAa,CACzC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAE/B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runForProject } from '../run-weave.js';
|
|
2
|
+
/** `@weave-framework/nx:serve` — run `weave dev` (watch + live-reload) for the project. */
|
|
3
|
+
export default async function serveExecutor(options, context) {
|
|
4
|
+
return runForProject('dev', options ?? {}, context);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/executors/serve/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAqB,MAAM,iBAAiB,CAAC;AAEnE,2FAA2F;AAC3F,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,aAAa,CACzC,OAAqB,EACrB,OAAwB;IAExB,OAAO,aAAa,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Weave serve executor",
|
|
5
|
+
"description": "Run `weave dev` (watch + live-reload) for a Weave project.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"config": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Path to the weave.config file (relative to the project root)."
|
|
11
|
+
},
|
|
12
|
+
"port": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"description": "Dev server port."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"additionalProperties": false
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@weave-framework/nx:application` — scaffold a Weave app project into an Nx workspace and
|
|
3
|
+
* register it with `build`/`serve`/`check` targets (wired to this plugin's executors). The
|
|
4
|
+
* app mirrors the `create-weave` layout (root component + config + HTML shell).
|
|
5
|
+
*/
|
|
6
|
+
import { type Tree } from '@nx/devkit';
|
|
7
|
+
export interface ApplicationGeneratorSchema {
|
|
8
|
+
name: string;
|
|
9
|
+
directory?: string;
|
|
10
|
+
style?: 'css' | 'scss';
|
|
11
|
+
}
|
|
12
|
+
/** Compute the workspace-relative project root for an app (default under `apps/`). */
|
|
13
|
+
export declare function appRoot(name: string, directory?: string): string;
|
|
14
|
+
export declare function applicationGenerator(tree: Tree, schema: ApplicationGeneratorSchema): Promise<string>;
|
|
15
|
+
export default applicationGenerator;
|
|
16
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/application/generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED,sFAAsF;AACtF,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,CAyD1G;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@weave-framework/nx:application` — scaffold a Weave app project into an Nx workspace and
|
|
3
|
+
* register it with `build`/`serve`/`check` targets (wired to this plugin's executors). The
|
|
4
|
+
* app mirrors the `create-weave` layout (root component + config + HTML shell).
|
|
5
|
+
*/
|
|
6
|
+
import { addProjectConfiguration, formatFiles, joinPathFragments, names, } from '@nx/devkit';
|
|
7
|
+
/** Compute the workspace-relative project root for an app (default under `apps/`). */
|
|
8
|
+
export function appRoot(name, directory) {
|
|
9
|
+
const fileName = names(name).fileName;
|
|
10
|
+
return directory ? joinPathFragments(directory, fileName) : joinPathFragments('apps', fileName);
|
|
11
|
+
}
|
|
12
|
+
export async function applicationGenerator(tree, schema) {
|
|
13
|
+
const style = schema.style ?? 'css';
|
|
14
|
+
const root = appRoot(schema.name, schema.directory);
|
|
15
|
+
tree.write(joinPathFragments(root, 'weave.config.ts'), `import { defineConfig } from '@weave-framework/cli';\n\n` +
|
|
16
|
+
`export default defineConfig({\n` +
|
|
17
|
+
` root: 'src/app/app',\n` +
|
|
18
|
+
` index: 'src/index.html',\n` +
|
|
19
|
+
` mount: '#app',\n` +
|
|
20
|
+
` styleLang: '${style}',\n` +
|
|
21
|
+
`});\n`);
|
|
22
|
+
tree.write(joinPathFragments(root, 'src/index.html'), `<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n` +
|
|
23
|
+
` <meta name="viewport" content="width=device-width, initial-scale=1" />\n` +
|
|
24
|
+
` <title>${schema.name}</title>\n </head>\n <body>\n <div id="app"></div>\n </body>\n</html>\n`);
|
|
25
|
+
tree.write(joinPathFragments(root, 'src/app/app.ts'), `import { signal, type Signal } from '@weave-framework/runtime';\n\n` +
|
|
26
|
+
`export function setup(): { count: Signal<number>; inc: () => void } {\n` +
|
|
27
|
+
` const count: Signal<number> = signal(0);\n` +
|
|
28
|
+
` const inc = (): void => count.set((n) => n + 1);\n` +
|
|
29
|
+
` return { count, inc };\n` +
|
|
30
|
+
`}\n`);
|
|
31
|
+
tree.write(joinPathFragments(root, 'src/app/app.html'), `<main class="app">\n <h1>Hello, Weave</h1>\n` +
|
|
32
|
+
` <button on:click={{ inc }}>clicked {{ count() }} times</button>\n</main>\n`);
|
|
33
|
+
tree.write(joinPathFragments(root, `src/app/app.${style}`), `.app {\n font-family: system-ui, sans-serif;\n text-align: center;\n padding: 2rem;\n}\n`);
|
|
34
|
+
const project = {
|
|
35
|
+
root,
|
|
36
|
+
projectType: 'application',
|
|
37
|
+
sourceRoot: joinPathFragments(root, 'src'),
|
|
38
|
+
targets: {
|
|
39
|
+
build: {
|
|
40
|
+
executor: '@weave-framework/nx:build',
|
|
41
|
+
options: { config: 'weave.config.ts' },
|
|
42
|
+
outputs: ['{projectRoot}/dist'],
|
|
43
|
+
cache: true,
|
|
44
|
+
},
|
|
45
|
+
serve: { executor: '@weave-framework/nx:serve', options: { config: 'weave.config.ts' } },
|
|
46
|
+
check: { executor: '@weave-framework/nx:check', cache: true },
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
addProjectConfiguration(tree, schema.name, project);
|
|
50
|
+
await formatFiles(tree);
|
|
51
|
+
return root;
|
|
52
|
+
}
|
|
53
|
+
export default applicationGenerator;
|
|
54
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/generators/application/generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,KAAK,GAGN,MAAM,YAAY,CAAC;AAQpB,sFAAsF;AACtF,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,SAAkB;IACtD,MAAM,QAAQ,GAAW,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC9C,OAAO,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAAU,EAAE,MAAkC;IACvF,MAAM,KAAK,GAAmB,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC;IACpD,MAAM,IAAI,GAAW,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAE5D,IAAI,CAAC,KAAK,CACR,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAC1C,0DAA0D;QACxD,iCAAiC;QACjC,0BAA0B;QAC1B,8BAA8B;QAC9B,oBAAoB;QACpB,iBAAiB,KAAK,MAAM;QAC5B,OAAO,CACV,CAAC;IACF,IAAI,CAAC,KAAK,CACR,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,EACzC,6EAA6E;QAC3E,8EAA8E;QAC9E,cAAc,MAAM,CAAC,IAAI,+EAA+E,CAC3G,CAAC;IACF,IAAI,CAAC,KAAK,CACR,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,EACzC,qEAAqE;QACnE,yEAAyE;QACzE,8CAA8C;QAC9C,sDAAsD;QACtD,4BAA4B;QAC5B,KAAK,CACR,CAAC;IACF,IAAI,CAAC,KAAK,CACR,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,CAAC,EAC3C,+CAA+C;QAC7C,8EAA8E,CACjF,CAAC;IACF,IAAI,CAAC,KAAK,CACR,iBAAiB,CAAC,IAAI,EAAE,eAAe,KAAK,EAAE,CAAC,EAC/C,6FAA6F,CAC9F,CAAC;IAEF,MAAM,OAAO,GAAyB;QACpC,IAAI;QACJ,WAAW,EAAE,aAAa;QAC1B,UAAU,EAAE,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC;QAC1C,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,QAAQ,EAAE,2BAA2B;gBACrC,OAAO,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE;gBACtC,OAAO,EAAE,CAAC,oBAAoB,CAAC;gBAC/B,KAAK,EAAE,IAAI;aACZ;YACD,KAAK,EAAE,EAAE,QAAQ,EAAE,2BAA2B,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE;YACxF,KAAK,EAAE,EAAE,QAAQ,EAAE,2BAA2B,EAAE,KAAK,EAAE,IAAI,EAAE;SAC9D;KACF,CAAC;IACF,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpD,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "WeaveApplication",
|
|
4
|
+
"title": "Create a Weave application",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Application name.",
|
|
10
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
11
|
+
"x-prompt": "What name would you like to use for the application?"
|
|
12
|
+
},
|
|
13
|
+
"directory": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Parent directory for the app (default 'apps')."
|
|
16
|
+
},
|
|
17
|
+
"style": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"enum": ["css", "scss"],
|
|
20
|
+
"description": "Stylesheet language.",
|
|
21
|
+
"default": "css"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": ["name"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Pure content generation for the component generator — kebab file base + style → files. */
|
|
2
|
+
export interface GenFile {
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
/** The files for a component named `fileName` (already kebab-cased), rooted at `dir`. */
|
|
7
|
+
export declare function componentFiles(dir: string, fileName: string, style: 'css' | 'scss' | 'none'): GenFile[];
|
|
8
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/generators/component/files.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAE7F,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,CAuBvG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Pure content generation for the component generator — kebab file base + style → files. */
|
|
2
|
+
/** The files for a component named `fileName` (already kebab-cased), rooted at `dir`. */
|
|
3
|
+
export function componentFiles(dir, fileName, style) {
|
|
4
|
+
const files = [];
|
|
5
|
+
files.push({
|
|
6
|
+
path: `${dir}/${fileName}.ts`,
|
|
7
|
+
content: `import { signal, type Signal } from '@weave-framework/runtime';\n\n` +
|
|
8
|
+
`export function setup(): { count: Signal<number>; inc: () => void } {\n` +
|
|
9
|
+
` const count: Signal<number> = signal(0);\n` +
|
|
10
|
+
` const inc = (): void => count.set((n) => n + 1);\n` +
|
|
11
|
+
` return { count, inc };\n` +
|
|
12
|
+
`}\n`,
|
|
13
|
+
});
|
|
14
|
+
files.push({
|
|
15
|
+
path: `${dir}/${fileName}.html`,
|
|
16
|
+
content: `<section class="${fileName}">\n` +
|
|
17
|
+
` <button on:click={{ inc }}>clicked {{ count() }} times</button>\n` +
|
|
18
|
+
`</section>\n`,
|
|
19
|
+
});
|
|
20
|
+
if (style !== 'none') {
|
|
21
|
+
files.push({ path: `${dir}/${fileName}.${style}`, content: `.${fileName} {\n display: block;\n}\n` });
|
|
22
|
+
}
|
|
23
|
+
return files;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/generators/component/files.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAO7F,yFAAyF;AACzF,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,QAAgB,EAAE,KAA8B;IAC1F,MAAM,KAAK,GAAc,EAAE,CAAC;IAC5B,KAAK,CAAC,IAAI,CAAC;QACT,IAAI,EAAE,GAAG,GAAG,IAAI,QAAQ,KAAK;QAC7B,OAAO,EACL,qEAAqE;YACrE,yEAAyE;YACzE,8CAA8C;YAC9C,sDAAsD;YACtD,4BAA4B;YAC5B,KAAK;KACR,CAAC,CAAC;IACH,KAAK,CAAC,IAAI,CAAC;QACT,IAAI,EAAE,GAAG,GAAG,IAAI,QAAQ,OAAO;QAC/B,OAAO,EACL,mBAAmB,QAAQ,MAAM;YACjC,qEAAqE;YACrE,cAAc;KACjB,CAAC,CAAC;IACH,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,QAAQ,IAAI,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,QAAQ,4BAA4B,EAAE,CAAC,CAAC;IACzG,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@weave-framework/nx:component` — generate a Weave component (sibling `.ts` + `.html`
|
|
3
|
+
* [+ style]) into an existing project, honoring its `styleLang`.
|
|
4
|
+
*/
|
|
5
|
+
import { type Tree } from '@nx/devkit';
|
|
6
|
+
export interface ComponentGeneratorSchema {
|
|
7
|
+
name: string;
|
|
8
|
+
project: string;
|
|
9
|
+
directory?: string;
|
|
10
|
+
style?: 'css' | 'scss' | 'none';
|
|
11
|
+
}
|
|
12
|
+
export declare function componentGenerator(tree: Tree, schema: ComponentGeneratorSchema): Promise<void>;
|
|
13
|
+
export default componentGenerator;
|
|
14
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/component/generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAWpG;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@weave-framework/nx:component` — generate a Weave component (sibling `.ts` + `.html`
|
|
3
|
+
* [+ style]) into an existing project, honoring its `styleLang`.
|
|
4
|
+
*/
|
|
5
|
+
import { formatFiles, joinPathFragments, names, readProjectConfiguration, } from '@nx/devkit';
|
|
6
|
+
import { componentFiles } from './files.js';
|
|
7
|
+
export async function componentGenerator(tree, schema) {
|
|
8
|
+
const project = readProjectConfiguration(tree, schema.project);
|
|
9
|
+
const fileName = names(schema.name).fileName;
|
|
10
|
+
const sourceRoot = project.sourceRoot ?? joinPathFragments(project.root, 'src');
|
|
11
|
+
const dir = joinPathFragments(sourceRoot, schema.directory ?? '', fileName);
|
|
12
|
+
const style = schema.style ?? 'css';
|
|
13
|
+
for (const file of componentFiles(dir, fileName, style)) {
|
|
14
|
+
tree.write(file.path, file.content);
|
|
15
|
+
}
|
|
16
|
+
await formatFiles(tree);
|
|
17
|
+
}
|
|
18
|
+
export default componentGenerator;
|
|
19
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/generators/component/generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,KAAK,EACL,wBAAwB,GAGzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAS5C,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAU,EAAE,MAAgC;IACnF,MAAM,OAAO,GAAyB,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACrF,MAAM,QAAQ,GAAW,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IACrD,MAAM,UAAU,GAAW,OAAO,CAAC,UAAU,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACxF,MAAM,GAAG,GAAW,iBAAiB,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;IACpF,MAAM,KAAK,GAA4B,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC;IAE7D,KAAK,MAAM,IAAI,IAAI,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IACD,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "WeaveComponent",
|
|
4
|
+
"title": "Create a Weave component",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Component name (PascalCase or kebab-case).",
|
|
10
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
11
|
+
"x-prompt": "What name would you like to use for the component?"
|
|
12
|
+
},
|
|
13
|
+
"project": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "The project to add the component to.",
|
|
16
|
+
"$default": { "$source": "projectName" }
|
|
17
|
+
},
|
|
18
|
+
"directory": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "Subdirectory under the project source root."
|
|
21
|
+
},
|
|
22
|
+
"style": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"enum": ["css", "scss", "none"],
|
|
25
|
+
"description": "Stylesheet language (or none).",
|
|
26
|
+
"default": "css"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"required": ["name", "project"]
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@weave-framework/nx:library` — scaffold a Weave component library. v1 is an
|
|
3
|
+
* imported-from-source library (one component + a barrel `index.ts`); a fully-bundled
|
|
4
|
+
* publishable lib is a fast-follow (RFC 0004 §Open #1). Gets a `check` target only.
|
|
5
|
+
*/
|
|
6
|
+
import { type Tree } from '@nx/devkit';
|
|
7
|
+
export interface LibraryGeneratorSchema {
|
|
8
|
+
name: string;
|
|
9
|
+
directory?: string;
|
|
10
|
+
style?: 'css' | 'scss' | 'none';
|
|
11
|
+
}
|
|
12
|
+
/** Compute the workspace-relative project root for a library (default under `libs/`). */
|
|
13
|
+
export declare function libRoot(name: string, directory?: string): string;
|
|
14
|
+
export declare function libraryGenerator(tree: Tree, schema: LibraryGeneratorSchema): Promise<string>;
|
|
15
|
+
export default libraryGenerator;
|
|
16
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/library/generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,yFAAyF;AACzF,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBlG;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@weave-framework/nx:library` — scaffold a Weave component library. v1 is an
|
|
3
|
+
* imported-from-source library (one component + a barrel `index.ts`); a fully-bundled
|
|
4
|
+
* publishable lib is a fast-follow (RFC 0004 §Open #1). Gets a `check` target only.
|
|
5
|
+
*/
|
|
6
|
+
import { addProjectConfiguration, formatFiles, joinPathFragments, names, } from '@nx/devkit';
|
|
7
|
+
import { componentFiles } from '../component/files.js';
|
|
8
|
+
/** Compute the workspace-relative project root for a library (default under `libs/`). */
|
|
9
|
+
export function libRoot(name, directory) {
|
|
10
|
+
const fileName = names(name).fileName;
|
|
11
|
+
return directory ? joinPathFragments(directory, fileName) : joinPathFragments('libs', fileName);
|
|
12
|
+
}
|
|
13
|
+
export async function libraryGenerator(tree, schema) {
|
|
14
|
+
const fileName = names(schema.name).fileName;
|
|
15
|
+
const root = libRoot(schema.name, schema.directory);
|
|
16
|
+
const src = joinPathFragments(root, 'src');
|
|
17
|
+
const style = schema.style ?? 'css';
|
|
18
|
+
for (const file of componentFiles(joinPathFragments(src, 'lib', fileName), fileName, style)) {
|
|
19
|
+
tree.write(file.path, file.content);
|
|
20
|
+
}
|
|
21
|
+
tree.write(joinPathFragments(src, 'index.ts'), `export { setup } from './lib/${fileName}/${fileName}.js';\n`);
|
|
22
|
+
const project = {
|
|
23
|
+
root,
|
|
24
|
+
projectType: 'library',
|
|
25
|
+
sourceRoot: src,
|
|
26
|
+
targets: {
|
|
27
|
+
check: { executor: '@weave-framework/nx:check', cache: true },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
addProjectConfiguration(tree, schema.name, project);
|
|
31
|
+
await formatFiles(tree);
|
|
32
|
+
return root;
|
|
33
|
+
}
|
|
34
|
+
export default libraryGenerator;
|
|
35
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/generators/library/generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,KAAK,GAGN,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAA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uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpD,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "WeaveLibrary",
|
|
4
|
+
"title": "Create a Weave library",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Library name.",
|
|
10
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
11
|
+
"x-prompt": "What name would you like to use for the library?"
|
|
12
|
+
},
|
|
13
|
+
"directory": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Parent directory for the library (default 'libs')."
|
|
16
|
+
},
|
|
17
|
+
"style": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"enum": ["css", "scss", "none"],
|
|
20
|
+
"description": "Stylesheet language (or none).",
|
|
21
|
+
"default": "css"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": ["name"]
|
|
25
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @weave-framework/nx — an Nx plugin that makes a Weave app a first-class Nx project:
|
|
3
|
+
* inferred build/serve/check targets (crystal `createNodesV2`), executors, and generators.
|
|
4
|
+
* Register the inference in `nx.json` as `"@weave-framework/nx/plugin"`. Purely additive —
|
|
5
|
+
* the core runtime/compiler/CLI are unchanged; executors thin-wrap the existing `weave` CLI.
|
|
6
|
+
*
|
|
7
|
+
* `@nx/devkit` is a dev-time dependency of the plugin (correct for an Nx plugin) — the Weave
|
|
8
|
+
* runtime/compiler/router stay zero-dependency ([[weave-zero-dependencies]] / RFC 0004).
|
|
9
|
+
*/
|
|
10
|
+
export { createNodesV2, buildWeaveTargets, readOutDir, WEAVE_CONFIG_GLOB, type WeaveNxPluginOptions, } from './plugin.js';
|
|
11
|
+
export { buildArgs, runWeave, projectRootOf, runForProject } from './executors/run-weave.js';
|
|
12
|
+
export type { BuildOptions, ServeOptions, CheckOptions } from './executors/run-weave.js';
|
|
13
|
+
export { applicationGenerator, appRoot, type ApplicationGeneratorSchema } from './generators/application/generator.js';
|
|
14
|
+
export { libraryGenerator, libRoot, type LibraryGeneratorSchema } from './generators/library/generator.js';
|
|
15
|
+
export { componentGenerator, type ComponentGeneratorSchema } from './generators/component/generator.js';
|
|
16
|
+
export { componentFiles, type GenFile } from './generators/component/files.js';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,KAAK,oBAAoB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC7F,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEzF,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACvH,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,KAAK,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @weave-framework/nx — an Nx plugin that makes a Weave app a first-class Nx project:
|
|
3
|
+
* inferred build/serve/check targets (crystal `createNodesV2`), executors, and generators.
|
|
4
|
+
* Register the inference in `nx.json` as `"@weave-framework/nx/plugin"`. Purely additive —
|
|
5
|
+
* the core runtime/compiler/CLI are unchanged; executors thin-wrap the existing `weave` CLI.
|
|
6
|
+
*
|
|
7
|
+
* `@nx/devkit` is a dev-time dependency of the plugin (correct for an Nx plugin) — the Weave
|
|
8
|
+
* runtime/compiler/router stay zero-dependency ([[weave-zero-dependencies]] / RFC 0004).
|
|
9
|
+
*/
|
|
10
|
+
export { createNodesV2, buildWeaveTargets, readOutDir, WEAVE_CONFIG_GLOB, } from './plugin.js';
|
|
11
|
+
export { buildArgs, runWeave, projectRootOf, runForProject } from './executors/run-weave.js';
|
|
12
|
+
export { applicationGenerator, appRoot } from './generators/application/generator.js';
|
|
13
|
+
export { libraryGenerator, libRoot } from './generators/library/generator.js';
|
|
14
|
+
export { componentGenerator } from './generators/component/generator.js';
|
|
15
|
+
export { componentFiles } from './generators/component/files.js';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,iBAAiB,GAElB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG7F,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAmC,MAAM,uCAAuC,CAAC;AACvH,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAA+B,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAiC,MAAM,qCAAqC,CAAC;AACxG,OAAO,EAAE,cAAc,EAAgB,MAAM,iCAAiC,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Nx "crystal" inference plugin: for every `weave.config.{ts,js,json}` in the workspace,
|
|
3
|
+
* infer `build` / `serve` / `check` targets on that project — no target boilerplate in
|
|
4
|
+
* `project.json`. Registered in `nx.json` as `"@weave-framework/nx/plugin"`.
|
|
5
|
+
*
|
|
6
|
+
* Targets run the existing `weave` CLI with `cwd` = the project root, so the CLI resolves
|
|
7
|
+
* the project's own `weave.config.*` (RFC 0004: no CLI change needed). Cache inputs cover
|
|
8
|
+
* the project's source/config/templates/styles; the build's output is the config's `outDir`.
|
|
9
|
+
*/
|
|
10
|
+
import type { CreateNodesV2, TargetConfiguration } from '@nx/devkit';
|
|
11
|
+
/** Options (2nd arg in nx.json) — override the inferred target names so it co-exists with other plugins. */
|
|
12
|
+
export interface WeaveNxPluginOptions {
|
|
13
|
+
buildTargetName?: string;
|
|
14
|
+
serveTargetName?: string;
|
|
15
|
+
checkTargetName?: string;
|
|
16
|
+
}
|
|
17
|
+
/** The config files this plugin infers from. */
|
|
18
|
+
export declare const WEAVE_CONFIG_GLOB: string;
|
|
19
|
+
/** Shallow-read `outDir` from a weave config's text (no esbuild at inference time). Default `dist`. */
|
|
20
|
+
export declare function readOutDir(configText: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Compute the inferred targets for one project. Pure over its inputs (project root, config
|
|
23
|
+
* file basename, resolved outDir, options) — the unit-testable heart of the plugin.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildWeaveTargets(projectRoot: string, configBasename: string, outDir: string, options?: WeaveNxPluginOptions): Record<string, TargetConfiguration>;
|
|
26
|
+
/** The Nx crystal entry point — glob + a per-file inference callback. */
|
|
27
|
+
export declare const createNodesV2: CreateNodesV2<WeaveNxPluginOptions>;
|
|
28
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAGV,aAAa,EAEb,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,4GAA4G;AAC5G,MAAM,WAAW,oBAAoB;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,EAAE,MAAuC,CAAC;AAExE,uGAAuG;AACvG,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAIrD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CA8BrC;AA+BD,yEAAyE;AACzE,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,oBAAoB,CAS7D,CAAC"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Nx "crystal" inference plugin: for every `weave.config.{ts,js,json}` in the workspace,
|
|
3
|
+
* infer `build` / `serve` / `check` targets on that project — no target boilerplate in
|
|
4
|
+
* `project.json`. Registered in `nx.json` as `"@weave-framework/nx/plugin"`.
|
|
5
|
+
*
|
|
6
|
+
* Targets run the existing `weave` CLI with `cwd` = the project root, so the CLI resolves
|
|
7
|
+
* the project's own `weave.config.*` (RFC 0004: no CLI change needed). Cache inputs cover
|
|
8
|
+
* the project's source/config/templates/styles; the build's output is the config's `outDir`.
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
11
|
+
import { basename, dirname, join } from 'node:path';
|
|
12
|
+
import { createNodesFromFiles } from '@nx/devkit';
|
|
13
|
+
/** The config files this plugin infers from. */
|
|
14
|
+
export const WEAVE_CONFIG_GLOB = '**/weave.config.{ts,js,json}';
|
|
15
|
+
/** Shallow-read `outDir` from a weave config's text (no esbuild at inference time). Default `dist`. */
|
|
16
|
+
export function readOutDir(configText) {
|
|
17
|
+
// Matches `outDir: 'x'` (ts) and `"outDir": "x"` (json — optional closing key quote). First hit wins.
|
|
18
|
+
const m = configText.match(/outDir['"]?\s*:\s*['"]([^'"]+)['"]/);
|
|
19
|
+
return m ? m[1] : 'dist';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Compute the inferred targets for one project. Pure over its inputs (project root, config
|
|
23
|
+
* file basename, resolved outDir, options) — the unit-testable heart of the plugin.
|
|
24
|
+
*/
|
|
25
|
+
export function buildWeaveTargets(projectRoot, configBasename, outDir, options = {}) {
|
|
26
|
+
const buildName = options.buildTargetName ?? 'build';
|
|
27
|
+
const serveName = options.serveTargetName ?? 'serve';
|
|
28
|
+
const checkName = options.checkTargetName ?? 'check';
|
|
29
|
+
// Cache inputs: this project's own files + config/templates/styles + the CLI version.
|
|
30
|
+
const inputs = [
|
|
31
|
+
'{projectRoot}/**/*',
|
|
32
|
+
{ externalDependencies: ['@weave-framework/cli'] },
|
|
33
|
+
];
|
|
34
|
+
return {
|
|
35
|
+
[buildName]: {
|
|
36
|
+
command: `weave build --config ${configBasename}`,
|
|
37
|
+
options: { cwd: projectRoot },
|
|
38
|
+
cache: true,
|
|
39
|
+
inputs,
|
|
40
|
+
outputs: [`{projectRoot}/${outDir}`],
|
|
41
|
+
},
|
|
42
|
+
[serveName]: {
|
|
43
|
+
command: `weave dev --config ${configBasename}`,
|
|
44
|
+
options: { cwd: projectRoot },
|
|
45
|
+
},
|
|
46
|
+
[checkName]: {
|
|
47
|
+
command: 'weave check',
|
|
48
|
+
options: { cwd: projectRoot },
|
|
49
|
+
cache: true,
|
|
50
|
+
inputs,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** Build the project entry for one discovered config file (or `{}` if it isn't a real project). */
|
|
55
|
+
function createProjectFromConfigFile(configFile, options, context) {
|
|
56
|
+
const projectRoot = dirname(configFile);
|
|
57
|
+
const absRoot = join(context.workspaceRoot, projectRoot);
|
|
58
|
+
// Only treat a dir as a project if it carries a project marker — avoids registering targets
|
|
59
|
+
// on an incidental config found in a nested/example dir (standard Nx crystal guard).
|
|
60
|
+
const siblings = existsSync(absRoot) ? readdirSync(absRoot) : [];
|
|
61
|
+
if (!siblings.includes('project.json') && !siblings.includes('package.json')) {
|
|
62
|
+
return {};
|
|
63
|
+
}
|
|
64
|
+
const configText = readFileSync(join(context.workspaceRoot, configFile), 'utf8');
|
|
65
|
+
const outDir = readOutDir(configText);
|
|
66
|
+
const targets = buildWeaveTargets(projectRoot, basename(configFile), outDir, options ?? {});
|
|
67
|
+
const project = { root: projectRoot, targets };
|
|
68
|
+
return { projects: { [projectRoot]: project } };
|
|
69
|
+
}
|
|
70
|
+
/** The Nx crystal entry point — glob + a per-file inference callback. */
|
|
71
|
+
export const createNodesV2 = [
|
|
72
|
+
WEAVE_CONFIG_GLOB,
|
|
73
|
+
(configFiles, options, context) => createNodesFromFiles((configFile, opts, ctx) => createProjectFromConfigFile(configFile, opts, ctx), configFiles, options, context),
|
|
74
|
+
];
|
|
75
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAgBlD,gDAAgD;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAW,8BAA8B,CAAC;A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
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"executors": {
|
|
4
|
+
"build": {
|
|
5
|
+
"implementation": "./dist/executors/build/executor.js",
|
|
6
|
+
"schema": "./dist/executors/build/schema.json",
|
|
7
|
+
"description": "Run `weave build` for a Weave project."
|
|
8
|
+
},
|
|
9
|
+
"serve": {
|
|
10
|
+
"implementation": "./dist/executors/serve/executor.js",
|
|
11
|
+
"schema": "./dist/executors/serve/schema.json",
|
|
12
|
+
"description": "Run `weave dev` (watch + live-reload) for a Weave project."
|
|
13
|
+
},
|
|
14
|
+
"check": {
|
|
15
|
+
"implementation": "./dist/executors/check/executor.js",
|
|
16
|
+
"schema": "./dist/executors/check/schema.json",
|
|
17
|
+
"description": "Run `weave check` — type-check a Weave project."
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
package/generators.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"generators": {
|
|
4
|
+
"application": {
|
|
5
|
+
"factory": "./dist/generators/application/generator.js",
|
|
6
|
+
"schema": "./dist/generators/application/schema.json",
|
|
7
|
+
"description": "Create a Weave application project.",
|
|
8
|
+
"aliases": ["app"]
|
|
9
|
+
},
|
|
10
|
+
"library": {
|
|
11
|
+
"factory": "./dist/generators/library/generator.js",
|
|
12
|
+
"schema": "./dist/generators/library/schema.json",
|
|
13
|
+
"description": "Create a Weave library project.",
|
|
14
|
+
"aliases": ["lib"]
|
|
15
|
+
},
|
|
16
|
+
"component": {
|
|
17
|
+
"factory": "./dist/generators/component/generator.js",
|
|
18
|
+
"schema": "./dist/generators/component/schema.json",
|
|
19
|
+
"description": "Create a Weave component in a project.",
|
|
20
|
+
"aliases": ["c"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@weave-framework/nx",
|
|
3
|
+
"version": "0.2.162",
|
|
4
|
+
"description": "Nx plugin for Weave — inferred build/serve/check targets (crystal createNodesV2), executors, and generators, so a Weave app is a first-class project in an Nx monorepo.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./plugin": {
|
|
14
|
+
"types": "./dist/plugin.d.ts",
|
|
15
|
+
"import": "./dist/plugin.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"executors": "./executors.json",
|
|
19
|
+
"generators": "./generators.json",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"executors.json",
|
|
23
|
+
"generators.json",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/weave-framework/weave.git",
|
|
32
|
+
"directory": "packages/nx"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@nx/devkit": "^23.0.1"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"nx": ">=21.0.0"
|
|
42
|
+
},
|
|
43
|
+
"license": "MIT"
|
|
44
|
+
}
|