@ng-desktop/builders 0.3.0 → 0.4.1

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.
@@ -414,6 +414,73 @@ function makeCommentNode(idState, prefix, text) {
414
414
  };
415
415
  }
416
416
 
417
+ const HTML_TO_NATIVE_TAG = {
418
+ div: 'ng-box',
419
+ section: 'ng-box',
420
+ main: 'ng-box',
421
+ article: 'ng-box',
422
+ aside: 'ng-box',
423
+ nav: 'ng-box',
424
+ header: 'ng-box',
425
+ footer: 'ng-box',
426
+ form: 'ng-box',
427
+ ul: 'ng-box',
428
+ ol: 'ng-box',
429
+ li: 'ng-box',
430
+ figure: 'ng-box',
431
+ figcaption: 'ng-box',
432
+ p: 'ng-label',
433
+ span: 'ng-label',
434
+ label: 'ng-label',
435
+ h1: 'ng-label',
436
+ h2: 'ng-label',
437
+ h3: 'ng-label',
438
+ h4: 'ng-label',
439
+ h5: 'ng-label',
440
+ h6: 'ng-label',
441
+ strong: 'ng-label',
442
+ em: 'ng-label',
443
+ small: 'ng-label',
444
+ code: 'ng-label',
445
+ pre: 'ng-label',
446
+ a: 'ng-label',
447
+ button: 'ng-button',
448
+ img: 'ng-image',
449
+ hr: 'ng-separator',
450
+ input: 'ng-entry',
451
+ textarea: 'ng-text-view',
452
+ select: 'ng-select',
453
+ progress: 'ng-progress-bar',
454
+ details: 'ng-expander',
455
+ dialog: 'ng-dialog',
456
+ };
457
+
458
+ function resolveNativeHtmlTag(tagName, attrs) {
459
+ const lower = String(tagName || '')
460
+ .trim()
461
+ .toLowerCase();
462
+ if (lower === 'input') {
463
+ const inputType = String(attrs?.type || '')
464
+ .trim()
465
+ .toLowerCase();
466
+ switch (inputType) {
467
+ case 'search':
468
+ return 'ng-search-entry';
469
+ case 'password':
470
+ return 'ng-password-entry';
471
+ case 'checkbox':
472
+ return 'ng-checkbox';
473
+ case 'range':
474
+ return 'ng-slider';
475
+ case 'number':
476
+ return 'ng-spin-button';
477
+ default:
478
+ return 'ng-entry';
479
+ }
480
+ }
481
+ return HTML_TO_NATIVE_TAG[lower] || tagName;
482
+ }
483
+
417
484
  function isControlOrElementChild(child) {
418
485
  return (
419
486
  typeof child.name === 'string' ||
@@ -472,6 +539,21 @@ export function parseTemplateHtml(
472
539
  continue;
473
540
  }
474
541
 
542
+ if (tmplNode.name === 'ng-container') {
543
+ if (Array.isArray(tmplNode.children) && tmplNode.children.length > 0) {
544
+ out.push(...transformNodes(tmplNode.children, scopeState));
545
+ }
546
+ continue;
547
+ }
548
+
549
+ if (tmplNode.name === 'router-outlet') {
550
+ out.push(makeCommentNode(idState, 'outlet', 'router-outlet'));
551
+ if (Array.isArray(tmplNode.children) && tmplNode.children.length > 0) {
552
+ out.push(...transformNodes(tmplNode.children, scopeState));
553
+ }
554
+ continue;
555
+ }
556
+
475
557
  if (Array.isArray(tmplNode.branches)) {
476
558
  const firstExpr = tmplNode.branches[0]?.expression?.source?.trim() || 'cond';
477
559
  out.push(makeCommentNode(idState, 'anchor', `@if(${firstExpr})`));
@@ -790,7 +872,7 @@ export function parseTemplateHtml(
790
872
 
791
873
  out.push({
792
874
  id: attrs.id || `node_${idState.next++}`,
793
- tag: tmplNode.name,
875
+ tag: resolveNativeHtmlTag(tmplNode.name, attrs),
794
876
  title: attrs.title || null,
795
877
  classes: attrs.class ? attrs.class.split(/\s+/).filter(Boolean) : [],
796
878
  attributes: customAttrs,
@@ -26,7 +26,7 @@ function readPackageVersion(workspaceRoot, projectRoot) {
26
26
  }
27
27
  }
28
28
  }
29
- return '0.3.0';
29
+ return '0.4.1';
30
30
  }
31
31
 
32
32
  function findNxProjectJsonFiles(workspaceRoot) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-desktop/builders",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Angular 22+ CLI & Nx Architect builder, AST permission analyzer, CLI, and schematics",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -34,7 +34,8 @@
34
34
  "schema",
35
35
  "schematics",
36
36
  "README.md",
37
- "LICENSE"
37
+ "LICENSE",
38
+ "!**/*.map"
38
39
  ],
39
40
  "main": "./fesm2022/index.js",
40
41
  "module": "./fesm2022/index.js",
@@ -71,10 +72,10 @@
71
72
  "postcss": ">=8.5.0"
72
73
  },
73
74
  "optionalDependencies": {
74
- "@ng-desktop/engine-linux-x64-gnu": "0.3.0",
75
- "@ng-desktop/engine-linux-arm64-gnu": "0.3.0",
76
- "@ng-desktop/engine-win32-x64-msvc": "0.3.0",
77
- "@ng-desktop/engine-darwin-arm64": "0.3.0",
78
- "@ng-desktop/engine-darwin-x64": "0.3.0"
75
+ "@ng-desktop/engine-linux-x64-gnu": "0.4.1",
76
+ "@ng-desktop/engine-linux-arm64-gnu": "0.4.1",
77
+ "@ng-desktop/engine-win32-x64-msvc": "0.4.1",
78
+ "@ng-desktop/engine-darwin-arm64": "0.4.1",
79
+ "@ng-desktop/engine-darwin-x64": "0.4.1"
79
80
  }
80
81
  }
