@ng-desktop/builders 0.0.0-stage → 0.4.0
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 +13 -2
- package/bin/ng-desktop.mjs +200 -0
- package/builders.json +15 -0
- package/fesm2022/application-builder.d.mts +62 -0
- package/fesm2022/application-builder.mjs +58 -0
- package/fesm2022/ast-metadata-extractor.d.mts +40 -0
- package/fesm2022/ast-metadata-extractor.mjs +460 -0
- package/fesm2022/build-bundle.d.mts +45 -0
- package/fesm2022/build-bundle.mjs +462 -0
- package/fesm2022/builder.d.ts +66 -0
- package/fesm2022/builder.js +123 -0
- package/fesm2022/dev-server-builder.d.mts +26 -0
- package/fesm2022/dev-server-builder.mjs +24 -0
- package/fesm2022/dev-server.mjs +47 -0
- package/fesm2022/hmr-client.d.mts +24 -0
- package/fesm2022/hmr-client.mjs +84 -0
- package/fesm2022/icon-compiler.d.mts +6 -0
- package/fesm2022/icon-compiler.mjs +148 -0
- package/fesm2022/index.d.ts +13 -0
- package/fesm2022/index.js +13 -0
- package/fesm2022/permission-analyzer.d.mts +45 -0
- package/fesm2022/permission-analyzer.mjs +333 -0
- package/fesm2022/resolve-engine-binary.d.mts +35 -0
- package/fesm2022/resolve-engine-binary.mjs +130 -0
- package/fesm2022/server-compiler.d.mts +29 -0
- package/fesm2022/server-compiler.mjs +236 -0
- package/fesm2022/style-compiler.d.mts +26 -0
- package/fesm2022/style-compiler.mjs +258 -0
- package/fesm2022/template-compiler.d.mts +53 -0
- package/fesm2022/template-compiler.mjs +892 -0
- package/fesm2022/workspace-resolver.d.mts +24 -0
- package/fesm2022/workspace-resolver.mjs +199 -0
- package/package.json +79 -4
- package/schema/angular-native-schema.json +52 -0
- package/schema/native-builder-schema.json +97 -0
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.d.mts +20 -0
- package/schematics/ng-add/index.mjs +56 -0
- package/schematics/ng-add/schema.json +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gaspar1992 and NgDesktop Engine Contributors
|
|
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
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ng-desktop/builders
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular 22+ CLI & Nx Architect builder, AST permission analyzer, CLI, and schematics
|
|
4
|
+
|
|
5
|
+
Part of **[NgDesktop Engine](https://github.com/Gaspar1992/ng-desktop-engine)** — Native desktop rendering engine for Angular 22+ (`GTK4`, `WinUI 3`, `AppKit`).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @ng-desktop/builders
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- Repository path: `packages/builders-native`
|
|
14
|
+
- Documentation & Ecosystem Guide: https://github.com/Gaspar1992/ng-desktop-engine/blob/main/docs/ECOSYSTEM_COMPATIBILITY.md
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const SRC_ROOT = existsSync(resolve(__dirname, '../fesm2022/build-bundle.mjs'))
|
|
9
|
+
? resolve(__dirname, '../fesm2022')
|
|
10
|
+
: resolve(__dirname, '../src');
|
|
11
|
+
|
|
12
|
+
const [
|
|
13
|
+
{ compileBundle, watchBundle },
|
|
14
|
+
{ analyzeProjectPermissions },
|
|
15
|
+
{ resolveEngineBinaryPath },
|
|
16
|
+
{ resolveWorkspaceProject },
|
|
17
|
+
] = await Promise.all([
|
|
18
|
+
import(resolve(SRC_ROOT, 'build-bundle.mjs')),
|
|
19
|
+
import(resolve(SRC_ROOT, 'permission-analyzer.mjs')),
|
|
20
|
+
import(resolve(SRC_ROOT, 'resolve-engine-binary.mjs')),
|
|
21
|
+
import(resolve(SRC_ROOT, 'workspace-resolver.mjs')),
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
function getFlag(args, name) {
|
|
25
|
+
const prefix = `${name}=`;
|
|
26
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
27
|
+
if (args[i].startsWith(prefix)) {
|
|
28
|
+
return args[i].slice(prefix.length).trim();
|
|
29
|
+
}
|
|
30
|
+
if (args[i] === name && i + 1 < args.length && !args[i + 1].startsWith('--')) {
|
|
31
|
+
return args[i + 1].trim();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function printHelp() {
|
|
38
|
+
process.stdout.write(
|
|
39
|
+
[
|
|
40
|
+
'ng-desktop — Angular Desktop Engine CLI (Angular CLI + Nx)',
|
|
41
|
+
'',
|
|
42
|
+
'Usage:',
|
|
43
|
+
' ng-desktop build [--project=<name>] [--config=<path>] [--version=<ver>] [--watch]',
|
|
44
|
+
' ng-desktop run [--project=<name>] [--config=<path>] [--version=<ver>] [--batch]',
|
|
45
|
+
' ng-desktop permissions [--project=<name>] [--config=<path>] [--strict]',
|
|
46
|
+
' ng-desktop package [--project=<name>] [--config=<path>] [--version=<ver>] [--all]',
|
|
47
|
+
' ng-desktop init [--project=<name>] [--target=<linux-gtk4|windows-winui|macos-appkit>]',
|
|
48
|
+
'',
|
|
49
|
+
].join('\n'),
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function handleInit(args) {
|
|
54
|
+
const cwd = process.cwd();
|
|
55
|
+
const targetPlatform = getFlag(args, '--target') || 'linux-gtk4';
|
|
56
|
+
const projectHint = getFlag(args, '--project');
|
|
57
|
+
const nativeConfigBlock = {
|
|
58
|
+
builder: '@ng-desktop/builders:application',
|
|
59
|
+
options: {
|
|
60
|
+
targetPlatform,
|
|
61
|
+
permissions: { mode: 'auto' },
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const angularJsonPath = resolve(cwd, 'angular.json');
|
|
66
|
+
if (existsSync(angularJsonPath)) {
|
|
67
|
+
const raw = JSON.parse(readFileSync(angularJsonPath, 'utf8'));
|
|
68
|
+
const projectName = projectHint || raw.defaultProject || Object.keys(raw.projects ?? {})[0];
|
|
69
|
+
if (!projectName || !raw.projects?.[projectName]) {
|
|
70
|
+
throw new Error('Could not locate a target project inside angular.json');
|
|
71
|
+
}
|
|
72
|
+
raw.projects[projectName].architect ??= {};
|
|
73
|
+
raw.projects[projectName].architect.native ??= nativeConfigBlock;
|
|
74
|
+
writeFileSync(angularJsonPath, `${JSON.stringify(raw, null, 2)}\n`, 'utf8');
|
|
75
|
+
process.stdout.write(`[ng-desktop init] Configured 'architect.native' for '${projectName}'.\n`);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const nxProjectPath = resolve(cwd, 'project.json');
|
|
80
|
+
if (existsSync(nxProjectPath)) {
|
|
81
|
+
const raw = JSON.parse(readFileSync(nxProjectPath, 'utf8'));
|
|
82
|
+
raw.targets ??= {};
|
|
83
|
+
raw.targets.native ??= {
|
|
84
|
+
executor: '@ng-desktop/builders:application',
|
|
85
|
+
options: nativeConfigBlock.options,
|
|
86
|
+
};
|
|
87
|
+
writeFileSync(nxProjectPath, `${JSON.stringify(raw, null, 2)}\n`, 'utf8');
|
|
88
|
+
process.stdout.write(`[ng-desktop init] Configured Nx 'targets.native' for '${raw.name}'.\n`);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
throw new Error('No angular.json or project.json found in current working directory.');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function launchHostEngine(ws, engineArgs, { preferReleaseCargo = false, envExtra = {} } = {}) {
|
|
96
|
+
const resolvedEngine = resolveEngineBinaryPath({
|
|
97
|
+
cwd: process.cwd(),
|
|
98
|
+
workspaceRoot: ws.workspaceRoot,
|
|
99
|
+
});
|
|
100
|
+
const baseArgs =
|
|
101
|
+
resolvedEngine.mode === 'cargo' && preferReleaseCargo
|
|
102
|
+
? ['run', '--release', '--']
|
|
103
|
+
: resolvedEngine.args;
|
|
104
|
+
const run = spawnSync(resolvedEngine.command, [...baseArgs, ...engineArgs], {
|
|
105
|
+
stdio: 'inherit',
|
|
106
|
+
cwd: ws.workspaceRoot,
|
|
107
|
+
env: { ...process.env, ...envExtra },
|
|
108
|
+
});
|
|
109
|
+
if (run.error?.code === 'ENOENT') {
|
|
110
|
+
process.stderr.write(
|
|
111
|
+
resolvedEngine.mode === 'cargo'
|
|
112
|
+
? `[ng-desktop] Native engine not found for ${resolvedEngine.targetKey}. ` +
|
|
113
|
+
`Install '${resolvedEngine.packageName ?? '@ng-desktop/engine-*'}' (no 'cargo' available), ` +
|
|
114
|
+
`or set NG_DESKTOP_ENGINE_BIN to the engine binary.\n`
|
|
115
|
+
: `[ng-desktop] Could not execute engine binary '${resolvedEngine.command}'.\n`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
process.exitCode = run.status ?? 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function main() {
|
|
122
|
+
const args = process.argv.slice(2);
|
|
123
|
+
const cmd = args[0];
|
|
124
|
+
if (!cmd || cmd === '--help' || cmd === '-h') {
|
|
125
|
+
printHelp();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const projectName = getFlag(args, '--project');
|
|
130
|
+
const configPath = getFlag(args, '--config');
|
|
131
|
+
const version = getFlag(args, '--version');
|
|
132
|
+
|
|
133
|
+
if (cmd === 'build') {
|
|
134
|
+
if (args.includes('--watch')) {
|
|
135
|
+
watchBundle({ configPath, projectName, version });
|
|
136
|
+
} else {
|
|
137
|
+
const result = compileBundle({ configPath, projectName, version, rebuildIcons: true });
|
|
138
|
+
process.stdout.write(
|
|
139
|
+
`[ng-desktop build] Emitted bundle '${result.bundleFile}' and permissions '${result.permissionsFile}'.\n`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (cmd === 'run') {
|
|
146
|
+
const ws = resolveWorkspaceProject({ configPath, projectName });
|
|
147
|
+
launchHostEngine(
|
|
148
|
+
ws,
|
|
149
|
+
[
|
|
150
|
+
`--config=${ws.configFile}`,
|
|
151
|
+
`--project=${ws.projectName}`,
|
|
152
|
+
`--version=${version || ws.version}`,
|
|
153
|
+
],
|
|
154
|
+
{ envExtra: args.includes('--batch') ? { NG_NATIVE_BATCH: '1' } : {} },
|
|
155
|
+
);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (cmd === 'permissions') {
|
|
160
|
+
const ws = resolveWorkspaceProject({ configPath, projectName });
|
|
161
|
+
const srcRoot = resolve(ws.workspaceRoot, ws.sourceRoot);
|
|
162
|
+
const basePolicy = ws.nativeOptions?.permissions ?? {};
|
|
163
|
+
const policy = args.includes('--strict') ? { ...basePolicy, mode: 'strict' } : basePolicy;
|
|
164
|
+
const manifest = analyzeProjectPermissions(srcRoot, policy);
|
|
165
|
+
process.stdout.write(`${JSON.stringify(manifest, null, 2)}\n`);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (cmd === 'package') {
|
|
170
|
+
const ws = resolveWorkspaceProject({ configPath, projectName });
|
|
171
|
+
const pkgFlag = args.includes('--all') ? '--package-all' : '--package';
|
|
172
|
+
launchHostEngine(
|
|
173
|
+
ws,
|
|
174
|
+
[
|
|
175
|
+
pkgFlag,
|
|
176
|
+
`--config=${ws.configFile}`,
|
|
177
|
+
`--project=${ws.projectName}`,
|
|
178
|
+
`--version=${version || ws.version}`,
|
|
179
|
+
],
|
|
180
|
+
{ preferReleaseCargo: true },
|
|
181
|
+
);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (cmd === 'init') {
|
|
186
|
+
handleInit(args);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
process.stderr.write(`Unknown command '${cmd}'.\n`);
|
|
191
|
+
printHelp();
|
|
192
|
+
process.exitCode = 1;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
try {
|
|
196
|
+
main();
|
|
197
|
+
} catch (err) {
|
|
198
|
+
process.stderr.write(`[ng-desktop error] ${err instanceof Error ? err.message : String(err)}\n`);
|
|
199
|
+
process.exitCode = 1;
|
|
200
|
+
}
|
package/builders.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../node_modules/@angular-devkit/architect/src/builders-schema.json",
|
|
3
|
+
"builders": {
|
|
4
|
+
"application": {
|
|
5
|
+
"implementation": "./fesm2022/application-builder.mjs",
|
|
6
|
+
"schema": "./schema/native-builder-schema.json",
|
|
7
|
+
"description": "Compile Angular templates, Ivy bundles, Analog server routes, and least-privilege manifests for native desktop targets."
|
|
8
|
+
},
|
|
9
|
+
"dev-server": {
|
|
10
|
+
"implementation": "./fesm2022/dev-server-builder.mjs",
|
|
11
|
+
"schema": "./schema/native-builder-schema.json",
|
|
12
|
+
"description": "Run incremental native watch builds and push live frontend/server HMR updates to the running desktop window."
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { HmrDeltaSummary } from './build-bundle.mjs';
|
|
2
|
+
|
|
3
|
+
export const ARCHITECT_BUILDER_SYMBOL: unique symbol;
|
|
4
|
+
export const ARCHITECT_VERSION_SYMBOL: unique symbol;
|
|
5
|
+
|
|
6
|
+
export interface ArchitectBuilderContextLike {
|
|
7
|
+
workspaceRoot?: string;
|
|
8
|
+
target?: { project?: string; target?: string };
|
|
9
|
+
logger?: { info?: (msg: string) => void; error?: (msg: string) => void };
|
|
10
|
+
addTeardown?: (teardown: () => void | Promise<void>) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface NativeApplicationBuilderOptions {
|
|
14
|
+
cwd?: string;
|
|
15
|
+
configPath?: string;
|
|
16
|
+
projectName?: string;
|
|
17
|
+
version?: string;
|
|
18
|
+
rebuildIcons?: boolean;
|
|
19
|
+
os?: string;
|
|
20
|
+
arch?: string;
|
|
21
|
+
cpu?: string;
|
|
22
|
+
targetPlatform?: string;
|
|
23
|
+
jsEngine?: string;
|
|
24
|
+
outputPath?: string;
|
|
25
|
+
main?: string;
|
|
26
|
+
permissions?: { mode?: 'auto' | 'strict'; allow?: string[]; deny?: string[] };
|
|
27
|
+
packageFormats?: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface NativeApplicationBuilderOutput {
|
|
31
|
+
success: boolean;
|
|
32
|
+
projectName: string;
|
|
33
|
+
version: string;
|
|
34
|
+
bundleFile: string;
|
|
35
|
+
entryBundleFile?: string;
|
|
36
|
+
serverBundleFile?: string;
|
|
37
|
+
permissionsFile: string;
|
|
38
|
+
runtimeConfigFile: string;
|
|
39
|
+
hmrDelta: HmrDeltaSummary;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ArchitectBuilderObject<TOpt, TOut> {
|
|
43
|
+
handler: unknown;
|
|
44
|
+
run: (options?: TOpt, context?: ArchitectBuilderContextLike) => Promise<TOut>;
|
|
45
|
+
[key: symbol]: unknown;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function createArchitectBuilder<TOpt, TOut>(
|
|
49
|
+
handlerFn: (options?: TOpt, context?: ArchitectBuilderContextLike) => Promise<TOut>,
|
|
50
|
+
): ArchitectBuilderObject<TOpt, TOut>;
|
|
51
|
+
|
|
52
|
+
export function runNativeApplicationBuilder(
|
|
53
|
+
options?: NativeApplicationBuilderOptions,
|
|
54
|
+
context?: ArchitectBuilderContextLike,
|
|
55
|
+
): Promise<NativeApplicationBuilderOutput>;
|
|
56
|
+
|
|
57
|
+
export const applicationBuilder: ArchitectBuilderObject<
|
|
58
|
+
NativeApplicationBuilderOptions,
|
|
59
|
+
NativeApplicationBuilderOutput
|
|
60
|
+
>;
|
|
61
|
+
|
|
62
|
+
export default applicationBuilder;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { compileBundle } from './build-bundle.mjs';
|
|
3
|
+
|
|
4
|
+
export const ARCHITECT_BUILDER_SYMBOL = Symbol.for('@angular-devkit/architect:builder');
|
|
5
|
+
export const ARCHITECT_VERSION_SYMBOL = Symbol.for('@angular-devkit/architect:builder-version');
|
|
6
|
+
|
|
7
|
+
export function createArchitectBuilder(handlerFn) {
|
|
8
|
+
let builderObj = null;
|
|
9
|
+
try {
|
|
10
|
+
const req = createRequire(import.meta.url);
|
|
11
|
+
const architect = req('@angular-devkit/architect');
|
|
12
|
+
if (typeof architect?.createBuilder === 'function') {
|
|
13
|
+
builderObj = architect.createBuilder(handlerFn);
|
|
14
|
+
}
|
|
15
|
+
} catch {
|
|
16
|
+
// Fallback below if @angular-devkit/architect is not installed in minimal environments
|
|
17
|
+
}
|
|
18
|
+
if (!builderObj) {
|
|
19
|
+
builderObj = {
|
|
20
|
+
handler: handlerFn,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
builderObj[ARCHITECT_BUILDER_SYMBOL] = true;
|
|
24
|
+
builderObj[ARCHITECT_VERSION_SYMBOL] = builderObj[ARCHITECT_VERSION_SYMBOL] ?? '0.4.0';
|
|
25
|
+
builderObj.run = handlerFn;
|
|
26
|
+
return builderObj;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function runNativeApplicationBuilder(options = {}, context = {}) {
|
|
30
|
+
const workspaceRoot = context?.workspaceRoot || options?.cwd || process.cwd();
|
|
31
|
+
const projectName = context?.target?.project || options?.projectName;
|
|
32
|
+
const compiled = compileBundle({
|
|
33
|
+
cwd: workspaceRoot,
|
|
34
|
+
configPath: options?.configPath,
|
|
35
|
+
projectName,
|
|
36
|
+
version: options?.version,
|
|
37
|
+
rebuildIcons: options?.rebuildIcons ?? true,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
context?.logger?.info?.(
|
|
41
|
+
`[NgDesktop Architect] Built ${compiled.projectName} v${compiled.version} -> ${compiled.bundleFile}`,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
success: true,
|
|
46
|
+
projectName: compiled.projectName,
|
|
47
|
+
version: compiled.version,
|
|
48
|
+
bundleFile: compiled.bundleFile,
|
|
49
|
+
...(compiled.entryBundleFile ? { entryBundleFile: compiled.entryBundleFile } : {}),
|
|
50
|
+
...(compiled.serverBundleFile ? { serverBundleFile: compiled.serverBundleFile } : {}),
|
|
51
|
+
permissionsFile: compiled.permissionsFile,
|
|
52
|
+
runtimeConfigFile: compiled.runtimeConfigFile,
|
|
53
|
+
hmrDelta: compiled.hmrDelta,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const applicationBuilder = createArchitectBuilder(runNativeApplicationBuilder);
|
|
58
|
+
export default applicationBuilder;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface ComponentDecoratorMeta {
|
|
2
|
+
selector: string;
|
|
3
|
+
templateUrl: string;
|
|
4
|
+
styleUrl: string;
|
|
5
|
+
imports: string[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface MethodMutationMeta {
|
|
9
|
+
kind: 'set' | 'add';
|
|
10
|
+
signalName: string;
|
|
11
|
+
value: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SignalInputOrModelMeta {
|
|
15
|
+
required: boolean;
|
|
16
|
+
defaultValue: unknown;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ResourceMetadata {
|
|
20
|
+
kind: 'httpResource';
|
|
21
|
+
url: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ExtractedComponentMetadata {
|
|
25
|
+
state: Record<string, unknown>;
|
|
26
|
+
numericSignals: Record<string, number>;
|
|
27
|
+
computedSignals: Record<string, unknown>;
|
|
28
|
+
inputs: Record<string, SignalInputOrModelMeta>;
|
|
29
|
+
models: Record<string, SignalInputOrModelMeta>;
|
|
30
|
+
outputs: Record<string, boolean>;
|
|
31
|
+
resources: Record<string, ResourceMetadata>;
|
|
32
|
+
methods: Record<string, MethodMutationMeta>;
|
|
33
|
+
component: ComponentDecoratorMeta;
|
|
34
|
+
relativeImports: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function extractComponentMetadata(
|
|
38
|
+
tsSource: string,
|
|
39
|
+
filename?: string,
|
|
40
|
+
): ExtractedComponentMetadata;
|