@blotch/rsbuild-plugin-angular-lynx 0.0.0-stage → 22.2.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.
Files changed (76) hide show
  1. package/README.md +37 -2
  2. package/dist/angular-rebuild-coordinator.d.ts +70 -0
  3. package/dist/angular-rebuild-coordinator.test.d.ts +1 -0
  4. package/dist/angular-webpack-plugin.d.ts +127 -0
  5. package/dist/angular-webpack-plugin.test.d.ts +1 -0
  6. package/dist/angular.d.ts +31 -0
  7. package/dist/build-schema-source-file-cache.d.ts +20 -0
  8. package/dist/build-schema-source-file-cache.test.d.ts +1 -0
  9. package/dist/component-styles-cache.d.ts +43 -0
  10. package/dist/component-styles-cache.test.d.ts +1 -0
  11. package/dist/css.d.ts +13 -0
  12. package/dist/css.test.d.ts +1 -0
  13. package/dist/entry.d.ts +11 -0
  14. package/dist/entry.test.d.ts +1 -0
  15. package/dist/generator.d.ts +2 -0
  16. package/dist/generator.test.d.ts +1 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +1510 -0
  19. package/dist/index.js.LICENSE.txt +7 -0
  20. package/dist/is-lynx-unknown-element-message.d.ts +12 -0
  21. package/dist/is-lynx-unknown-element-message.test.d.ts +1 -0
  22. package/dist/layers.d.ts +12 -0
  23. package/dist/layers.test.d.ts +1 -0
  24. package/dist/loaders/ignore-css-loader.d.ts +7 -0
  25. package/dist/loaders/ignore-css-loader.js +7 -0
  26. package/dist/loaders/ignore-css-loader.test.d.ts +1 -0
  27. package/dist/loaders/thread-globals-loader.d.ts +8 -0
  28. package/dist/loaders/thread-globals-loader.js +6 -0
  29. package/dist/loaders/thread-globals-loader.test.d.ts +1 -0
  30. package/dist/logger/dev-logger-middleware.d.ts +12 -0
  31. package/dist/logger/dev-logger-middleware.test.d.ts +1 -0
  32. package/dist/logger/dev-logger.d.ts +2 -0
  33. package/dist/logger/dev-logger.test.d.ts +1 -0
  34. package/dist/lynx-diagnostics.d.ts +38 -0
  35. package/dist/lynx-diagnostics.test.d.ts +1 -0
  36. package/dist/lynx-process-eval-result-runtime-module.d.ts +21 -0
  37. package/dist/lynx-process-eval-result-runtime-module.test.d.ts +1 -0
  38. package/dist/plugin-angular-lynx.d.ts +3 -0
  39. package/dist/plugin-angular-lynx.test.d.ts +1 -0
  40. package/dist/polyfills.js +122 -0
  41. package/dist/seed-compilation-source-files.d.ts +22 -0
  42. package/dist/seed-compilation-source-files.test.d.ts +1 -0
  43. package/dist/split-chunks.d.ts +3 -0
  44. package/dist/split-chunks.test.d.ts +1 -0
  45. package/dist/tailwind.d.ts +2 -0
  46. package/dist/tailwind.test.d.ts +1 -0
  47. package/dist/transform-module.d.ts +31 -0
  48. package/dist/transform-module.test.d.ts +1 -0
  49. package/dist/utils/angular/angular-config.d.ts +3 -0
  50. package/dist/utils/angular/angular-config.test.d.ts +1 -0
  51. package/dist/utils/angular/component-scope-id.d.ts +12 -0
  52. package/dist/utils/angular/component-scope-id.test.d.ts +1 -0
  53. package/dist/utils/angular/component-style-bundler.d.ts +19 -0
  54. package/dist/utils/angular/component-style-bundler.test.d.ts +1 -0
  55. package/dist/utils/angular/env.d.ts +2 -0
  56. package/dist/utils/angular/env.test.d.ts +1 -0
  57. package/dist/utils/angular/find-up.d.ts +8 -0
  58. package/dist/utils/angular/find-up.test.d.ts +1 -0
  59. package/dist/utils/angular/normalize-cache.d.ts +22 -0
  60. package/dist/utils/angular/normalize-cache.test.d.ts +1 -0
  61. package/dist/utils/angular/options.d.ts +82 -0
  62. package/dist/utils/angular/options.test.d.ts +1 -0
  63. package/dist/utils/angular/read-workspace.d.ts +7 -0
  64. package/dist/utils/angular/read-workspace.test.d.ts +1 -0
  65. package/dist/utils/angular/resolve-pages.d.ts +13 -0
  66. package/dist/utils/angular/resolve-pages.test.d.ts +1 -0
  67. package/dist/utils/inject-lynx-schema.d.ts +10 -0
  68. package/dist/utils/inject-lynx-schema.test.d.ts +1 -0
  69. package/dist/utils/options.d.ts +31 -0
  70. package/dist/utils/options.test.d.ts +1 -0
  71. package/dist/utils/strip-template-whitespace.d.ts +34 -0
  72. package/dist/utils/strip-template-whitespace.test.d.ts +1 -0
  73. package/dist/worklet-transform.d.ts +7 -0
  74. package/dist/worklet-transform.test.d.ts +1 -0
  75. package/package.json +73 -4
  76. package/patch/patch-angular-build.cjs +27 -0