@@ -39,6 +39,24 @@
39
39
  "type": "string",
40
40
  "description": "Optional main entrypoint override (inherited from architect.build.options.browser)."
41
41
  },
42
+ "projectName": {
43
+ "type": "string",
44
+ "description": "Target workspace project name when invoked outside an explicit Architect target."
45
+ },
46
+ "configPath": {
47
+ "type": "string",
48
+ "description": "Optional path to angular.json or project.json."
49
+ },
50
+ "rebuildIcons": {
51
+ "type": "boolean",
52
+ "default": true,
53
+ "description": "Whether to regenerate multi-resolution OS application icons during compilation."
54
+ },
55
+ "watch": {
56
+ "type": "boolean",
57
+ "default": false,
58
+ "description": "Watch source files and push incremental HMR updates over IPC when running dev-server."
59
+ },
42
60
  "version": {
43
61
  "type": "string",
44
62
  "description": "Application release version propagated to runtime config and OS installers."
@@ -9,9 +9,9 @@ export function applyNgAddToTree(tree, options = {}) {
9
9
  const pkgRaw = tree.read('/package.json')?.toString('utf8') ?? '{}';
10
10
  const pkg = JSON.parse(pkgRaw);
11
11
  pkg.dependencies ??= {};
12
- pkg.dependencies['@ng-desktop/platform'] ??= '>=0.3.0';
12
+ pkg.dependencies['@ng-desktop/platform'] ??= '>=0.4.0';
13
13
  pkg.devDependencies ??= {};
14
- pkg.devDependencies['@ng-desktop/builders'] ??= '>=0.3.0';
14
+ pkg.devDependencies['@ng-desktop/builders'] ??= '>=0.4.0';
15
15
  tree.overwrite('/package.json', `${JSON.stringify(pkg, null, 2)}\n`);
16
16
  }
17
17
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../packages/builders-native/src/builder.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AACzE,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,CAAC;AACnF,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,SAAS,CAAC;AACnD,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;AACjF,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAChE,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,IAAI,CAAC,EAAE,cAAc,CAAC;IACt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AAC,IAAI;QACnB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,UAAU,EAAE,GAAG,QAAQ,CAAC,UAAU,WAAW;QAC7C,uBAAuB,EAAE,GAAG,QAAQ,CAAC,UAAU,4BAA4B;QAC3E,iBAAiB,EAAE,GAAG,QAAQ,CAAC,UAAU,0BAA0B;QACnE,gBAAgB;KACjB,CAAC;AACJ,CAAC","sourcesContent":["export type NativeOsKind = 'auto' | 'linux' | 'windows' | 'macos';\nexport type NativeArchKind = 'auto' | 'x86_64' | 'aarch64' | 'universal';\nexport type NativeCpuProfile = 'auto' | 'native' | 'baseline' | 'avx2' | 'neon';\nexport type NativePlatformTarget = 'linux-gtk4' | 'windows-winui' | 'macos-appkit';\nexport type NativeJsEngineKind = 'jsc' | 'quickjs';\nexport type NativePackageFormat = 'deb' | 'appimage' | 'flatpak' | 'msi' | 'dmg';\nexport type LinuxPackageFormat = 'deb' | 'appimage' | 'flatpak';\nexport type NativePermissionsMode = 'auto' | 'strict';\n\nexport interface NativePermissionsOptions {\n mode?: NativePermissionsMode;\n allow?: string[];\n deny?: string[];\n}\n\nexport interface NativeBuilderOptions {\n os?: NativeOsKind;\n arch?: NativeArchKind;\n cpu?: NativeCpuProfile;\n targetPlatform?: NativePlatformTarget;\n jsEngine?: NativeJsEngineKind;\n outputPath?: string;\n version?: string;\n permissions?: NativePermissionsOptions;\n packageFormats?: NativePackageFormat[];\n}\n\nexport interface ResolvedNativeBuilderConfig {\n os: 'linux' | 'windows' | 'macos';\n arch: 'x86_64' | 'aarch64' | 'universal';\n cpu: NativeCpuProfile;\n targetPlatform: NativePlatformTarget;\n jsEngine: NativeJsEngineKind;\n outputPath: string;\n rustTargetTriple: string;\n packageFormats: NativePackageFormat[];\n}\n\nexport interface NativeBuilderResult {\n success: boolean;\n projectName: string;\n os: 'linux' | 'windows' | 'macos';\n arch: 'x86_64' | 'aarch64' | 'universal';\n cpu: NativeCpuProfile;\n rustTargetTriple: string;\n targetPlatform: NativePlatformTarget;\n jsEngine: NativeJsEngineKind;\n bundlePath: string;\n permissionsManifestPath: string;\n runtimeConfigPath: string;\n packageArtifacts: string[];\n}\n\nfunction detectHostOs(): 'linux' | 'windows' | 'macos' {\n if (typeof process !== 'undefined') {\n if (process.platform === 'win32') return 'windows';\n if (process.platform === 'darwin') return 'macos';\n }\n return 'linux';\n}\n\nfunction detectHostArch(): 'x86_64' | 'aarch64' {\n if (typeof process !== 'undefined' && process.arch === 'arm64') {\n return 'aarch64';\n }\n return 'x86_64';\n}\n\nfunction resolveTargetTriple(\n os: 'linux' | 'windows' | 'macos',\n arch: 'x86_64' | 'aarch64' | 'universal',\n): string {\n if (os === 'windows') {\n return arch === 'aarch64' ? 'aarch64-pc-windows-msvc' : 'x86_64-pc-windows-msvc';\n }\n if (os === 'macos') {\n if (arch === 'universal') return 'universal-apple-darwin';\n return arch === 'x86_64' ? 'x86_64-apple-darwin' : 'aarch64-apple-darwin';\n }\n return arch === 'aarch64' ? 'aarch64-unknown-linux-gnu' : 'x86_64-unknown-linux-gnu';\n}\n\n/**\n * Resolves minimal `angular.json` options (`os`, `arch`, `cpu`) into full target platform,\n * embedded JS engine, Rust target triple, and output directory defaults.\n */\nexport function resolveNativeBuilderConfig(\n projectName: string,\n options: NativeBuilderOptions = {},\n): ResolvedNativeBuilderConfig {\n let os: 'linux' | 'windows' | 'macos';\n if (options.os && options.os !== 'auto') {\n os = options.os;\n } else if (options.targetPlatform === 'windows-winui') {\n os = 'windows';\n } else if (options.targetPlatform === 'macos-appkit') {\n os = 'macos';\n } else if (options.targetPlatform === 'linux-gtk4') {\n os = 'linux';\n } else {\n os = detectHostOs();\n }\n\n const targetPlatform: NativePlatformTarget =\n options.targetPlatform ??\n (os === 'windows' ? 'windows-winui' : os === 'macos' ? 'macos-appkit' : 'linux-gtk4');\n\n const jsEngine: NativeJsEngineKind = options.jsEngine ?? (os === 'windows' ? 'quickjs' : 'jsc');\n\n const arch: 'x86_64' | 'aarch64' | 'universal' =\n options.arch && options.arch !== 'auto' ? options.arch : detectHostArch();\n\n const cpu: NativeCpuProfile = options.cpu ?? 'auto';\n const outputPath = (options.outputPath ?? `dist/${projectName}`).replace(/\\/+$/, '');\n const defaultFormats: NativePackageFormat[] =\n os === 'linux' ? ['deb', 'appimage', 'flatpak'] : os === 'windows' ? ['msi'] : ['dmg'];\n\n return {\n os,\n arch,\n cpu,\n targetPlatform,\n jsEngine,\n outputPath,\n rustTargetTriple: resolveTargetTriple(os, arch),\n packageFormats: options.packageFormats ?? defaultFormats,\n };\n}\n\n/**\n * Generates an `angular.json` `architect.native` target configuration block\n * for `@ng-desktop/builders:application`.\n */\nexport function createNativeTargetConfig(options: NativeBuilderOptions): {\n builder: '@ng-desktop/builders:application';\n options: NativeBuilderOptions;\n} {\n return {\n builder: '@ng-desktop/builders:application',\n options: {\n os: options.os ?? 'linux',\n arch: options.arch ?? 'x86_64',\n ...(options.cpu ? { cpu: options.cpu } : {}),\n ...(options.targetPlatform ? { targetPlatform: options.targetPlatform } : {}),\n ...(options.jsEngine ? { jsEngine: options.jsEngine } : {}),\n ...(options.outputPath ? { outputPath: options.outputPath } : {}),\n ...(options.packageFormats ? { packageFormats: options.packageFormats } : {}),\n },\n };\n}\n\n/**\n * Executes the Angular 22 Native Builder pipeline, resolving minimal OS/CPU config,\n * `.ngb` bundle path, and target distribution artifacts.\n */\nexport function executeNativeBuilder(\n projectName: string,\n options: NativeBuilderOptions,\n): NativeBuilderResult {\n const resolved = resolveNativeBuilderConfig(projectName, options);\n const packageArtifacts: string[] = [];\n\n for (const fmt of resolved.packageFormats) {\n if (fmt === 'deb') {\n packageArtifacts.push(`${resolved.outputPath}/packages/deb/DEBIAN/control`);\n packageArtifacts.push(\n `${resolved.outputPath}/packages/deb/usr/share/applications/${projectName}.desktop`,\n );\n } else if (fmt === 'appimage') {\n packageArtifacts.push(`${resolved.outputPath}/packages/appimage/AppRun`);\n } else if (fmt === 'flatpak') {\n packageArtifacts.push(`${resolved.outputPath}/packages/flatpak/${projectName}.yml`);\n } else if (fmt === 'msi') {\n packageArtifacts.push(`${resolved.outputPath}/packages/windows/${projectName}.msi`);\n } else if (fmt === 'dmg') {\n packageArtifacts.push(`${resolved.outputPath}/packages/macos/${projectName}.dmg`);\n }\n }\n\n return {\n success: true,\n projectName,\n os: resolved.os,\n arch: resolved.arch,\n cpu: resolved.cpu,\n rustTargetTriple: resolved.rustTargetTriple,\n targetPlatform: resolved.targetPlatform,\n jsEngine: resolved.jsEngine,\n bundlePath: `${resolved.outputPath}/main.ngb`,\n permissionsManifestPath: `${resolved.outputPath}/permissions.manifest.json`,\n runtimeConfigPath: `${resolved.outputPath}/ng-desktop.runtime.json`,\n packageArtifacts,\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/builders-native/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,aAAa,EACb,aAAa,EACb,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,aAAa,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,GACjC,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,cAAc,EACd,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/builders-native/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAIzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,aAAa,EACb,aAAa,EACb,WAAW,GAGZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GAMzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,GAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GAKxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,GAa3B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,cAAc,GAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAoB,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAKlB,MAAM,yBAAyB,CAAC","sourcesContent":["export {\n extractComponentMetadata,\n type ComponentDecoratorMeta,\n type ExtractedComponentMetadata,\n type MethodMutationMeta,\n} from './ast-metadata-extractor.mjs';\nexport {\n compileBundle,\n emitNgbBundle,\n watchBundle,\n type CompileBundleOptions,\n type CompileBundleResult,\n} from './build-bundle.mjs';\nexport {\n analyzeProjectPermissions,\n analyzeSourcePermissions,\n type NativeCapabilitiesObject,\n type PermissionAnalysisManifest,\n type PermissionEvidence,\n type PermissionPolicyMode,\n type PermissionsPolicyConfig,\n} from './permission-analyzer.mjs';\nexport {\n resolveWorkspaceProject,\n type ResolvedWorkspaceProject,\n type ResolveWorkspaceOptions,\n type WorkspaceKind,\n} from './workspace-resolver.mjs';\nexport {\n ENGINE_BINARY_PACKAGES,\n resolveEngineBinaryPath,\n type EngineBinaryPackageMeta,\n type EngineBinaryResolution,\n type EngineBinarySource,\n type ResolveEngineBinaryOptions,\n} from './resolve-engine-binary.mjs';\nexport {\n createNativeTargetConfig,\n executeNativeBuilder,\n resolveNativeBuilderConfig,\n type LinuxPackageFormat,\n type NativeArchKind,\n type NativeBuilderOptions,\n type NativeBuilderResult,\n type NativeCpuProfile,\n type NativeJsEngineKind,\n type NativeOsKind,\n type NativePackageFormat,\n type NativePermissionsMode,\n type NativePermissionsOptions,\n type NativePlatformTarget,\n type ResolvedNativeBuilderConfig,\n} from './builder';\nexport {\n pingHmr,\n pushHmrEval,\n pushHmrReload,\n sendHmrMessage,\n type HmrClientResult,\n} from './hmr-client.mjs';\nexport { buildMultiResolutionIcons } from './icon-compiler.mjs';\nexport { emitStyleInstruction, parseStylesCss, type StyleRuleIr } from './style-compiler.mjs';\nexport {\n applyPipeTransform,\n parseTemplateHtml,\n type ComponentDefinitionIr,\n type ReactiveBindingIr,\n type TemplateAstNode,\n type TemplateIdState,\n} from './template-compiler.mjs';\n"]}