@@ -0,0 +1,31 @@
1
+ export type PluginAngularLynxOptions = {
2
+ customCSSInheritanceList?: string[] | undefined;
3
+ debugInfoOutside?: boolean;
4
+ defaultDisplayLinear?: boolean;
5
+ defaultOverflowVisible?: boolean;
6
+ enableA11y?: boolean;
7
+ enableAccessibilityElement?: boolean;
8
+ enableCSSInheritance?: boolean;
9
+ enableCSSInvalidation?: boolean;
10
+ enableCSSSelector?: boolean;
11
+ enableICU?: boolean;
12
+ enableNewGesture?: boolean;
13
+ enableParallelElement?: boolean;
14
+ enableRemoveCSSScope?: boolean;
15
+ enableSSR?: boolean;
16
+ /**
17
+ * Build multiple angular.json projects as separate Lynx pages.
18
+ * Each project's `browser` field becomes a named entry producing its own .lynx.bundle.
19
+ *
20
+ * - `string[]` — list of angular.json project names to build
21
+ * - `'all'` — build all `application`-type projects in the workspace
22
+ *
23
+ * When omitted, uses `source.entry` from lynx.config.ts (single or multi-entry).
24
+ */
25
+ pages?: string[] | 'all' | undefined;
26
+ pipelineSchedulerConfig?: number;
27
+ removeDescendantSelectorScope?: boolean;
28
+ targetSdkVersion?: string;
29
+ experimental_isLazyBundle?: boolean;
30
+ };
31
+ export declare const normalizeOptions: (options?: Partial<PluginAngularLynxOptions>) => Required<PluginAngularLynxOptions>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Strips leading and trailing newline-induced whitespace from single-line text
3
+ * nodes in Angular component templates.
4
+ *
5
+ * Angular's template compiler (`preserveWhitespaces: false`, the default)
6
+ * condenses consecutive whitespace but does NOT strip the edge spaces produced
7
+ * by template indentation. A block-level text element written naturally:
8
+ *
9
+ * <text class="...">
10
+ * The Quick Brown Fox
11
+ * </text>
12
+ *
13
+ * compiles to `ɵɵtext(1, " The Quick Brown Fox ")` — the newlines become
14
+ * single spaces. Lynx has no HTML whitespace-collapsing model, so those edge
15
+ * spaces render literally, producing a visible leading/trailing indent.
16
+ *
17
+ * This transform runs on the raw template source BEFORE Angular's compiler sees
18
+ * it (in `buildLynxSchemaSourceFileCache`), so the compiler receives:
19
+ *
20
+ * <text class="...">The Quick Brown Fox</text>
21
+ *
22
+ * and emits `ɵɵtext(1, "The Quick Brown Fox")` — clean, no extra spaces.
23
+ *
24
+ * Why this is safe for inline text:
25
+ * <text>Hello <text style="color:red">world</text> again</text>
26
+ *
27
+ * The text nodes "Hello " and " again" sit on the SAME line as their sibling
28
+ * elements — no surrounding newlines — so the regex never matches them and their
29
+ * inter-word spaces are preserved.
30
+ *
31
+ * Limitation: external templates (`templateUrl`) are read by Angular's compiler
32
+ * host directly from disk and are not reachable from this transform path.
33
+ */
34
+ export declare const stripTemplateWhitespace: (source: string) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Detects functions with a `"main thread"` directive and wraps them with
3
+ * `mainThreadFn()` at build time. This matches React Lynx's worklet directive
4
+ * pattern — users write a string directive as the first statement, and the
5
+ * build transform handles registration.
6
+ */
7
+ export declare const transformWorklets: (code: string, filename: string) => string;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,75 @@
1
1
  {
2
2
  "name": "@blotch/rsbuild-plugin-angular-lynx",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "22.2.0",
4
+ "description": "Rsbuild plugin for building AngularLynx applications",
5
+ "homepage": "https://github.com/Blotch-Smart-Frames/AngularLynx#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/Blotch-Smart-Frames/AngularLynx/issues"
8
+ },
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/Blotch-Smart-Frames/AngularLynx.git",
13
+ "directory": "packages/rsbuild-plugin-angular-lynx"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "patch"
18
+ ],
19
+ "type": "module",
20
+ "module": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js"
26
+ }
27
+ },
28
+ "scripts": {
29
+ "build": "rslib build",
30
+ "dev": "rslib build --watch",
31
+ "test": "vitest run",
32
+ "test:coverage": "vitest run --coverage",
33
+ "test:ci:coverage": "vitest run --coverage",
34
+ "test:ui": "vitest --ui --coverage.enabled=true",
35
+ "lint": "oxlint .",
36
+ "lint:fix": "oxlint --fix .",
37
+ "format": "oxfmt --write .",
38
+ "format:check": "oxfmt --check .",
39
+ "cspell": "cspell .",
40
+ "postinstall": "node ./patch/patch-angular-build.cjs",
41
+ "publish:local": "yalc publish --push"
42
+ },
43
+ "dependencies": {
44
+ "@lynx-js/css-extract-webpack-plugin": "^0.11.0",
45
+ "@lynx-js/rsbuild-plugin": "^0.1.3",
46
+ "@lynx-js/runtime-wrapper-webpack-plugin": "^0.2.4",
47
+ "@lynx-js/template-webpack-plugin": "^0.16.2",
48
+ "@lynx-js/webpack-runtime-globals": "^0.0.8",
49
+ "rsbuild-plugin-tailwindcss": "0.2.4",
50
+ "tiny-invariant": "^1.3.3"
51
+ },
52
+ "devDependencies": {
53
+ "@angular-devkit/build-angular": "^22.2.2",
54
+ "@angular-devkit/core": "^22.2.2",
55
+ "@angular/build": "^22.2.2",
56
+ "@rsbuild/core": "^2.2.9",
57
+ "@rslib/core": "^0.21.4",
58
+ "@rspack/core": "^2.2.8",
59
+ "@types/node": "^25.6.2",
60
+ "type-fest": "^5.6.0",
61
+ "typescript": "^6.0.3"
62
+ },
63
+ "peerDependencies": {
64
+ "@angular-devkit/build-angular": "^22.2.0",
65
+ "@angular-devkit/core": "^22.2.0",
66
+ "@angular/build": "^22.2.0",
67
+ "@angular/localize": "^22.2.0",
68
+ "@lynx-js/rspeedy": "^0.18.0"
69
+ },
70
+ "peerDependenciesMeta": {
71
+ "@angular/localize": {
72
+ "optional": true
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,27 @@
1
+ const { readFileSync, writeFileSync } = require('node:fs');
2
+
3
+ const main = () => {
4
+ const angularBuildPackageJson =
5
+ require.resolve('@angular/build/package.json');
6
+ const fileContentsJson = JSON.parse(
7
+ readFileSync(angularBuildPackageJson, 'utf8'),
8
+ );
9
+ // Angular 22.2 moved the transformer out of `src/tools/esbuild/`.
10
+ fileContentsJson.exports['./src/tools/javascript-transformer'] =
11
+ './src/tools/javascript-transformer/index.js';
12
+ fileContentsJson.exports['./src/tools/angular/compilation'] =
13
+ './src/tools/angular/compilation/index.js';
14
+ fileContentsJson.exports[
15
+ './src/tools/esbuild/angular/file-reference-tracker'
16
+ ] = './src/tools/esbuild/angular/file-reference-tracker.js';
17
+ fileContentsJson.exports[
18
+ './src/tools/esbuild/angular/component-stylesheets'
19
+ ] = './src/tools/esbuild/angular/component-stylesheets.js';
20
+
21
+ writeFileSync(
22
+ angularBuildPackageJson,
23
+ JSON.stringify(fileContentsJson, null, 2),
24
+ );
25
+ };
26
+
27
+ main();