From 46652fe88b8ac7d0daf180022eb04c0154dff4e9 Mon Sep 17 00:00:00 2001 From: Snider Date: Thu, 23 Jul 2026 18:57:13 +0100 Subject: [PATCH] feat(display/webkit): latest Wails v3 + new adapter features; drop node_modules.bak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps Wails to the latest v3 and wires new capabilities into the adapter layer (WebView2 options, window CSS/state/screen/devtools/themes, macOS backdrop/shadow/Liquid Glass, rich notifications, OS-wide GlobalShortcut keybindings) — consumers still never import wails directly. Also removes the accidentally-committed ui/node_modules.bak backup (508 files) and gitignores node_modules. Builds GOWORK=off (cgo/Wails). Co-Authored-By: Virgil --- go/display/webkit/.gitignore | 2 + go/display/webkit/pkg/keybinding/wails.go | 83 +- .../webkit/pkg/notification/messages.go | 1 + .../webkit/pkg/notification/platform.go | 38 +- go/display/webkit/pkg/notification/service.go | 55 +- .../notification/service_behaviour_test.go | 23 + .../webkit/pkg/notification/service_test.go | 55 + go/display/webkit/pkg/notification/wails.go | 98 +- go/display/webkit/pkg/window/platform.go | 16 + go/display/webkit/pkg/window/service.go | 14 +- go/display/webkit/pkg/window/wails.go | 93 +- go/display/webkit/pkg/window/window.go | 74 +- go/display/webkit/pkg/window/window_test.go | 53 + go/display/webkit/service.go | 20 +- go/display/webkit/service_test.go | 28 + .../@angular/build/.browserslistrc | 7 - .../node_modules.bak/@angular/build/LICENSE | 21 - .../node_modules.bak/@angular/build/README.md | 5 - .../@angular/build/builders.json | 34 - .../@angular/build/index.d.ts | 8 - .../node_modules.bak/@angular/build/index.js | 24 - .../@angular/build/package.json | 127 -- .../@angular/build/private/index.d.ts | 8 - .../@angular/build/private/index.js | 24 - .../builders/application/build-action.d.ts | 29 - .../src/builders/application/build-action.js | 354 ---- .../builders/application/chunk-optimizer.d.ts | 21 - .../builders/application/chunk-optimizer.js | 277 --- .../builders/application/execute-build.d.ts | 11 - .../src/builders/application/execute-build.js | 249 --- .../application/execute-post-bundle.d.ts | 27 - .../application/execute-post-bundle.js | 135 -- .../build/src/builders/application/i18n.d.ts | 31 - .../build/src/builders/application/i18n.js | 137 -- .../build/src/builders/application/index.d.ts | 32 - .../build/src/builders/application/index.js | 252 --- .../src/builders/application/options.d.ts | 210 --- .../build/src/builders/application/options.js | 490 ------ .../src/builders/application/results.d.ts | 73 - .../build/src/builders/application/results.js | 17 - .../src/builders/application/schema.d.ts | 644 ------- .../build/src/builders/application/schema.js | 92 - .../src/builders/application/schema.json | 720 -------- .../builders/application/setup-bundling.d.ts | 25 - .../builders/application/setup-bundling.js | 103 -- .../src/builders/dev-server/builder.d.ts | 31 - .../build/src/builders/dev-server/builder.js | 60 - .../build/src/builders/dev-server/index.d.ts | 15 - .../build/src/builders/dev-server/index.js | 16 - .../src/builders/dev-server/internal.d.ts | 18 - .../build/src/builders/dev-server/internal.js | 27 - .../src/builders/dev-server/options.d.ts | 48 - .../build/src/builders/dev-server/options.js | 102 -- .../build/src/builders/dev-server/output.d.ts | 16 - .../build/src/builders/dev-server/output.js | 9 - .../build/src/builders/dev-server/schema.d.ts | 112 -- .../build/src/builders/dev-server/schema.js | 4 - .../build/src/builders/dev-server/schema.json | 131 -- .../src/builders/dev-server/vite-server.d.ts | 42 - .../src/builders/dev-server/vite-server.js | 735 -------- .../extract-i18n/application-extraction.d.ts | 18 - .../extract-i18n/application-extraction.js | 131 -- .../src/builders/extract-i18n/builder.d.ts | 14 - .../src/builders/extract-i18n/builder.js | 162 -- .../src/builders/extract-i18n/index.d.ts | 13 - .../build/src/builders/extract-i18n/index.js | 15 - .../src/builders/extract-i18n/options.d.ts | 33 - .../src/builders/extract-i18n/options.js | 85 - .../src/builders/extract-i18n/schema.d.ts | 53 - .../build/src/builders/extract-i18n/schema.js | 29 - .../src/builders/extract-i18n/schema.json | 38 - .../builders/karma/application_builder.d.ts | 13 - .../src/builders/karma/application_builder.js | 632 ------- .../build/src/builders/karma/find-tests.d.ts | 15 - .../build/src/builders/karma/find-tests.js | 111 -- .../build/src/builders/karma/index.d.ts | 20 - .../build/src/builders/karma/index.js | 53 - .../build/src/builders/karma/options.d.ts | 42 - .../build/src/builders/karma/options.js | 43 - .../karma/polyfills/init_sourcemaps.js | 10 - .../karma/polyfills/jasmine_global.js | 18 - .../karma/polyfills/jasmine_global_cleanup.js | 14 - .../build/src/builders/karma/schema.d.ts | 250 --- .../build/src/builders/karma/schema.js | 15 - .../build/src/builders/karma/schema.json | 348 ---- .../src/builders/ng-packagr/builder.d.ts | 19 - .../build/src/builders/ng-packagr/builder.js | 106 -- .../build/src/builders/ng-packagr/index.d.ts | 13 - .../build/src/builders/ng-packagr/index.js | 15 - .../build/src/builders/ng-packagr/schema.d.ts | 21 - .../build/src/builders/ng-packagr/schema.js | 4 - .../build/src/builders/ng-packagr/schema.json | 26 - .../build/src/builders/unit-test/builder.d.ts | 15 - .../build/src/builders/unit-test/builder.js | 335 ---- .../build/src/builders/unit-test/index.d.ts | 12 - .../build/src/builders/unit-test/index.js | 15 - .../src/builders/unit-test/karma-bridge.d.ts | 10 - .../src/builders/unit-test/karma-bridge.js | 82 - .../build/src/builders/unit-test/options.d.ts | 32 - .../build/src/builders/unit-test/options.js | 64 - .../build/src/builders/unit-test/schema.d.ts | 95 -- .../build/src/builders/unit-test/schema.js | 24 - .../build/src/builders/unit-test/schema.json | 127 -- .../@angular/build/src/index.d.ts | 16 - .../@angular/build/src/index.js | 24 - .../@angular/build/src/private.d.ts | 53 - .../@angular/build/src/private.js | 97 -- .../build/src/tools/angular/angular-host.d.ts | 27 - .../build/src/tools/angular/angular-host.js | 163 -- .../compilation/angular-compilation.d.ts | 44 - .../compilation/angular-compilation.js | 107 -- .../angular/compilation/aot-compilation.d.ts | 25 - .../angular/compilation/aot-compilation.js | 337 ---- .../tools/angular/compilation/factory.d.ts | 17 - .../src/tools/angular/compilation/factory.js | 66 - .../angular/compilation/hmr-candidates.d.ts | 22 - .../angular/compilation/hmr-candidates.js | 269 --- .../src/tools/angular/compilation/index.d.ts | 10 - .../src/tools/angular/compilation/index.js | 17 - .../angular/compilation/jit-compilation.d.ts | 23 - .../angular/compilation/jit-compilation.js | 117 -- .../angular/compilation/noop-compilation.d.ts | 20 - .../angular/compilation/noop-compilation.js | 26 - .../compilation/parallel-compilation.d.ts | 44 - .../compilation/parallel-compilation.js | 118 -- .../angular/compilation/parallel-worker.d.ts | 38 - .../angular/compilation/parallel-worker.js | 100 -- .../jit-bootstrap-transformer.d.ts | 10 - .../transformers/jit-bootstrap-transformer.js | 180 -- .../jit-resource-transformer.d.ts | 17 - .../transformers/jit-resource-transformer.js | 186 -- .../transformers/lazy-routes-transformer.d.ts | 39 - .../transformers/lazy-routes-transformer.js | 163 -- .../transformers/web-worker-transformer.d.ts | 17 - .../transformers/web-worker-transformer.js | 93 - .../@angular/build/src/tools/angular/uri.d.ts | 54 - .../@angular/build/src/tools/angular/uri.js | 75 - .../babel/plugins/add-code-coverage.d.ts | 14 - .../tools/babel/plugins/add-code-coverage.js | 44 - .../plugins/adjust-static-class-members.d.ts | 25 - .../plugins/adjust-static-class-members.js | 348 ---- .../plugins/adjust-typescript-enums.d.ts | 21 - .../babel/plugins/adjust-typescript-enums.js | 112 -- .../babel/plugins/elide-angular-metadata.d.ts | 21 - .../babel/plugins/elide-angular-metadata.js | 109 -- .../build/src/tools/babel/plugins/index.d.ts | 11 - .../build/src/tools/babel/plugins/index.js | 21 - .../plugins/pure-toplevel-functions.d.ts | 13 - .../babel/plugins/pure-toplevel-functions.js | 127 -- .../build/src/tools/babel/plugins/types.d.ts | 20 - .../build/src/tools/babel/typings.d.ts | 21 - .../angular-localize-init-warning-plugin.d.ts | 16 - .../angular-localize-init-warning-plugin.js | 49 - .../esbuild/angular/compilation-state.d.ts | 15 - .../esbuild/angular/compilation-state.js | 44 - .../esbuild/angular/compiler-plugin.d.ts | 34 - .../tools/esbuild/angular/compiler-plugin.js | 605 ------- .../angular/component-stylesheets.d.ts | 49 - .../esbuild/angular/component-stylesheets.js | 221 --- .../tools/esbuild/angular/diagnostics.d.ts | 15 - .../src/tools/esbuild/angular/diagnostics.js | 71 - .../angular/file-reference-tracker.d.ts | 17 - .../esbuild/angular/file-reference-tracker.js | 57 - .../esbuild/angular/jit-plugin-callbacks.d.ts | 23 - .../esbuild/angular/jit-plugin-callbacks.js | 119 -- .../esbuild/angular/rewrite-bazel-paths.d.ts | 8 - .../esbuild/angular/rewrite-bazel-paths.js | 27 - .../esbuild/angular/source-file-cache.d.ts | 18 - .../esbuild/angular/source-file-cache.js | 79 - .../esbuild/application-code-bundle.d.ts | 19 - .../tools/esbuild/application-code-bundle.js | 537 ------ .../build/src/tools/esbuild/budget-stats.d.ts | 19 - .../build/src/tools/esbuild/budget-stats.js | 66 - .../src/tools/esbuild/bundler-context.d.ts | 80 - .../src/tools/esbuild/bundler-context.js | 398 ----- .../esbuild/bundler-execution-result.d.ts | 95 -- .../tools/esbuild/bundler-execution-result.js | 148 -- .../build/src/tools/esbuild/cache.d.ts | 93 - .../@angular/build/src/tools/esbuild/cache.js | 99 -- .../src/tools/esbuild/commonjs-checker.d.ts | 28 - .../src/tools/esbuild/commonjs-checker.js | 150 -- .../esbuild/compiler-plugin-options.d.ts | 14 - .../tools/esbuild/compiler-plugin-options.js | 29 - .../esbuild/external-packages-plugin.d.ts | 18 - .../tools/esbuild/external-packages-plugin.js | 96 -- .../src/tools/esbuild/global-scripts.d.ts | 16 - .../build/src/tools/esbuild/global-scripts.js | 152 -- .../src/tools/esbuild/global-styles.d.ts | 10 - .../build/src/tools/esbuild/global-styles.js | 78 - .../tools/esbuild/i18n-inliner-worker.d.ts | 77 - .../src/tools/esbuild/i18n-inliner-worker.js | 151 -- .../build/src/tools/esbuild/i18n-inliner.d.ts | 58 - .../build/src/tools/esbuild/i18n-inliner.js | 265 --- .../src/tools/esbuild/i18n-locale-plugin.d.ts | 22 - .../src/tools/esbuild/i18n-locale-plugin.js | 138 -- .../tools/esbuild/index-html-generator.d.ts | 15 - .../src/tools/esbuild/index-html-generator.js | 90 - .../javascript-transformer-worker.d.ts | 20 - .../esbuild/javascript-transformer-worker.js | 161 -- .../tools/esbuild/javascript-transformer.d.ts | 54 - .../tools/esbuild/javascript-transformer.js | 152 -- .../src/tools/esbuild/license-extractor.d.ts | 25 - .../src/tools/esbuild/license-extractor.js | 157 -- .../src/tools/esbuild/lmdb-cache-store.d.ts | 18 - .../src/tools/esbuild/lmdb-cache-store.js | 54 - .../src/tools/esbuild/load-result-cache.d.ts | 21 - .../src/tools/esbuild/load-result-cache.js | 75 - .../loader-import-attribute-plugin.d.ts | 9 - .../esbuild/loader-import-attribute-plugin.js | 41 - .../build/src/tools/esbuild/profiling.d.ts | 11 - .../build/src/tools/esbuild/profiling.js | 77 - .../esbuild/rxjs-esm-resolution-plugin.d.ts | 18 - .../esbuild/rxjs-esm-resolution-plugin.js | 43 - .../server-bundle-metadata-plugin.d.ts | 22 - .../esbuild/server-bundle-metadata-plugin.js | 36 - .../esbuild/sourcemap-ignorelist-plugin.d.ts | 17 - .../esbuild/sourcemap-ignorelist-plugin.js | 72 - .../esbuild/stylesheets/bundle-options.d.ts | 38 - .../esbuild/stylesheets/bundle-options.js | 65 - .../stylesheets/css-inline-fonts-plugin.d.ts | 25 - .../stylesheets/css-inline-fonts-plugin.js | 56 - .../esbuild/stylesheets/css-language.d.ts | 9 - .../tools/esbuild/stylesheets/css-language.js | 15 - .../stylesheets/css-resource-plugin.d.ts | 18 - .../stylesheets/css-resource-plugin.js | 113 -- .../esbuild/stylesheets/less-language.d.ts | 9 - .../esbuild/stylesheets/less-language.js | 184 -- .../esbuild/stylesheets/sass-language.d.ts | 10 - .../esbuild/stylesheets/sass-language.js | 230 --- .../stylesheet-plugin-factory.d.ts | 74 - .../stylesheets/stylesheet-plugin-factory.js | 328 ---- .../build/src/tools/esbuild/utils.d.ts | 58 - .../@angular/build/src/tools/esbuild/utils.js | 390 ----- .../tools/esbuild/virtual-module-plugin.d.ts | 33 - .../tools/esbuild/virtual-module-plugin.js | 42 - .../build/src/tools/esbuild/wasm-plugin.d.ts | 28 - .../build/src/tools/esbuild/wasm-plugin.js | 210 --- .../build/src/tools/esbuild/wasm.d.ts | 25 - .../build/src/tools/esbuild/watcher.d.ts | 25 - .../build/src/tools/esbuild/watcher.js | 118 -- .../@angular/build/src/tools/sass/lexer.d.ts | 18 - .../@angular/build/src/tools/sass/lexer.js | 171 -- .../src/tools/sass/rebasing-importer.d.ts | 101 -- .../build/src/tools/sass/rebasing-importer.js | 332 ---- .../build/src/tools/sass/sass-service.d.ts | 67 - .../build/src/tools/sass/sass-service.js | 241 --- .../@angular/build/src/tools/sass/worker.d.ts | 63 - .../@angular/build/src/tools/sass/worker.js | 201 --- .../vite/middlewares/assets-middleware.d.ts | 15 - .../vite/middlewares/assets-middleware.js | 173 -- .../chrome-devtools-middleware.d.ts | 9 - .../middlewares/chrome-devtools-middleware.js | 52 - .../middlewares/component-middleware.d.ts | 9 - .../vite/middlewares/component-middleware.js | 35 - .../vite/middlewares/headers-middleware.d.ts | 19 - .../vite/middlewares/headers-middleware.js | 34 - .../middlewares/html-fallback-middleware.d.ts | 10 - .../middlewares/html-fallback-middleware.js | 41 - .../middlewares/index-html-middleware.d.ts | 10 - .../vite/middlewares/index-html-middleware.js | 46 - .../src/tools/vite/middlewares/index.d.ts | 14 - .../build/src/tools/vite/middlewares/index.js | 25 - .../vite/middlewares/ssr-middleware.d.ts | 10 - .../tools/vite/middlewares/ssr-middleware.js | 97 -- .../vite/plugins/angular-memory-plugin.d.ts | 18 - .../vite/plugins/angular-memory-plugin.js | 116 -- .../tools/vite/plugins/id-prefix-plugin.d.ts | 9 - .../tools/vite/plugins/id-prefix-plugin.js | 45 - .../build/src/tools/vite/plugins/index.d.ts | 11 - .../build/src/tools/vite/plugins/index.js | 19 - .../plugins/setup-middlewares-plugin.d.ts | 45 - .../vite/plugins/setup-middlewares-plugin.js | 72 - .../vite/plugins/ssr-transform-plugin.d.ts | 9 - .../vite/plugins/ssr-transform-plugin.js | 35 - .../@angular/build/src/tools/vite/utils.d.ts | 32 - .../@angular/build/src/tools/vite/utils.js | 66 - .../@angular/build/src/typings.d.ts | 19 - .../build/src/utils/bundle-calculator.d.ts | 45 - .../build/src/utils/bundle-calculator.js | 304 ---- .../@angular/build/src/utils/check-port.d.ts | 8 - .../@angular/build/src/utils/check-port.js | 87 - .../@angular/build/src/utils/color.d.ts | 9 - .../@angular/build/src/utils/color.js | 27 - .../build/src/utils/delete-output-dir.d.ts | 11 - .../build/src/utils/delete-output-dir.js | 45 - .../build/src/utils/environment-options.d.ts | 21 - .../build/src/utils/environment-options.js | 95 -- .../@angular/build/src/utils/error.d.ts | 10 - .../@angular/build/src/utils/error.js | 20 - .../build/src/utils/format-bytes.d.ts | 8 - .../@angular/build/src/utils/format-bytes.js | 21 - .../build/src/utils/i18n-options.d.ts | 36 - .../@angular/build/src/utils/i18n-options.js | 207 --- .../add-event-dispatch-contract.d.ts | 8 - .../index-file/add-event-dispatch-contract.js | 27 - .../utils/index-file/augment-index-html.d.ts | 40 - .../utils/index-file/augment-index-html.js | 267 --- .../build/src/utils/index-file/auto-csp.d.ts | 23 - .../build/src/utils/index-file/auto-csp.js | 293 ---- .../index-file/html-rewriting-stream.d.ts | 15 - .../utils/index-file/html-rewriting-stream.js | 27 - .../index-file/index-html-generator.d.ts | 61 - .../utils/index-file/index-html-generator.js | 153 -- .../utils/index-file/inline-critical-css.d.ts | 25 - .../utils/index-file/inline-critical-css.js | 192 --- .../src/utils/index-file/inline-fonts.d.ts | 23 - .../src/utils/index-file/inline-fonts.js | 239 --- .../src/utils/index-file/ngcm-attribute.d.ts | 15 - .../src/utils/index-file/ngcm-attribute.js | 37 - .../build/src/utils/index-file/nonce.d.ts | 12 - .../build/src/utils/index-file/nonce.js | 53 - .../index-file/valid-self-closing-tags.d.ts | 9 - .../index-file/valid-self-closing-tags.js | 89 - .../@angular/build/src/utils/index.d.ts | 11 - .../@angular/build/src/utils/index.js | 27 - .../@angular/build/src/utils/load-esm.d.ts | 20 - .../@angular/build/src/utils/load-esm.js | 30 - .../build/src/utils/load-proxy-config.d.ts | 8 - .../build/src/utils/load-proxy-config.js | 199 --- .../build/src/utils/load-translations.d.ts | 16 - .../build/src/utils/load-translations.js | 93 - .../src/utils/normalize-asset-patterns.d.ts | 14 - .../src/utils/normalize-asset-patterns.js | 106 -- .../build/src/utils/normalize-cache.d.ts | 16 - .../build/src/utils/normalize-cache.js | 45 - .../src/utils/normalize-optimization.d.ts | 13 - .../build/src/utils/normalize-optimization.js | 41 - .../src/utils/normalize-source-maps.d.ts | 9 - .../build/src/utils/normalize-source-maps.js | 24 - .../@angular/build/src/utils/path.d.ts | 29 - .../@angular/build/src/utils/path.js | 37 - .../src/utils/postcss-configuration.d.ts | 17 - .../build/src/utils/postcss-configuration.js | 85 - .../build/src/utils/project-metadata.d.ts | 21 - .../build/src/utils/project-metadata.js | 31 - .../@angular/build/src/utils/purge-cache.d.ts | 10 - .../@angular/build/src/utils/purge-cache.js | 39 - .../build/src/utils/resolve-assets.d.ts | 18 - .../build/src/utils/resolve-assets.js | 34 - .../esm-in-memory-loader/loader-hooks.d.ts | 18 - .../esm-in-memory-loader/loader-hooks.js | 135 -- .../esm-in-memory-loader/register-hooks.d.ts | 8 - .../esm-in-memory-loader/register-hooks.js | 13 - .../esm-in-memory-loader/utils.d.ts | 8 - .../esm-in-memory-loader/utils.js | 13 - .../utils/server-rendering/fetch-patch.d.ts | 8 - .../src/utils/server-rendering/fetch-patch.js | 63 - .../utils/server-rendering/launch-server.d.ts | 14 - .../utils/server-rendering/launch-server.js | 63 - .../load-esm-from-memory.d.ts | 27 - .../server-rendering/load-esm-from-memory.js | 25 - .../src/utils/server-rendering/manifest.d.ts | 57 - .../src/utils/server-rendering/manifest.js | 174 -- .../src/utils/server-rendering/models.d.ts | 28 - .../src/utils/server-rendering/models.js | 21 - .../src/utils/server-rendering/prerender.d.ts | 39 - .../src/utils/server-rendering/prerender.js | 244 --- .../utils/server-rendering/render-worker.d.ts | 23 - .../utils/server-rendering/render-worker.js | 42 - .../routes-extractor-worker.d.ts | 16 - .../routes-extractor-worker.js | 36 - .../src/utils/server-rendering/utils.d.ts | 21 - .../build/src/utils/server-rendering/utils.js | 42 - .../build/src/utils/service-worker.d.ts | 23 - .../build/src/utils/service-worker.js | 217 --- .../@angular/build/src/utils/stats-table.d.ts | 20 - .../@angular/build/src/utils/stats-table.js | 204 --- .../build/src/utils/supported-browsers.d.ts | 10 - .../build/src/utils/supported-browsers.js | 52 - .../@angular/build/src/utils/tty.d.ts | 8 - .../@angular/build/src/utils/tty.js | 22 - .../@angular/build/src/utils/url.d.ts | 8 - .../@angular/build/src/utils/url.js | 17 - .../@angular/build/src/utils/version.d.ts | 8 - .../@angular/build/src/utils/version.js | 43 - .../@angular/build/src/utils/worker-pool.d.ts | 12 - .../@angular/build/src/utils/worker-pool.js | 43 - .../@angular/cli/src/commands/build/cli.d.ts | 16 - .../@angular/cli/src/commands/build/cli.js | 20 - .../src/commands/build/long-description.md | 18 - .../core/lib/vendor/import-meta-resolve.js | 1042 ----------- .../lib/vendor/import-meta-resolve.js.map | 1 - .../@isaacs/cliui/build/index.cjs | 317 ---- .../@isaacs/cliui/build/index.d.cts | 43 - .../@isaacs/cliui/build/lib/index.js | 302 ---- .../source/vendor/ansi-styles/index.d.ts | 236 --- .../chalk/source/vendor/ansi-styles/index.js | 223 --- .../source/vendor/supports-color/browser.d.ts | 1 - .../source/vendor/supports-color/browser.js | 34 - .../source/vendor/supports-color/index.d.ts | 55 - .../source/vendor/supports-color/index.js | 190 --- .../node_modules.bak/cliui/build/lib/index.js | 287 ---- .../cliui/build/tsconfig.tsbuildinfo | 1 - .../engine.io-parser/build/cjs/commons.d.ts | 14 - .../engine.io-parser/build/cjs/commons.js | 19 - .../build/cjs/contrib/base64-arraybuffer.d.ts | 2 - .../build/cjs/contrib/base64-arraybuffer.js | 48 - .../build/cjs/decodePacket.browser.d.ts | 2 - .../build/cjs/decodePacket.browser.js | 66 - .../build/cjs/decodePacket.d.ts | 2 - .../build/cjs/decodePacket.js | 59 - .../build/cjs/encodePacket.browser.d.ts | 4 - .../build/cjs/encodePacket.browser.js | 72 - .../build/cjs/encodePacket.d.ts | 3 - .../build/cjs/encodePacket.js | 38 - .../engine.io-parser/build/cjs/index.d.ts | 9 - .../engine.io-parser/build/cjs/index.js | 164 -- .../engine.io-parser/build/cjs/package.json | 8 - .../engine.io-parser/build/esm/commons.d.ts | 14 - .../engine.io-parser/build/esm/commons.js | 14 - .../build/esm/contrib/base64-arraybuffer.d.ts | 2 - .../build/esm/contrib/base64-arraybuffer.js | 43 - .../build/esm/decodePacket.browser.d.ts | 2 - .../build/esm/decodePacket.browser.js | 62 - .../build/esm/decodePacket.d.ts | 2 - .../build/esm/decodePacket.js | 55 - .../build/esm/encodePacket.browser.d.ts | 4 - .../build/esm/encodePacket.browser.js | 68 - .../build/esm/encodePacket.d.ts | 3 - .../build/esm/encodePacket.js | 33 - .../engine.io-parser/build/esm/index.d.ts | 9 - .../engine.io-parser/build/esm/index.js | 156 -- .../engine.io-parser/build/esm/package.json | 8 - .../engine.io/build/contrib/types.cookie.d.ts | 113 -- .../engine.io/build/contrib/types.cookie.js | 6 - .../engine.io/build/engine.io.d.ts | 26 - .../engine.io/build/engine.io.js | 54 - .../engine.io/build/parser-v3/index.d.ts | 94 - .../engine.io/build/parser-v3/index.js | 424 ----- .../engine.io/build/parser-v3/utf8.d.ts | 14 - .../engine.io/build/parser-v3/utf8.js | 187 -- .../engine.io/build/server.d.ts | 267 --- .../engine.io/build/server.js | 786 --------- .../engine.io/build/socket.d.ts | 180 -- .../engine.io/build/socket.js | 460 ----- .../engine.io/build/transport.d.ts | 124 -- .../engine.io/build/transport.js | 117 -- .../engine.io/build/transports-uws/index.d.ts | 7 - .../engine.io/build/transports-uws/index.js | 8 - .../build/transports-uws/polling.d.ts | 99 -- .../engine.io/build/transports-uws/polling.js | 364 ---- .../build/transports-uws/websocket.d.ts | 32 - .../build/transports-uws/websocket.js | 73 - .../engine.io/build/transports/index.d.ts | 16 - .../engine.io/build/transports/index.js | 23 - .../build/transports/polling-jsonp.d.ts | 12 - .../build/transports/polling-jsonp.js | 41 - .../engine.io/build/transports/polling.d.ts | 87 - .../engine.io/build/transports/polling.js | 332 ---- .../engine.io/build/transports/websocket.d.ts | 32 - .../engine.io/build/transports/websocket.js | 94 - .../build/transports/webtransport.d.ts | 12 - .../build/transports/webtransport.js | 63 - .../engine.io/build/userver.d.ts | 42 - .../engine.io/build/userver.js | 279 --- .../lib/html/assets/vendor/prettify.css | 1 - .../lib/html/assets/vendor/prettify.js | 1 - .../smart-buffer/build/smartbuffer.js | 1233 -------------- .../smart-buffer/build/smartbuffer.js.map | 1 - .../smart-buffer/build/utils.js | 108 -- .../smart-buffer/build/utils.js.map | 1 - .../socket.io-parser/build/cjs/binary.d.ts | 20 - .../socket.io-parser/build/cjs/binary.js | 88 - .../socket.io-parser/build/cjs/index.d.ts | 90 - .../socket.io-parser/build/cjs/index.js | 321 ---- .../socket.io-parser/build/cjs/is-binary.d.ts | 7 - .../socket.io-parser/build/cjs/is-binary.js | 55 - .../socket.io-parser/build/cjs/package.json | 3 - .../build/esm-debug/binary.d.ts | 20 - .../build/esm-debug/binary.js | 83 - .../build/esm-debug/index.d.ts | 90 - .../socket.io-parser/build/esm-debug/index.js | 316 ---- .../build/esm-debug/is-binary.d.ts | 7 - .../build/esm-debug/is-binary.js | 50 - .../build/esm-debug/package.json | 3 - .../socket.io-parser/build/esm/binary.d.ts | 20 - .../socket.io-parser/build/esm/binary.js | 83 - .../socket.io-parser/build/esm/index.d.ts | 90 - .../socket.io-parser/build/esm/index.js | 311 ---- .../socket.io-parser/build/esm/is-binary.d.ts | 7 - .../socket.io-parser/build/esm/is-binary.js | 50 - .../socket.io-parser/build/esm/package.json | 3 - .../socks/build/client/socksclient.js | 793 --------- .../socks/build/client/socksclient.js.map | 1 - .../socks/build/common/constants.js | 108 -- .../socks/build/common/constants.js.map | 1 - .../socks/build/common/helpers.js | 167 -- .../socks/build/common/helpers.js.map | 1 - .../socks/build/common/receivebuffer.js | 43 - .../socks/build/common/receivebuffer.js.map | 1 - .../socks/build/common/util.js | 25 - .../socks/build/common/util.js.map | 1 - .../ui/node_modules.bak/socks/build/index.js | 18 - .../node_modules.bak/socks/build/index.js.map | 1 - .../ui/node_modules.bak/y18n/build/index.cjs | 203 --- .../ui/node_modules.bak/y18n/build/lib/cjs.js | 6 - .../node_modules.bak/y18n/build/lib/index.js | 174 -- .../y18n/build/lib/platform-shims/node.js | 19 - .../yargs-parser/build/lib/index.js | 64 - .../yargs-parser/build/lib/string-utils.js | 65 - .../build/lib/tokenize-arg-string.js | 40 - .../build/lib/yargs-parser-types.js | 12 - .../yargs-parser/build/lib/yargs-parser.js | 1046 ------------ .../yargs/build/lib/argsert.js | 62 - .../yargs/build/lib/command.js | 479 ------ .../yargs/build/lib/completion-templates.js | 57 - .../yargs/build/lib/completion.js | 243 --- .../yargs/build/lib/middleware.js | 88 - .../yargs/build/lib/parse-command.js | 32 - .../yargs/build/lib/typings/common-types.js | 9 - .../build/lib/typings/yargs-parser-types.js | 1 - .../node_modules.bak/yargs/build/lib/usage.js | 584 ------- .../yargs/build/lib/utils/apply-extends.js | 59 - .../yargs/build/lib/utils/is-promise.js | 5 - .../yargs/build/lib/utils/levenshtein.js | 34 - .../build/lib/utils/maybe-async-result.js | 17 - .../yargs/build/lib/utils/obj-filter.js | 10 - .../yargs/build/lib/utils/process-argv.js | 17 - .../yargs/build/lib/utils/set-blocking.js | 12 - .../yargs/build/lib/utils/which-module.js | 10 - .../yargs/build/lib/validation.js | 305 ---- .../yargs/build/lib/yargs-factory.js | 1517 ----------------- .../yargs/build/lib/yerror.js | 9 - go/display/webkit/wails_options.go | 11 +- 524 files changed, 568 insertions(+), 45283 deletions(-) create mode 100644 go/display/webkit/.gitignore delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/.browserslistrc delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/LICENSE delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/README.md delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/builders.json delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/package.json delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/private/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/private/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/build-action.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/build-action.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/chunk-optimizer.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/chunk-optimizer.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-build.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-build.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-post-bundle.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-post-bundle.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/i18n.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/i18n.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/options.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/options.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/results.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/results.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.json delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/setup-bundling.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/setup-bundling.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/builder.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/builder.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/internal.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/internal.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/options.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/options.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/output.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/output.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.json delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/vite-server.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/vite-server.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/application-extraction.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/application-extraction.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/builder.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/builder.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/options.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/options.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.json delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/application_builder.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/application_builder.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/find-tests.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/find-tests.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/options.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/options.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/init_sourcemaps.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/jasmine_global.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/jasmine_global_cleanup.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.json delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/builder.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/builder.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.json delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/builder.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/builder.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/karma-bridge.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/karma-bridge.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/options.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/options.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.json delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/private.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/private.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/angular-host.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/angular-host.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/angular-compilation.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/angular-compilation.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/aot-compilation.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/aot-compilation.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/factory.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/factory.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/hmr-candidates.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/hmr-candidates.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/jit-compilation.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/jit-compilation.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/noop-compilation.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/noop-compilation.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-compilation.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-compilation.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-worker.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-worker.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-resource-transformer.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-resource-transformer.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/lazy-routes-transformer.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/lazy-routes-transformer.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/web-worker-transformer.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/web-worker-transformer.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/uri.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/uri.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/add-code-coverage.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/add-code-coverage.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-static-class-members.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-static-class-members.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-typescript-enums.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-typescript-enums.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/elide-angular-metadata.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/elide-angular-metadata.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/pure-toplevel-functions.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/pure-toplevel-functions.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/types.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/typings.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular-localize-init-warning-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular-localize-init-warning-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compilation-state.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compilation-state.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compiler-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compiler-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/component-stylesheets.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/component-stylesheets.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/diagnostics.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/diagnostics.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/file-reference-tracker.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/file-reference-tracker.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/jit-plugin-callbacks.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/source-file-cache.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/source-file-cache.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/application-code-bundle.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/application-code-bundle.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/budget-stats.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/budget-stats.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-context.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-context.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-execution-result.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-execution-result.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/cache.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/cache.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/commonjs-checker.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/commonjs-checker.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/compiler-plugin-options.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/compiler-plugin-options.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/external-packages-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/external-packages-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-scripts.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-scripts.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-styles.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-styles.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner-worker.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner-worker.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-locale-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-locale-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/index-html-generator.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/index-html-generator.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer-worker.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer-worker.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/license-extractor.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/license-extractor.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/lmdb-cache-store.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/lmdb-cache-store.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/load-result-cache.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/load-result-cache.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/loader-import-attribute-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/loader-import-attribute-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/profiling.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/profiling.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/rxjs-esm-resolution-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/server-bundle-metadata-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/server-bundle-metadata-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/sourcemap-ignorelist-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/bundle-options.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/bundle-options.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-language.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-language.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-resource-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/less-language.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/less-language.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/sass-language.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/sass-language.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/utils.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/utils.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/virtual-module-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/virtual-module-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/watcher.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/watcher.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/lexer.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/lexer.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/rebasing-importer.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/rebasing-importer.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/sass-service.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/sass-service.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/worker.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/worker.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/assets-middleware.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/assets-middleware.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/chrome-devtools-middleware.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/chrome-devtools-middleware.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/component-middleware.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/component-middleware.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/headers-middleware.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/headers-middleware.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/html-fallback-middleware.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/html-fallback-middleware.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index-html-middleware.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index-html-middleware.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/ssr-middleware.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/ssr-middleware.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/angular-memory-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/angular-memory-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/id-prefix-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/id-prefix-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/setup-middlewares-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/setup-middlewares-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/ssr-transform-plugin.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/ssr-transform-plugin.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/utils.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/utils.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/typings.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/bundle-calculator.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/bundle-calculator.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/check-port.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/check-port.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/color.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/color.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/delete-output-dir.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/delete-output-dir.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/environment-options.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/environment-options.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/error.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/error.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/format-bytes.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/format-bytes.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/i18n-options.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/i18n-options.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/add-event-dispatch-contract.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/add-event-dispatch-contract.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/augment-index-html.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/augment-index-html.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/auto-csp.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/auto-csp.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/html-rewriting-stream.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/html-rewriting-stream.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/index-html-generator.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/index-html-generator.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/inline-critical-css.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/inline-critical-css.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/inline-fonts.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/inline-fonts.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/ngcm-attribute.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/ngcm-attribute.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/nonce.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/nonce.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/valid-self-closing-tags.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/valid-self-closing-tags.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/load-esm.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/load-esm.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/load-proxy-config.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/load-proxy-config.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/load-translations.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/load-translations.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/normalize-asset-patterns.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/normalize-asset-patterns.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/normalize-cache.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/normalize-cache.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/normalize-optimization.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/normalize-optimization.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/normalize-source-maps.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/normalize-source-maps.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/path.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/path.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/postcss-configuration.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/postcss-configuration.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/project-metadata.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/project-metadata.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/purge-cache.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/purge-cache.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/resolve-assets.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/resolve-assets.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/esm-in-memory-loader/register-hooks.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/esm-in-memory-loader/utils.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/esm-in-memory-loader/utils.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/fetch-patch.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/fetch-patch.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/launch-server.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/launch-server.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/load-esm-from-memory.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/load-esm-from-memory.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/manifest.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/manifest.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/models.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/models.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/prerender.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/prerender.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/render-worker.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/render-worker.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/routes-extractor-worker.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/routes-extractor-worker.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/utils.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/server-rendering/utils.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/service-worker.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/service-worker.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/stats-table.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/stats-table.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/supported-browsers.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/supported-browsers.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/tty.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/tty.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/url.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/url.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/version.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/version.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/worker-pool.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/worker-pool.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/cli/src/commands/build/cli.d.ts delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/cli/src/commands/build/cli.js delete mode 100755 go/display/webkit/ui/node_modules.bak/@angular/cli/src/commands/build/long-description.md delete mode 100644 go/display/webkit/ui/node_modules.bak/@babel/core/lib/vendor/import-meta-resolve.js delete mode 100644 go/display/webkit/ui/node_modules.bak/@babel/core/lib/vendor/import-meta-resolve.js.map delete mode 100644 go/display/webkit/ui/node_modules.bak/@isaacs/cliui/build/index.cjs delete mode 100644 go/display/webkit/ui/node_modules.bak/@isaacs/cliui/build/index.d.cts delete mode 100644 go/display/webkit/ui/node_modules.bak/@isaacs/cliui/build/lib/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/chalk/source/vendor/ansi-styles/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/chalk/source/vendor/ansi-styles/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/chalk/source/vendor/supports-color/browser.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/chalk/source/vendor/supports-color/browser.js delete mode 100644 go/display/webkit/ui/node_modules.bak/chalk/source/vendor/supports-color/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/chalk/source/vendor/supports-color/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/cliui/build/lib/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/cliui/build/tsconfig.tsbuildinfo delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/commons.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/commons.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/decodePacket.browser.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/decodePacket.browser.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/decodePacket.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/decodePacket.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/encodePacket.browser.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/encodePacket.browser.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/encodePacket.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/encodePacket.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/cjs/package.json delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/commons.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/commons.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/contrib/base64-arraybuffer.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/decodePacket.browser.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/decodePacket.browser.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/decodePacket.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/decodePacket.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/encodePacket.browser.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/encodePacket.browser.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/encodePacket.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/encodePacket.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io-parser/build/esm/package.json delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/contrib/types.cookie.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/contrib/types.cookie.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/engine.io.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/engine.io.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/parser-v3/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/parser-v3/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/parser-v3/utf8.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/parser-v3/utf8.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/server.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/server.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/socket.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/socket.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transport.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transport.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports-uws/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports-uws/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports-uws/polling.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports-uws/polling.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports-uws/websocket.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports-uws/websocket.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/polling-jsonp.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/polling-jsonp.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/polling.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/polling.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/websocket.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/websocket.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/webtransport.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/transports/webtransport.js delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/userver.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/engine.io/build/userver.js delete mode 100644 go/display/webkit/ui/node_modules.bak/istanbul-reports/lib/html/assets/vendor/prettify.css delete mode 100644 go/display/webkit/ui/node_modules.bak/istanbul-reports/lib/html/assets/vendor/prettify.js delete mode 100644 go/display/webkit/ui/node_modules.bak/smart-buffer/build/smartbuffer.js delete mode 100644 go/display/webkit/ui/node_modules.bak/smart-buffer/build/smartbuffer.js.map delete mode 100644 go/display/webkit/ui/node_modules.bak/smart-buffer/build/utils.js delete mode 100644 go/display/webkit/ui/node_modules.bak/smart-buffer/build/utils.js.map delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/cjs/binary.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/cjs/binary.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/cjs/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/cjs/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/cjs/is-binary.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/cjs/is-binary.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/cjs/package.json delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm-debug/binary.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm-debug/binary.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm-debug/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm-debug/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm-debug/is-binary.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm-debug/is-binary.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm-debug/package.json delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm/binary.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm/binary.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm/index.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm/is-binary.d.ts delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm/is-binary.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socket.io-parser/build/esm/package.json delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/client/socksclient.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/client/socksclient.js.map delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/common/constants.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/common/constants.js.map delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/common/helpers.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/common/helpers.js.map delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/common/receivebuffer.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/common/receivebuffer.js.map delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/common/util.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/common/util.js.map delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/socks/build/index.js.map delete mode 100644 go/display/webkit/ui/node_modules.bak/y18n/build/index.cjs delete mode 100644 go/display/webkit/ui/node_modules.bak/y18n/build/lib/cjs.js delete mode 100644 go/display/webkit/ui/node_modules.bak/y18n/build/lib/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/y18n/build/lib/platform-shims/node.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs-parser/build/lib/index.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs-parser/build/lib/string-utils.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs-parser/build/lib/tokenize-arg-string.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs-parser/build/lib/yargs-parser-types.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs-parser/build/lib/yargs-parser.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/argsert.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/command.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/completion-templates.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/completion.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/middleware.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/parse-command.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/typings/common-types.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/typings/yargs-parser-types.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/usage.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/utils/apply-extends.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/utils/is-promise.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/utils/levenshtein.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/utils/maybe-async-result.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/utils/obj-filter.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/utils/process-argv.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/utils/set-blocking.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/utils/which-module.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/validation.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/yargs-factory.js delete mode 100644 go/display/webkit/ui/node_modules.bak/yargs/build/lib/yerror.js diff --git a/go/display/webkit/.gitignore b/go/display/webkit/.gitignore new file mode 100644 index 0000000..4a962ee --- /dev/null +++ b/go/display/webkit/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +node_modules.bak/ diff --git a/go/display/webkit/pkg/keybinding/wails.go b/go/display/webkit/pkg/keybinding/wails.go index 8b7a240..513273b 100644 --- a/go/display/webkit/pkg/keybinding/wails.go +++ b/go/display/webkit/pkg/keybinding/wails.go @@ -2,40 +2,45 @@ package keybinding import ( + "sync" + + core "dappco.re/go" "github.com/wailsapp/wails/v3/pkg/application" ) -// WailsPlatform implements Platform via Wails v3's KeyBindingManager. -// -// Wails owns one global key-binding map keyed by accelerator string; -// when a window receives a key event matching a binding, the registered -// callback fires with that window as its argument. Our gui Platform -// passes a callback that takes no window — we wrap it to ignore the -// argument so the consumer doesn't need to know about Wails Windows. +// WailsPlatform implements Platform via Wails v3's GlobalShortcutManager. // -// Boot-time bindings configured via application.Options.KeyBindings -// (e.g. ⌘R reload in core-ide's wails_boot.go) live in the same map, -// so this adapter can replace them at runtime — last writer wins. +// Global shortcuts are registered with the operating system and fire even +// when no Wails window is focused. The local callback map preserves the +// adapter's Process method for deterministic tests and command dispatch. // // wp := keybinding.NewWailsPlatform(app) // core.WithService(keybinding.Register(wp)) type WailsPlatform struct { - app *application.App + app *application.App + mu sync.RWMutex + handlers map[string]func() } func NewWailsPlatform(app *application.App) *WailsPlatform { - return &WailsPlatform{app: app} + return &WailsPlatform{app: app, handlers: make(map[string]func())} } -// Add registers a global accelerator. Wails accelerator syntax matches +// Add registers a system-wide accelerator. Wails accelerator syntax matches // our doc'd format ("Cmd+S" / "Ctrl+S" / "Shift+F1" / "Cmd+Alt+I" etc.). func (wp *WailsPlatform) Add(accelerator string, handler func()) resultFailure { if wp == nil || wp.app == nil || handler == nil { return nil } - wp.app.KeyBinding.Add(accelerator, func(_ application.Window) { - handler() - }) + if wp.app.GlobalShortcut == nil { + return core.E("keybinding.WailsPlatform.Add", "Wails global shortcut manager is unavailable", nil) + } + if err := wp.app.GlobalShortcut.Register(accelerator, handler); err != nil { + return core.E("keybinding.WailsPlatform.Add", "failed to register global shortcut", err) + } + wp.mu.Lock() + wp.handlers[accelerator] = handler + wp.mu.Unlock() return nil } @@ -44,41 +49,37 @@ func (wp *WailsPlatform) Remove(accelerator string) resultFailure { if wp == nil || wp.app == nil { return nil } - wp.app.KeyBinding.Remove(accelerator) + if wp.app.GlobalShortcut == nil { + return core.E("keybinding.WailsPlatform.Remove", "Wails global shortcut manager is unavailable", nil) + } + if err := wp.app.GlobalShortcut.Unregister(accelerator); err != nil { + return core.E("keybinding.WailsPlatform.Remove", "failed to unregister global shortcut", err) + } + wp.mu.Lock() + delete(wp.handlers, accelerator) + wp.mu.Unlock() return nil } -// Process triggers the registered handler programmatically. Wails -// requires a Window argument so its callbacks can know the source — -// our wrapped callback ignores it; we still pass the currently focused -// window when possible so any future Wails-aware handlers (e.g. boot- -// time bindings sharing the same map) get the expected context. +// Process triggers the registered handler programmatically. func (wp *WailsPlatform) Process(accelerator string) bool { - if wp == nil || wp.app == nil { + if wp == nil { return false } - var w application.Window - if wp.app.Window != nil { - w = wp.app.Window.Current() + wp.mu.RLock() + handler, ok := wp.handlers[accelerator] + wp.mu.RUnlock() + if !ok || handler == nil { + return false } - return wp.app.KeyBinding.Process(accelerator, w) + handler() + return true } -// GetAll returns just the accelerator strings — the gui Platform -// contract is intentionally narrower than Wails's *KeyBinding (which -// also exposes the callback) because the callback is opaque to the -// consumer / MCP surface. +// GetAll returns Wails's canonical, sorted accelerator strings. func (wp *WailsPlatform) GetAll() []string { - if wp == nil || wp.app == nil { + if wp == nil || wp.app == nil || wp.app.GlobalShortcut == nil { return nil } - all := wp.app.KeyBinding.GetAll() - out := make([]string, 0, len(all)) - for _, kb := range all { - if kb == nil { - continue - } - out = append(out, kb.Accelerator) - } - return out + return wp.app.GlobalShortcut.GetAll() } diff --git a/go/display/webkit/pkg/notification/messages.go b/go/display/webkit/pkg/notification/messages.go index 2d6235f..32f96b7 100644 --- a/go/display/webkit/pkg/notification/messages.go +++ b/go/display/webkit/pkg/notification/messages.go @@ -33,6 +33,7 @@ type ActionNotificationClicked struct{ ID string } type ActionNotificationActionTriggered struct { NotificationID string `json:"notificationId"` ActionID string `json:"actionId"` + UserText string `json:"userText,omitempty"` } // ActionNotificationDismissed is broadcast when the user dismisses a notification. diff --git a/go/display/webkit/pkg/notification/platform.go b/go/display/webkit/pkg/notification/platform.go index 01bed93..acf50bf 100644 --- a/go/display/webkit/pkg/notification/platform.go +++ b/go/display/webkit/pkg/notification/platform.go @@ -15,6 +15,18 @@ type ClearPlatform interface { Clear(id string) resultFailure } +type updatePlatform interface { + Update(options NotificationOptions) resultFailure +} + +type categoryPlatform interface { + RegisterCategory(category NotificationCategory) resultFailure +} + +type responsePlatform interface { + OnResponse(callback func(notificationID, actionID, userText string)) +} + // NotificationSeverity indicates the severity for dialog fallback. type NotificationSeverity int @@ -35,8 +47,11 @@ type NotificationAction struct { // NotificationCategory groups actions under a named category/channel. // category := NotificationCategory{ID: "message", Actions: []NotificationAction{{ID: "reply", Title: "Reply"}}} type NotificationCategory struct { - ID string `json:"id"` - Actions []NotificationAction `json:"actions,omitempty"` + ID string `json:"id"` + Actions []NotificationAction `json:"actions,omitempty"` + HasReplyField bool `json:"hasReplyField,omitempty"` + ReplyPlaceholder string `json:"replyPlaceholder,omitempty"` + ReplyButtonTitle string `json:"replyButtonTitle,omitempty"` } // NotificationOptions contains options for sending a notification. @@ -48,6 +63,25 @@ type NotificationOptions struct { Severity NotificationSeverity `json:"severity,omitempty"` CategoryID string `json:"categoryId,omitempty"` Actions []NotificationAction `json:"actions,omitempty"` + Data map[string]any `json:"data,omitempty"` + // Silent suppresses the delivery sound. SoundName selects a + // platform sound when Silent is false. + Silent bool `json:"silent,omitempty"` + SoundName string `json:"soundName,omitempty"` + // AttachmentPaths contains absolute media paths. Wails uses the + // first image on Windows/Linux and supports multiple attachments + // on macOS. + AttachmentPaths []string `json:"attachmentPaths,omitempty"` + ThreadID string `json:"threadId,omitempty"` + // InterruptionLevel is passive, active, timeSensitive, or critical. + InterruptionLevel string `json:"interruptionLevel,omitempty"` + // ScheduleDelaySeconds and ScheduleAtUnix are mutually exclusive. + // Windows/Linux schedules are in-process; macOS schedules natively. + ScheduleDelaySeconds int `json:"scheduleDelaySeconds,omitempty"` + ScheduleAtUnix int64 `json:"scheduleAtUnix,omitempty"` + // Update replaces an in-flight notification with the same ID where + // the platform supports replacement. + Update bool `json:"update,omitempty"` } // PermissionStatus indicates whether notifications are authorised. diff --git a/go/display/webkit/pkg/notification/service.go b/go/display/webkit/pkg/notification/service.go index 71a0aa8..ab70899 100644 --- a/go/display/webkit/pkg/notification/service.go +++ b/go/display/webkit/pkg/notification/service.go @@ -35,6 +35,9 @@ func Register(p Platform) func(*core.Core) core.Result { func (s *Service) OnStartup(_ context.Context) core.Result { s.Core().RegisterQuery(s.handleQuery) + if platform, ok := s.platform.(responsePlatform); ok { + platform.OnResponse(s.handleResponse) + } send := func(_ context.Context, opts core.Options) core.Result { options, err := notificationOptionsFrom(opts) if err != nil { @@ -56,16 +59,12 @@ func (s *Service) OnStartup(_ context.Context) core.Result { s.Core().Action("gui.notification.revokePermission", func(_ context.Context, _ core.Options) core.Result { return core.Result{Value: nil, OK: true}.New(s.platform.RevokePermission()) }) - s.Core().Action("notification.registerCategory", func(_ context.Context, opts core.Options) core.Result { - t, _ := opts.Get("task").Value.(TaskRegisterCategory) - s.categories[t.Category.ID] = t.Category - return core.Result{OK: true} - }) - s.Core().Action("gui.notification.registerCategory", func(_ context.Context, opts core.Options) core.Result { + registerCategory := func(_ context.Context, opts core.Options) core.Result { t, _ := opts.Get("task").Value.(TaskRegisterCategory) - s.categories[t.Category.ID] = t.Category - return core.Result{OK: true} - }) + return core.Result{Value: nil, OK: true}.New(s.registerCategory(t.Category)) + } + s.Core().Action("notification.registerCategory", registerCategory) + s.Core().Action("gui.notification.registerCategory", registerCategory) s.Core().Action("notification.clear", func(_ context.Context, opts core.Options) core.Result { t, _ := opts.Get("task").Value.(TaskClear) return core.Result{Value: nil, OK: true}.New(s.clear(t.ID)) @@ -104,7 +103,15 @@ func (s *Service) send(options NotificationOptions) resultFailure { } options = s.applyCategoryActions(options) - if err := s.platform.Send(options); err != nil { + if options.Update { + platform, ok := s.platform.(updatePlatform) + if !ok { + return core.E("notification.send", "platform does not support notification updates", nil) + } + if err := platform.Update(options); err != nil { + return core.E("notification.send", "native notification update failed", err) + } + } else if err := s.platform.Send(options); err != nil { // Fallback: show as dialog via IPC if err := s.fallbackDialog(options); err != nil { return err @@ -116,6 +123,34 @@ func (s *Service) send(options NotificationOptions) resultFailure { return nil } +func (s *Service) registerCategory(category NotificationCategory) resultFailure { + if category.ID == "" { + return core.E("notification.registerCategory", "category ID is required", nil) + } + if platform, ok := s.platform.(categoryPlatform); ok { + if err := platform.RegisterCategory(category); err != nil { + return core.E("notification.registerCategory", "native category registration failed", err) + } + } + s.mu.Lock() + s.categories[category.ID] = category + s.mu.Unlock() + return nil +} + +func (s *Service) handleResponse(notificationID, actionID, userText string) { + switch actionID { + case "", "DEFAULT_ACTION": + coreutil.DispatchAction(s.Core(), "notification.click", ActionNotificationClicked{ID: notificationID}) + default: + coreutil.DispatchAction(s.Core(), "notification.action", ActionNotificationActionTriggered{ + NotificationID: notificationID, + ActionID: actionID, + UserText: userText, + }) + } +} + func (s *Service) applyCategoryActions(options NotificationOptions) NotificationOptions { if options.CategoryID == "" || len(options.Actions) > 0 { return options diff --git a/go/display/webkit/pkg/notification/service_behaviour_test.go b/go/display/webkit/pkg/notification/service_behaviour_test.go index 69b912d..0e3c9dd 100644 --- a/go/display/webkit/pkg/notification/service_behaviour_test.go +++ b/go/display/webkit/pkg/notification/service_behaviour_test.go @@ -87,3 +87,26 @@ func TestServiceBehaviour_notificationOptionsFrom_Good(t *core.T) { core.AssertNil(t, err) core.AssertEqual(t, "B", fromOpts.Title) } + +func TestServiceBehaviour_toWailsNotificationOptions_Good(t *core.T) { + got := toWailsNotificationOptions(NotificationOptions{ + ID: "n-7", + Title: "Ready", + Message: "Done", + Silent: true, + SoundName: "Ping", + AttachmentPaths: []string{"/tmp/result.png"}, + ThreadID: "jobs", + InterruptionLevel: "active", + ScheduleDelaySeconds: 15, + }) + + core.AssertEqual(t, "n-7", got.ID) + core.RequireTrue(t, got.Sound != nil) + core.AssertTrue(t, got.Sound.Silent) + core.AssertEqual(t, "Ping", got.Sound.Name) + core.AssertLen(t, got.Attachments, 1) + core.AssertEqual(t, "/tmp/result.png", got.Attachments[0].Path) + core.RequireTrue(t, got.Schedule != nil) + core.AssertEqual(t, 15, got.Schedule.DelaySeconds) +} diff --git a/go/display/webkit/pkg/notification/service_test.go b/go/display/webkit/pkg/notification/service_test.go index e57d566..569884a 100644 --- a/go/display/webkit/pkg/notification/service_test.go +++ b/go/display/webkit/pkg/notification/service_test.go @@ -19,6 +19,9 @@ type mockPlatform struct { clearID string lastOpts NotificationOptions sendCalled bool + updateCalled bool + category NotificationCategory + response func(notificationID, actionID, userText string) } func (m *mockPlatform) Send(opts NotificationOptions) resultFailure { @@ -37,6 +40,18 @@ func (m *mockPlatform) Clear(id string) resultFailure { m.clearID = id return m.clearErr } +func (m *mockPlatform) Update(opts NotificationOptions) resultFailure { + m.updateCalled = true + m.lastOpts = opts + return m.sendErr +} +func (m *mockPlatform) RegisterCategory(category NotificationCategory) resultFailure { + m.category = category + return nil +} +func (m *mockPlatform) OnResponse(callback func(notificationID, actionID, userText string)) { + m.response = callback +} // mockDialogPlatform tracks whether MessageDialog was called (for fallback test). type mockDialogPlatform struct { @@ -217,6 +232,46 @@ func TestTaskSend_WithActions_GoodCase(t *core.T) { core.AssertEqual(t, 2, len(mock.lastOpts.Actions)) } +func TestTaskSend_CurrentWailsNotificationFeatures_Good(t *core.T) { + mock, c := newTestService(t) + options := NotificationOptions{ + ID: "build-7", + Title: "Build complete", + Message: "The application is ready.", + Silent: true, + AttachmentPaths: []string{"/tmp/build.png"}, + ThreadID: "builds", + InterruptionLevel: "timeSensitive", + ScheduleDelaySeconds: 5, + Update: true, + } + + r := taskRun(c, "notification.send", TaskSend{Options: options}) + + core.RequireTrue(t, r.OK) + core.AssertTrue(t, mock.updateCalled) + core.AssertEqual(t, options.AttachmentPaths, mock.lastOpts.AttachmentPaths) + core.AssertEqual(t, "timeSensitive", mock.lastOpts.InterruptionLevel) +} + +func TestNotificationResponse_CurrentWailsFeatures_Good(t *core.T) { + mock, c := newTestService(t) + var triggered ActionNotificationActionTriggered + c.RegisterAction(func(_ *core.Core, msg core.Message) core.Result { + if action, ok := msg.(ActionNotificationActionTriggered); ok { + triggered = action + } + return core.Result{OK: true} + }) + + core.RequireTrue(t, mock.response != nil) + mock.response("message-1", "reply", "On my way") + + core.AssertEqual(t, "message-1", triggered.NotificationID) + core.AssertEqual(t, "reply", triggered.ActionID) + core.AssertEqual(t, "On my way", triggered.UserText) +} + func TestTaskSend_RegisteredCategoryActions_GoodCase(t *core.T) { mock, c := newTestService(t) core.RequireTrue(t, taskRun(c, "notification.registerCategory", TaskRegisterCategory{ diff --git a/go/display/webkit/pkg/notification/wails.go b/go/display/webkit/pkg/notification/wails.go index da7f35f..2dc5a61 100644 --- a/go/display/webkit/pkg/notification/wails.go +++ b/go/display/webkit/pkg/notification/wails.go @@ -2,6 +2,7 @@ package notification import ( + core "dappco.re/go" "github.com/wailsapp/wails/v3/pkg/application" wailsnotif "github.com/wailsapp/wails/v3/pkg/services/notifications" ) @@ -34,32 +35,103 @@ func (wp *WailsPlatform) Send(opts NotificationOptions) resultFailure { if wp == nil || wp.service == nil { return nil } - wOpts := wailsnotif.NotificationOptions{ - ID: coalesceID(opts.ID), - Title: opts.Title, - Subtitle: opts.Subtitle, - Body: opts.Message, - CategoryID: opts.CategoryID, - } + wOpts := toWailsNotificationOptions(opts) if len(opts.Actions) > 0 { if err := wp.service.SendNotificationWithActions(wOpts); err != nil { - return err + return core.E("notification.WailsPlatform.Send", "failed to send notification with actions", err) } return nil } if err := wp.service.SendNotification(wOpts); err != nil { - return err + return core.E("notification.WailsPlatform.Send", "failed to send notification", err) + } + return nil +} + +func (wp *WailsPlatform) Update(opts NotificationOptions) resultFailure { + if wp == nil || wp.service == nil { + return nil + } + if err := wp.service.UpdateNotification(toWailsNotificationOptions(opts)); err != nil { + return core.E("notification.WailsPlatform.Update", "failed to update notification", err) } return nil } +func (wp *WailsPlatform) RegisterCategory(category NotificationCategory) resultFailure { + if wp == nil || wp.service == nil { + return nil + } + actions := make([]wailsnotif.NotificationAction, 0, len(category.Actions)) + for _, action := range category.Actions { + actions = append(actions, wailsnotif.NotificationAction{ + ID: action.ID, + Title: action.Title, + Destructive: action.Destructive, + }) + } + wailsCategory := wailsnotif.NotificationCategory{ + ID: category.ID, + Actions: actions, + HasReplyField: category.HasReplyField, + ReplyPlaceholder: category.ReplyPlaceholder, + ReplyButtonTitle: category.ReplyButtonTitle, + } + if err := wp.service.RegisterNotificationCategory(wailsCategory); err != nil { + return core.E("notification.WailsPlatform.RegisterCategory", "failed to register notification category", err) + } + return nil +} + +func (wp *WailsPlatform) OnResponse(callback func(notificationID, actionID, userText string)) { + if wp == nil || wp.service == nil || callback == nil { + return + } + wp.service.OnNotificationResponse(func(result wailsnotif.NotificationResult) { + if result.Error != nil { + return + } + response := result.Response + callback(response.ID, response.ActionIdentifier, response.UserText) + }) +} + +func toWailsNotificationOptions(opts NotificationOptions) wailsnotif.NotificationOptions { + wOpts := wailsnotif.NotificationOptions{ + ID: coalesceID(opts.ID), + Title: opts.Title, + Subtitle: opts.Subtitle, + Body: opts.Message, + CategoryID: opts.CategoryID, + Data: opts.Data, + ThreadID: opts.ThreadID, + InterruptionLevel: opts.InterruptionLevel, + } + if opts.Silent || opts.SoundName != "" { + wOpts.Sound = &wailsnotif.NotificationSound{ + Silent: opts.Silent, + Name: opts.SoundName, + } + } + for _, path := range opts.AttachmentPaths { + wOpts.Attachments = append(wOpts.Attachments, wailsnotif.NotificationAttachment{Path: path}) + } + if opts.ScheduleDelaySeconds != 0 || opts.ScheduleAtUnix != 0 { + wOpts.Schedule = &wailsnotif.NotificationSchedule{ + DelaySeconds: opts.ScheduleDelaySeconds, + At: opts.ScheduleAtUnix, + } + } + return wOpts +} + func (wp *WailsPlatform) RequestPermission() (bool, resultFailure) { if wp == nil || wp.service == nil { return false, nil } granted, err := wp.service.RequestNotificationAuthorization() if err != nil { - return false, err + return false, core.E("notification.WailsPlatform.RequestPermission", "failed to request notification authorisation", err) } return granted, nil } @@ -70,7 +142,7 @@ func (wp *WailsPlatform) CheckPermission() (bool, resultFailure) { } granted, err := wp.service.CheckNotificationAuthorization() if err != nil { - return false, err + return false, core.E("notification.WailsPlatform.CheckPermission", "failed to check notification authorisation", err) } return granted, nil } @@ -88,12 +160,12 @@ func (wp *WailsPlatform) Clear(id string) resultFailure { } if id == "" { if err := wp.service.RemoveAllDeliveredNotifications(); err != nil { - return err + return core.E("notification.WailsPlatform.Clear", "failed to clear delivered notifications", err) } return nil } if err := wp.service.RemoveDeliveredNotification(id); err != nil { - return err + return core.E("notification.WailsPlatform.Clear", "failed to clear delivered notification", err) } return nil } diff --git a/go/display/webkit/pkg/window/platform.go b/go/display/webkit/pkg/window/platform.go index ad1dedb..ef4427c 100644 --- a/go/display/webkit/pkg/window/platform.go +++ b/go/display/webkit/pkg/window/platform.go @@ -14,6 +14,7 @@ type PlatformWindowOptions struct { URL string HTML string JS string + CSS string Width, Height int X, Y int MinWidth, MinHeight int @@ -27,6 +28,21 @@ type PlatformWindowOptions struct { HideOnEscape bool HideOnFocusLost bool DefaultContextMenuDisabled bool + StartState int + BackgroundType int + ScreenID string + Zoom float64 + ZoomControlEnabled bool + Permissions map[uint8]uint8 + OpenInspectorOnStartup bool + MinimiseButtonState int + MaximiseButtonState int + CloseButtonState int + FullscreenButtonState int + DevToolsEnabled bool + IgnoreMouseEvents bool + ContentProtection bool + UseApplicationMenu bool Mac MacWindow Linux LinuxWindow Windows WindowsWindow diff --git a/go/display/webkit/pkg/window/service.go b/go/display/webkit/pkg/window/service.go index ae6510c..d7a0c84 100644 --- a/go/display/webkit/pkg/window/service.go +++ b/go/display/webkit/pkg/window/service.go @@ -650,8 +650,8 @@ func (s *Service) trackWindow(pw PlatformWindow) { } case "resize": if data := e.Data; data != nil { - w, _ := data["w"].(int) - h, _ := data["h"].(int) + w, _ := data["width"].(int) + h, _ := data["height"].(int) coreutil.DispatchAction(s.Core(), "window.resize", ActionWindowResized{Name: e.Name, Width: w, Height: h}) } // Auto-persist OS-driven resize — same rationale as move. @@ -678,6 +678,16 @@ func (s *Service) trackWindow(pw PlatformWindow) { coreutil.DispatchAction(s.Core(), "window.unfullscreen", ActionWindowUnfullscreened{Name: e.Name}) case "ready": coreutil.DispatchAction(s.Core(), "window.ready", ActionWindowRuntimeReady{Name: e.Name}) + case "nonclient-hit": + coreutil.DispatchAction(s.Core(), "window.nonClientHit", e) + case "nonclient-mouse-down": + coreutil.DispatchAction(s.Core(), "window.nonClientMouseDown", e) + case "nonclient-mouse-up": + coreutil.DispatchAction(s.Core(), "window.nonClientMouseUp", e) + case "nonclient-mouse-move": + coreutil.DispatchAction(s.Core(), "window.nonClientMouseMove", e) + case "nonclient-mouse-leave": + coreutil.DispatchAction(s.Core(), "window.nonClientMouseLeave", e) } }) pw.OnFileDrop(func(paths []string, target *DropTarget) { diff --git a/go/display/webkit/pkg/window/wails.go b/go/display/webkit/pkg/window/wails.go index db4bfcd..82f131f 100644 --- a/go/display/webkit/pkg/window/wails.go +++ b/go/display/webkit/pkg/window/wails.go @@ -91,6 +91,7 @@ func (wp *WailsPlatform) CreateWindow(options PlatformWindowOptions) PlatformWin URL: options.URL, HTML: options.HTML, JS: options.JS, + CSS: options.CSS, Width: options.Width, Height: options.Height, InitialPosition: initialPos, @@ -108,24 +109,64 @@ func (wp *WailsPlatform) CreateWindow(options PlatformWindowOptions) PlatformWin HideOnEscape: options.HideOnEscape, HideOnFocusLost: options.HideOnFocusLost, DefaultContextMenuDisabled: options.DefaultContextMenuDisabled, + StartState: application.WindowState(options.StartState), + BackgroundType: application.BackgroundType(options.BackgroundType), + Zoom: options.Zoom, + ZoomControlEnabled: options.ZoomControlEnabled, + Permissions: translatePermissions(options.Permissions), + OpenInspectorOnStartup: options.OpenInspectorOnStartup, + MinimiseButtonState: application.ButtonState(options.MinimiseButtonState), + MaximiseButtonState: application.ButtonState(options.MaximiseButtonState), + CloseButtonState: application.ButtonState(options.CloseButtonState), + FullscreenButtonState: application.ButtonState(options.FullscreenButtonState), + DevToolsEnabled: options.DevToolsEnabled, + IgnoreMouseEvents: options.IgnoreMouseEvents, + ContentProtectionEnabled: options.ContentProtection, + UseApplicationMenu: options.UseApplicationMenu, BackgroundColour: application.NewRGBA(options.BackgroundColour[0], options.BackgroundColour[1], options.BackgroundColour[2], options.BackgroundColour[3]), Mac: application.MacWindow{ - WindowLevel: application.MacWindowLevel(options.Mac.WindowLevel), - CollectionBehavior: application.MacWindowCollectionBehavior(options.Mac.CollectionBehavior), - InvisibleTitleBarHeight: options.Mac.InvisibleTitleBarHeight, + WindowLevel: application.MacWindowLevel(options.Mac.WindowLevel), + CollectionBehavior: application.MacWindowCollectionBehavior(options.Mac.CollectionBehavior), + InvisibleTitleBarHeight: options.Mac.InvisibleTitleBarHeight, + Backdrop: application.MacBackdrop(options.Mac.Backdrop), + DisableShadow: options.Mac.DisableShadow, + TabbingMode: application.MacWindowTabbingMode(options.Mac.TabbingMode), + DisableEscapeExitsFullscreen: options.Mac.DisableEscapeExitsFullscreen, + LiquidGlass: application.MacLiquidGlass{ + Style: application.MacLiquidGlassStyle(options.Mac.LiquidGlassStyle), + Material: application.NSVisualEffectMaterial(options.Mac.LiquidGlassMaterial), + CornerRadius: options.Mac.LiquidGlassCornerRadius, + GroupID: options.Mac.LiquidGlassGroupID, + GroupSpacing: options.Mac.LiquidGlassGroupSpacing, + }, }, Linux: application.LinuxWindow{ Icon: options.Linux.Icon, }, Windows: application.WindowsWindow{ - HiddenOnTaskbar: options.Windows.HiddenOnTaskbar, + HiddenOnTaskbar: options.Windows.HiddenOnTaskbar, + DisableMenu: options.Windows.DisableMenu, + Theme: application.Theme(options.Windows.Theme), + NonClientRegionSupport: options.Windows.NonClientRegionSupport, + WebView2CompositionHosting: options.Windows.WebView2CompositionHosting, + WindowDidMoveDebounceMS: options.Windows.WindowDidMoveDebounceMS, }, } + if options.ScreenID != "" && wp.app.Screen != nil { + wOpts.Screen = wp.app.Screen.GetByID(options.ScreenID) + } if options.Mac.DisableBackForwardNav { // alpha2 moved the preference to an internal optional.Bool — the // field's Set method is the public construction path. wOpts.Mac.WebviewPreferences.AllowsBackForwardNavigationGestures.Set(false) } + if options.Mac.EnableAutoplayWithoutUserAction { + wOpts.Mac.WebviewPreferences.EnableAutoplayWithoutUserAction.Set(true) + } + if tint := options.Mac.LiquidGlassTintColour; tint != nil { + colour := application.NewRGBA((*tint)[0], (*tint)[1], (*tint)[2], (*tint)[3]) + wOpts.Mac.LiquidGlass.TintColor = &colour + } var windowHandle *application.WebviewWindow preloadHook := func(origin string, target preload.Webview) { if target == nil { @@ -172,6 +213,17 @@ func (wp *WailsPlatform) CreateWindow(options PlatformWindowOptions) PlatformWin return &wailsWindow{w: w, app: wp.app, title: options.Title, opacity: 1.0, alwaysOnTop: options.AlwaysOnTop} } +func translatePermissions(input map[uint8]uint8) map[application.PermissionType]application.Permission { + if len(input) == 0 { + return nil + } + output := make(map[application.PermissionType]application.Permission, len(input)) + for kind, policy := range input { + output[application.PermissionType(kind)] = application.Permission(policy) + } + return output +} + // subscribeToNavigationFinished wires a handler that runs on each page-load // completion via Wails's per-window event system. Used when OnPageLoad isn't // available on WebviewWindowOptions (Wails 3 alpha.83). Picks the right @@ -442,20 +494,25 @@ func (ww *wailsWindow) OnWindowEvent(handler func(event WindowEvent)) { // Map common Wails window events to our WindowEvent type. eventMap := map[events.WindowEventType]string{ - events.Common.WindowFocus: "focus", - events.Common.WindowLostFocus: "blur", - events.Common.WindowDidMove: "move", - events.Common.WindowDidResize: "resize", - events.Common.WindowClosing: "close", - events.Common.WindowHide: "hide", - events.Common.WindowShow: "show", - events.Common.WindowMinimise: "minimise", - events.Common.WindowUnMinimise: "unminimise", - events.Common.WindowMaximise: "maximise", - events.Common.WindowUnMaximise: "unmaximise", - events.Common.WindowFullscreen: "fullscreen", - events.Common.WindowUnFullscreen: "unfullscreen", - events.Common.WindowRuntimeReady: "ready", + events.Common.WindowFocus: "focus", + events.Common.WindowLostFocus: "blur", + events.Common.WindowDidMove: "move", + events.Common.WindowDidResize: "resize", + events.Common.WindowClosing: "close", + events.Common.WindowHide: "hide", + events.Common.WindowShow: "show", + events.Common.WindowMinimise: "minimise", + events.Common.WindowUnMinimise: "unminimise", + events.Common.WindowMaximise: "maximise", + events.Common.WindowUnMaximise: "unmaximise", + events.Common.WindowFullscreen: "fullscreen", + events.Common.WindowUnFullscreen: "unfullscreen", + events.Common.WindowRuntimeReady: "ready", + events.Windows.WindowNonClientHit: "nonclient-hit", + events.Windows.WindowNonClientMouseDown: "nonclient-mouse-down", + events.Windows.WindowNonClientMouseUp: "nonclient-mouse-up", + events.Windows.WindowNonClientMouseMove: "nonclient-mouse-move", + events.Windows.WindowNonClientMouseLeave: "nonclient-mouse-leave", } for eventType, eventName := range eventMap { diff --git a/go/display/webkit/pkg/window/window.go b/go/display/webkit/pkg/window/window.go index 28dd53b..6116142 100644 --- a/go/display/webkit/pkg/window/window.go +++ b/go/display/webkit/pkg/window/window.go @@ -14,6 +14,7 @@ type Window struct { URL string HTML string JS string + CSS string Width, Height int X, Y int MinWidth, MinHeight int @@ -27,6 +28,36 @@ type Window struct { HideOnEscape bool HideOnFocusLost bool DefaultContextMenuDisabled bool + // StartState mirrors Wails WindowState: 0 normal, 1 minimised, + // 2 maximised, 3 fullscreen. + StartState int + // BackgroundType mirrors Wails BackgroundType: 0 solid, + // 1 transparent, 2 translucent. + BackgroundType int + // ScreenID targets initial placement at a Wails screen without + // leaking *application.Screen through the adapter boundary. + ScreenID string + // Zoom and ZoomControlEnabled configure the initial WebView zoom. + Zoom float64 + ZoomControlEnabled bool + // Permissions maps Wails permission-kind values to policy values. + // Kinds: 0 microphone, 1 camera, 2 geolocation, + // 3 notifications, 4 clipboard-read. Policies: 0 default, + // 1 allow, 2 deny. + Permissions map[uint8]uint8 + // OpenInspectorOnStartup and DevToolsEnabled control developer tools. + OpenInspectorOnStartup bool + DevToolsEnabled bool + // Native window-button states: 0 enabled, 1 disabled, 2 hidden. + MinimiseButtonState int + MaximiseButtonState int + CloseButtonState int + FullscreenButtonState int + // IgnoreMouseEvents enables click-through windows on macOS/Windows. + IgnoreMouseEvents bool + // UseApplicationMenu opts this window into the application menu on + // Windows and Linux. + UseApplicationMenu bool // HideOnClose: the OS close button hides the window instead of // destroying it. The window stays registered + can be re-shown // via set_visibility. Tray-rooted apps + steady-state windows @@ -58,10 +89,21 @@ type Window struct { // MacWindow holds macOS-specific window options. Zero values mean // platform default. type MacWindow struct { - WindowLevel MacWindowLevel - CollectionBehavior MacCollectionBehavior - InvisibleTitleBarHeight int - DisableBackForwardNav bool + WindowLevel MacWindowLevel + CollectionBehavior MacCollectionBehavior + InvisibleTitleBarHeight int + DisableBackForwardNav bool + Backdrop int + DisableShadow bool + TabbingMode int + DisableEscapeExitsFullscreen bool + EnableAutoplayWithoutUserAction bool + LiquidGlassStyle int + LiquidGlassMaterial int + LiquidGlassCornerRadius float64 + LiquidGlassTintColour *[4]uint8 + LiquidGlassGroupID string + LiquidGlassGroupSpacing float64 } // LinuxWindow holds Linux-specific window options. @@ -71,7 +113,12 @@ type LinuxWindow struct { // WindowsWindow holds Windows-specific window options. type WindowsWindow struct { - HiddenOnTaskbar bool + HiddenOnTaskbar bool + DisableMenu bool + Theme int + NonClientRegionSupport bool + WebView2CompositionHosting bool + WindowDidMoveDebounceMS uint16 } // MacWindowLevel mirrors application.MacWindowLevel (string-typed @@ -102,7 +149,7 @@ const ( // ToPlatformOptions converts a Window to PlatformWindowOptions for the backend. func (w *Window) ToPlatformOptions() PlatformWindowOptions { return PlatformWindowOptions{ - Name: w.Name, Title: w.Title, URL: w.URL, HTML: w.HTML, JS: w.JS, + Name: w.Name, Title: w.Title, URL: w.URL, HTML: w.HTML, JS: w.JS, CSS: w.CSS, Width: w.Width, Height: w.Height, X: w.X, Y: w.Y, MinWidth: w.MinWidth, MinHeight: w.MinHeight, MaxWidth: w.MaxWidth, MaxHeight: w.MaxHeight, @@ -112,6 +159,21 @@ func (w *Window) ToPlatformOptions() PlatformWindowOptions { HideOnEscape: w.HideOnEscape, HideOnFocusLost: w.HideOnFocusLost, DefaultContextMenuDisabled: w.DefaultContextMenuDisabled, + StartState: w.StartState, + BackgroundType: w.BackgroundType, + ScreenID: w.ScreenID, + Zoom: w.Zoom, + ZoomControlEnabled: w.ZoomControlEnabled, + Permissions: w.Permissions, + OpenInspectorOnStartup: w.OpenInspectorOnStartup, + MinimiseButtonState: w.MinimiseButtonState, + MaximiseButtonState: w.MaximiseButtonState, + CloseButtonState: w.CloseButtonState, + FullscreenButtonState: w.FullscreenButtonState, + DevToolsEnabled: w.DevToolsEnabled, + IgnoreMouseEvents: w.IgnoreMouseEvents, + ContentProtection: w.ContentProtection, + UseApplicationMenu: w.UseApplicationMenu, Mac: w.Mac, Linux: w.Linux, Windows: w.Windows, diff --git a/go/display/webkit/pkg/window/window_test.go b/go/display/webkit/pkg/window/window_test.go index 5fe0641..b8d3285 100644 --- a/go/display/webkit/pkg/window/window_test.go +++ b/go/display/webkit/pkg/window/window_test.go @@ -11,6 +11,59 @@ func TestWindowDefaults_Good(t *core.T) { core.AssertEqual(t, 0, w.Width) } +func TestWindowToPlatformOptions_CurrentWailsFeatures_Good(t *core.T) { + tint := &[4]uint8{10, 20, 30, 40} + spec := &Window{ + CSS: "html { app-region: drag; }", + StartState: 2, + BackgroundType: 2, + ScreenID: "screen-2", + Zoom: 1.25, + ZoomControlEnabled: true, + Permissions: map[uint8]uint8{0: 1, 1: 2}, + OpenInspectorOnStartup: true, + FullscreenButtonState: 1, + IgnoreMouseEvents: true, + ContentProtection: true, + UseApplicationMenu: true, + Mac: MacWindow{ + Backdrop: 3, + DisableShadow: true, + TabbingMode: 3, + DisableEscapeExitsFullscreen: true, + EnableAutoplayWithoutUserAction: true, + LiquidGlassStyle: 2, + LiquidGlassMaterial: -1, + LiquidGlassCornerRadius: 18, + LiquidGlassTintColour: tint, + LiquidGlassGroupID: "utility", + LiquidGlassGroupSpacing: 8, + }, + Windows: WindowsWindow{ + DisableMenu: true, + Theme: 1, + NonClientRegionSupport: true, + WebView2CompositionHosting: true, + WindowDidMoveDebounceMS: 25, + }, + } + + got := spec.ToPlatformOptions() + + core.AssertEqual(t, spec.CSS, got.CSS) + core.AssertEqual(t, spec.StartState, got.StartState) + core.AssertEqual(t, spec.BackgroundType, got.BackgroundType) + core.AssertEqual(t, spec.ScreenID, got.ScreenID) + core.AssertEqual(t, spec.Zoom, got.Zoom) + core.AssertEqual(t, spec.Permissions[1], got.Permissions[1]) + core.AssertTrue(t, got.OpenInspectorOnStartup) + core.AssertTrue(t, got.ContentProtection) + core.AssertTrue(t, got.Mac.DisableEscapeExitsFullscreen) + core.AssertEqual(t, tint, got.Mac.LiquidGlassTintColour) + core.AssertTrue(t, got.Windows.NonClientRegionSupport) + core.AssertTrue(t, got.Windows.WebView2CompositionHosting) +} + func TestWindowOption_Name_Good(t *core.T) { // Name ax7Variant := "Name:good" diff --git a/go/display/webkit/service.go b/go/display/webkit/service.go index 483af80..8e9ddd9 100644 --- a/go/display/webkit/service.go +++ b/go/display/webkit/service.go @@ -182,8 +182,9 @@ type GuiConfig struct { // carve out platform-internal routes (e.g. /wails/*) before the user // handler sees them. type AssetOptions struct { - Handler http.Handler - Middleware MiddlewareFunc + Handler http.Handler + Middleware MiddlewareFunc + DisableLogging bool } // MiddlewareFunc wraps a downstream HTTP handler. Mirrors the stdlib @@ -213,6 +214,21 @@ type WindowsOptions struct { // (e.g. "msWebView2EnableDraggableRegions" for --wails-draggable // CSS support). EnabledFeatures []string + // DisabledFeatures explicitly disables named WebView2 feature flags. + DisabledFeatures []string + // AdditionalBrowserArgs passes process-wide switches to WebView2. + // Entries include their "--" prefix. + AdditionalBrowserArgs []string + // UseVisualHosting selects WebView2's DirectComposition visual + // hosting. It avoids the monitor-scale re-marshalling path that can + // stall remote-desktop sessions and is configured before app.Run. + UseVisualHosting bool + // WndClass overrides the native Windows window class. + WndClass string + // WebviewUserDataPath overrides WebView2's user-data directory. + WebviewUserDataPath string + // WebviewBrowserPath selects a fixed WebView2 runtime directory. + WebviewBrowserPath string } // ActivationPolicy is the macOS activation kind. Mirrors the wails diff --git a/go/display/webkit/service_test.go b/go/display/webkit/service_test.go index 4d801bf..57a13d0 100644 --- a/go/display/webkit/service_test.go +++ b/go/display/webkit/service_test.go @@ -135,3 +135,31 @@ func TestService_Service_OnShutdown_Ugly(t *core.T) { t.FailNow() } } + +func TestBuildWailsOptions_CurrentWailsFeatures_Good(t *core.T) { + cfg := GuiConfig{ + Assets: AssetOptions{DisableLogging: true}, + Windows: WindowsOptions{ + WndClass: "CoreWindow", + WebviewUserDataPath: `C:\Core\WebView`, + WebviewBrowserPath: `C:\WebView2`, + EnabledFeatures: []string{"enabled"}, + DisabledFeatures: []string{"disabled"}, + AdditionalBrowserArgs: []string{"--remote-debugging-port=9222"}, + UseVisualHosting: true, + DisableQuitOnLastWindowClosed: true, + }, + } + + got := buildWailsOptions(cfg) + + core.AssertTrue(t, got.Assets.DisableLogging) + core.AssertEqual(t, "CoreWindow", got.Windows.WndClass) + core.AssertEqual(t, `C:\Core\WebView`, got.Windows.WebviewUserDataPath) + core.AssertEqual(t, `C:\WebView2`, got.Windows.WebviewBrowserPath) + core.AssertEqual(t, []string{"enabled"}, got.Windows.EnabledFeatures) + core.AssertEqual(t, []string{"disabled"}, got.Windows.DisabledFeatures) + core.AssertEqual(t, []string{"--remote-debugging-port=9222"}, got.Windows.AdditionalBrowserArgs) + core.AssertTrue(t, got.Windows.UseVisualHosting) + core.AssertTrue(t, got.Windows.DisableQuitOnLastWindowClosed) +} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/.browserslistrc b/go/display/webkit/ui/node_modules.bak/@angular/build/.browserslistrc deleted file mode 100755 index 41deb91..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/.browserslistrc +++ /dev/null @@ -1,7 +0,0 @@ -Chrome >= 107 -ChromeAndroid >= 107 -Edge >= 107 -Firefox >= 104 -FirefoxAndroid >= 104 -Safari >= 16 -iOS >= 16 diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/LICENSE b/go/display/webkit/ui/node_modules.bak/@angular/build/LICENSE deleted file mode 100755 index 48adc1e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2010-2025 Google LLC. https://angular.dev/license - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/README.md b/go/display/webkit/ui/node_modules.bak/@angular/build/README.md deleted file mode 100755 index 62249f7..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Angular Build System for Applications and Libraries - -The sources for this package are in the [Angular CLI](https://github.com/angular/angular-cli) repository. Please file issues and pull requests against that repository. - -Usage information and reference details can be found in repository [README](https://github.com/angular/angular-cli/blob/main/README.md) file. diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/builders.json b/go/display/webkit/ui/node_modules.bak/@angular/build/builders.json deleted file mode 100755 index 4dc9c9c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/builders.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "builders": { - "application": { - "implementation": "./src/builders/application/index", - "schema": "./src/builders/application/schema.json", - "description": "Build an application." - }, - "dev-server": { - "implementation": "./src/builders/dev-server/index", - "schema": "./src/builders/dev-server/schema.json", - "description": "Execute a development server for an application." - }, - "extract-i18n": { - "implementation": "./src/builders/extract-i18n/index", - "schema": "./src/builders/extract-i18n/schema.json", - "description": "Extract i18n messages from an application." - }, - "karma": { - "implementation": "./src/builders/karma", - "schema": "./src/builders/karma/schema.json", - "description": "Run Karma unit tests." - }, - "ng-packagr": { - "implementation": "./src/builders/ng-packagr/index", - "schema": "./src/builders/ng-packagr/schema.json", - "description": "Build a library with ng-packagr." - }, - "unit-test": { - "implementation": "./src/builders/unit-test", - "schema": "./src/builders/unit-test/schema.json", - "description": "[EXPERIMENTAL] Run application unit tests." - } - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/index.d.ts deleted file mode 100755 index 9671938..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export * from './src/index'; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/index.js deleted file mode 100755 index fa26cc1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/index.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./src/index"), exports); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/package.json b/go/display/webkit/ui/node_modules.bak/@angular/build/package.json deleted file mode 100755 index 91828ad..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/package.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "name": "@angular/build", - "version": "20.3.9", - "description": "Official build system for Angular", - "keywords": [ - "Angular CLI", - "Angular DevKit", - "angular", - "angular-cli", - "devkit", - "sdk" - ], - "exports": { - ".": { - "types": "./src/index.d.ts", - "default": "./src/index.js" - }, - "./private": { - "default": "./src/private.js" - }, - "./package.json": "./package.json" - }, - "builders": "builders.json", - "dependencies": { - "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "0.2003.9", - "@babel/core": "7.28.3", - "@babel/helper-annotate-as-pure": "7.27.3", - "@babel/helper-split-export-declaration": "7.24.7", - "@inquirer/confirm": "5.1.14", - "@vitejs/plugin-basic-ssl": "2.1.0", - "beasties": "0.3.5", - "browserslist": "^4.23.0", - "esbuild": "0.25.9", - "https-proxy-agent": "7.0.6", - "istanbul-lib-instrument": "6.0.3", - "jsonc-parser": "3.3.1", - "listr2": "9.0.1", - "magic-string": "0.30.17", - "mrmime": "2.0.1", - "parse5-html-rewriting-stream": "8.0.0", - "picomatch": "4.0.3", - "piscina": "5.1.3", - "rollup": "4.52.3", - "sass": "1.90.0", - "semver": "7.7.2", - "source-map-support": "0.5.21", - "tinyglobby": "0.2.14", - "vite": "7.1.11", - "watchpack": "2.4.4" - }, - "optionalDependencies": { - "lmdb": "3.4.2" - }, - "peerDependencies": { - "@angular/core": "^20.0.0", - "@angular/compiler": "^20.0.0", - "@angular/compiler-cli": "^20.0.0", - "@angular/localize": "^20.0.0", - "@angular/platform-browser": "^20.0.0", - "@angular/platform-server": "^20.0.0", - "@angular/service-worker": "^20.0.0", - "@angular/ssr": "^20.3.9", - "karma": "^6.4.0", - "less": "^4.2.0", - "ng-packagr": "^20.0.0", - "postcss": "^8.4.0", - "tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0", - "tslib": "^2.3.0", - "typescript": ">=5.8 <6.0", - "vitest": "^3.1.1" - }, - "peerDependenciesMeta": { - "@angular/core": { - "optional": true - }, - "@angular/localize": { - "optional": true - }, - "@angular/platform-browser": { - "optional": true - }, - "@angular/platform-server": { - "optional": true - }, - "@angular/service-worker": { - "optional": true - }, - "@angular/ssr": { - "optional": true - }, - "karma": { - "optional": true - }, - "less": { - "optional": true - }, - "ng-packagr": { - "optional": true - }, - "postcss": { - "optional": true - }, - "tailwindcss": { - "optional": true - }, - "vitest": { - "optional": true - } - }, - "repository": { - "type": "git", - "url": "https://github.com/angular/angular-cli.git" - }, - "packageManager": "pnpm@10.19.0", - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0", - "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", - "yarn": ">= 1.13.0" - }, - "author": "Angular Authors", - "license": "MIT", - "bugs": { - "url": "https://github.com/angular/angular-cli/issues" - }, - "homepage": "https://github.com/angular/angular-cli" -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/private/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/private/index.d.ts deleted file mode 100755 index 35def59..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/private/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export * from '../src/private'; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/private/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/private/index.js deleted file mode 100755 index c46a7ba..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/private/index.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("../src/private"), exports); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/build-action.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/build-action.d.ts deleted file mode 100755 index 49f8261..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/build-action.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BuilderContext } from '@angular-devkit/architect'; -import { ExecutionResult, RebuildState } from '../../tools/esbuild/bundler-execution-result'; -import { NormalizedCachedOptions } from '../../utils/normalize-cache'; -import { NormalizedOutputOptions } from './options'; -import { Result } from './results'; -export declare function runEsBuildBuildAction(action: (rebuildState?: RebuildState) => Promise, options: { - workspaceRoot: string; - projectRoot: string; - outputOptions: NormalizedOutputOptions; - logger: BuilderContext['logger']; - cacheOptions: NormalizedCachedOptions; - watch?: boolean; - verbose?: boolean; - progress?: boolean; - poll?: number; - signal?: AbortSignal; - preserveSymlinks?: boolean; - clearScreen?: boolean; - colors?: boolean; - jsonLogs?: boolean; - incrementalResults?: boolean; -}): AsyncIterable; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/build-action.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/build-action.js deleted file mode 100755 index 7eca30d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/build-action.js +++ /dev/null @@ -1,354 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.runEsBuildBuildAction = runEsBuildBuildAction; -const node_fs_1 = require("node:fs"); -const node_path_1 = __importDefault(require("node:path")); -const bundler_context_1 = require("../../tools/esbuild/bundler-context"); -const sass_language_1 = require("../../tools/esbuild/stylesheets/sass-language"); -const utils_1 = require("../../tools/esbuild/utils"); -const environment_options_1 = require("../../utils/environment-options"); -const path_1 = require("../../utils/path"); -const results_1 = require("./results"); -// Watch workspace for package manager changes -const packageWatchFiles = [ - // manifest can affect module resolution - 'package.json', - // npm lock file - 'package-lock.json', - // pnpm lock file - 'pnpm-lock.yaml', - // yarn lock file including Yarn PnP manifest files (https://yarnpkg.com/advanced/pnp-spec/) - 'yarn.lock', - '.pnp.cjs', - '.pnp.data.json', -]; -async function* runEsBuildBuildAction(action, options) { - const { watch, poll, clearScreen, logger, cacheOptions, outputOptions, verbose, projectRoot, workspaceRoot, progress, preserveSymlinks, colors, jsonLogs, incrementalResults, } = options; - const withProgress = progress ? utils_1.withSpinner : utils_1.withNoProgress; - // Initial build - let result; - try { - // Perform the build action - result = await withProgress('Building...', () => action()); - // Log all diagnostic (error/warning/logs) messages - await (0, utils_1.logMessages)(logger, result, colors, jsonLogs); - } - finally { - // Ensure Sass workers are shutdown if not watching - if (!watch) { - (0, sass_language_1.shutdownSassWorkerPool)(); - } - } - // Setup watcher if watch mode enabled - let watcher; - if (watch) { - if (progress) { - logger.info('Watch mode enabled. Watching for file changes...'); - } - const ignored = [ - // Ignore the output and cache paths to avoid infinite rebuild cycles - outputOptions.base, - cacheOptions.basePath, - `${(0, path_1.toPosixPath)(workspaceRoot)}/**/.*/**`, - ]; - // Setup a watcher - const { createWatcher } = await Promise.resolve().then(() => __importStar(require('../../tools/esbuild/watcher'))); - watcher = createWatcher({ - polling: typeof poll === 'number', - interval: poll, - followSymlinks: preserveSymlinks, - ignored, - }); - // Setup abort support - options.signal?.addEventListener('abort', () => void watcher?.close()); - // Watch the entire project root if 'NG_BUILD_WATCH_ROOT' environment variable is set - if (environment_options_1.shouldWatchRoot) { - if (!preserveSymlinks) { - // Ignore all node modules directories to avoid excessive file watchers. - // Package changes are handled below by watching manifest and lock files. - // NOTE: this is not enable when preserveSymlinks is true as this would break `npm link` usages. - ignored.push('**/node_modules/**'); - watcher.add(packageWatchFiles - .map((file) => node_path_1.default.join(workspaceRoot, file)) - .filter((file) => (0, node_fs_1.existsSync)(file))); - } - watcher.add(projectRoot); - } - // Watch locations provided by the initial build result - watcher.add(result.watchFiles); - } - // Output the first build results after setting up the watcher to ensure that any code executed - // higher in the iterator call stack will trigger the watcher. This is particularly relevant for - // unit tests which execute the builder and modify the file system programmatically. - yield* emitOutputResults(result, outputOptions); - // Finish if watch mode is not enabled - if (!watcher) { - return; - } - // Used to force a full result on next rebuild if there were initial errors. - // This ensures at least one full result is emitted. - let hasInitialErrors = result.errors.length > 0; - // Wait for changes and rebuild as needed - const currentWatchFiles = new Set(result.watchFiles); - try { - for await (const changes of watcher) { - if (options.signal?.aborted) { - break; - } - if (clearScreen) { - // eslint-disable-next-line no-console - console.clear(); - } - if (verbose) { - logger.info(changes.toDebugString()); - } - // Clear removed files from current watch files - changes.removed.forEach((removedPath) => currentWatchFiles.delete(removedPath)); - const rebuildState = result.createRebuildState(changes); - result = await withProgress('Changes detected. Rebuilding...', () => action(rebuildState)); - // Log all diagnostic (error/warning/logs) messages - await (0, utils_1.logMessages)(logger, result, colors, jsonLogs); - // Update watched locations provided by the new build result. - // Keep watching all previous files if there are any errors; otherwise consider all - // files stale until confirmed present in the new result's watch files. - const staleWatchFiles = result.errors.length > 0 ? undefined : new Set(currentWatchFiles); - for (const watchFile of result.watchFiles) { - if (!currentWatchFiles.has(watchFile)) { - // Add new watch location - watcher.add(watchFile); - currentWatchFiles.add(watchFile); - } - // Present so remove from stale locations - staleWatchFiles?.delete(watchFile); - } - // Remove any stale locations if the build was successful - if (staleWatchFiles?.size) { - watcher.remove([...staleWatchFiles]); - } - for (const outputResult of emitOutputResults(result, outputOptions, changes, incrementalResults && !hasInitialErrors ? rebuildState : undefined)) { - yield outputResult; - } - // Clear initial build errors flag if no errors are now present - hasInitialErrors &&= result.errors.length > 0; - } - } - finally { - // Stop the watcher and cleanup incremental rebuild state - await Promise.allSettled([watcher.close(), result.dispose()]); - (0, sass_language_1.shutdownSassWorkerPool)(); - } -} -function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externalMetadata, htmlIndexPath, htmlBaseHref, templateUpdates, }, outputOptions, changes, rebuildState) { - if (errors.length > 0) { - yield { - kind: results_1.ResultKind.Failure, - errors: errors, - warnings: warnings, - detail: { - outputOptions, - }, - }; - return; - } - // Use a full result if there is no rebuild state (no prior build result) - if (!rebuildState || !changes) { - const result = { - kind: results_1.ResultKind.Full, - warnings: warnings, - files: {}, - detail: { - externalMetadata, - htmlIndexPath, - htmlBaseHref, - outputOptions, - }, - }; - for (const file of assetFiles) { - result.files[file.destination] = { - type: bundler_context_1.BuildOutputFileType.Browser, - inputPath: file.source, - origin: 'disk', - }; - } - for (const file of outputFiles) { - result.files[file.path] = { - type: file.type, - contents: file.contents, - origin: 'memory', - hash: file.hash, - }; - } - yield result; - return; - } - // Template updates only exist if no other JS changes have occurred. - // A full page reload may be required based on the following incremental output change analysis. - const hasTemplateUpdates = !!templateUpdates?.size; - // Use an incremental result if previous output information is available - const { previousAssetsInfo, previousOutputInfo } = rebuildState; - const incrementalResult = { - kind: results_1.ResultKind.Incremental, - warnings: warnings, - // Initially attempt to use a background update of files to support component updates. - background: hasTemplateUpdates, - added: [], - removed: [], - modified: [], - files: {}, - detail: { - externalMetadata, - htmlIndexPath, - htmlBaseHref, - outputOptions, - }, - }; - let hasCssUpdates = false; - // Initially assume all previous output files have been removed - const removedOutputFiles = new Map(previousOutputInfo); - for (const file of outputFiles) { - removedOutputFiles.delete(file.path); - const previousHash = previousOutputInfo.get(file.path)?.hash; - let needFile = false; - if (previousHash === undefined) { - needFile = true; - incrementalResult.added.push(file.path); - } - else if (previousHash !== file.hash) { - needFile = true; - incrementalResult.modified.push(file.path); - } - if (needFile) { - if (file.path.endsWith('.css')) { - hasCssUpdates = true; - } - else if (!canBackgroundUpdate(file)) { - incrementalResult.background = false; - } - incrementalResult.files[file.path] = { - type: file.type, - contents: file.contents, - origin: 'memory', - hash: file.hash, - }; - } - } - // Initially assume all previous assets files have been removed - const removedAssetFiles = new Map(previousAssetsInfo); - for (const { source, destination } of assetFiles) { - removedAssetFiles.delete(source); - if (!previousAssetsInfo.has(source)) { - incrementalResult.added.push(destination); - incrementalResult.background = false; - } - else if (changes.modified.has(source)) { - incrementalResult.modified.push(destination); - incrementalResult.background = false; - } - else { - continue; - } - hasCssUpdates ||= destination.endsWith('.css'); - incrementalResult.files[destination] = { - type: bundler_context_1.BuildOutputFileType.Browser, - inputPath: source, - origin: 'disk', - }; - } - // Do not remove stale files yet if there are template updates. - // Component chunk files may still be referenced in running browser code. - // Module evaluation time component updates will update any of these files. - // This typically occurs when a lazy component is changed that has not yet - // been accessed at runtime. - if (hasTemplateUpdates && incrementalResult.background) { - removedOutputFiles.clear(); - } - // Include the removed output and asset files - incrementalResult.removed.push(...Array.from(removedOutputFiles, ([file, { type }]) => ({ - path: file, - type, - })), ...Array.from(removedAssetFiles.values(), (file) => ({ - path: file, - type: bundler_context_1.BuildOutputFileType.Browser, - }))); - yield incrementalResult; - // If there are template updates and the incremental update was background only, a component - // update is possible. - if (hasTemplateUpdates && incrementalResult.background) { - // Template changes may be accompanied by stylesheet changes and these should also be updated hot when possible. - if (hasCssUpdates) { - const styleResult = { - kind: results_1.ResultKind.Incremental, - added: incrementalResult.added.filter(isCssFilePath), - removed: incrementalResult.removed.filter(({ path }) => isCssFilePath(path)), - modified: incrementalResult.modified.filter(isCssFilePath), - files: Object.fromEntries(Object.entries(incrementalResult.files).filter(([path]) => isCssFilePath(path))), - }; - yield styleResult; - } - const updateResult = { - kind: results_1.ResultKind.ComponentUpdate, - updates: Array.from(templateUpdates, ([id, content]) => ({ - type: 'template', - id, - content, - })), - }; - yield updateResult; - } -} -function isCssFilePath(filePath) { - return /\.css(?:\.map)?$/i.test(filePath); -} -function canBackgroundUpdate(file) { - // Files in the output root are not served and do not affect the - // application available with the development server. - if (file.type === bundler_context_1.BuildOutputFileType.Root) { - return true; - } - // Updates to non-JS files must signal an update with the dev server - // except the service worker configuration which is special cased. - return /(?:\.m?js|\.map)$/.test(file.path) || file.path === 'ngsw.json'; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/chunk-optimizer.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/chunk-optimizer.d.ts deleted file mode 100755 index 21c79f5..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/chunk-optimizer.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BundleContextResult } from '../../tools/esbuild/bundler-context'; -/** - * Optimizes the chunks of a build result using rolldown. - * - * This function takes the output of an esbuild build, identifies the main browser entry point, - * and uses rolldown to bundle and optimize the JavaScript chunks. The optimized chunks - * replace the original ones in the build result, and the metafile is updated to reflect - * the changes. - * - * @param original The original build result from esbuild. - * @param sourcemap A boolean or 'hidden' to control sourcemap generation. - * @returns A promise that resolves to the updated build result with optimized chunks. - */ -export declare function optimizeChunks(original: BundleContextResult, sourcemap: boolean | 'hidden'): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/chunk-optimizer.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/chunk-optimizer.js deleted file mode 100755 index 959f08d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/chunk-optimizer.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.optimizeChunks = optimizeChunks; -const node_assert_1 = __importDefault(require("node:assert")); -const rollup_1 = require("rollup"); -const bundler_context_1 = require("../../tools/esbuild/bundler-context"); -const utils_1 = require("../../tools/esbuild/utils"); -const error_1 = require("../../utils/error"); -/** - * Converts the output of a rolldown build into an esbuild-compatible metafile. - * @param rolldownOutput The output of a rolldown build. - * @param originalMetafile The original esbuild metafile from the build. - * @returns An esbuild-compatible metafile. - */ -function rolldownToEsbuildMetafile(rolldownOutput, originalMetafile) { - const newMetafile = { - inputs: originalMetafile.inputs, - outputs: {}, - }; - const intermediateChunkSizes = {}; - for (const [path, output] of Object.entries(originalMetafile.outputs)) { - intermediateChunkSizes[path] = Object.values(output.inputs).reduce((s, i) => s + i.bytesInOutput, 0); - } - for (const chunk of rolldownOutput) { - if (chunk.type === 'asset') { - newMetafile.outputs[chunk.fileName] = { - bytes: typeof chunk.source === 'string' - ? Buffer.byteLength(chunk.source, 'utf8') - : chunk.source.length, - inputs: {}, - imports: [], - exports: [], - }; - continue; - } - const newOutputInputs = {}; - if (chunk.modules) { - for (const [moduleId, renderedModule] of Object.entries(chunk.modules)) { - const originalOutputEntry = originalMetafile.outputs[moduleId]; - if (!originalOutputEntry?.inputs) { - continue; - } - const totalOriginalBytesInModule = intermediateChunkSizes[moduleId]; - if (totalOriginalBytesInModule === 0) { - continue; - } - for (const [originalInputPath, originalInputInfo] of Object.entries(originalOutputEntry.inputs)) { - const proportion = originalInputInfo.bytesInOutput / totalOriginalBytesInModule; - const newBytesInOutput = Math.floor(renderedModule.renderedLength * proportion); - const existing = newOutputInputs[originalInputPath]; - if (existing) { - existing.bytesInOutput += newBytesInOutput; - } - else { - newOutputInputs[originalInputPath] = { bytesInOutput: newBytesInOutput }; - } - if (!newMetafile.inputs[originalInputPath]) { - newMetafile.inputs[originalInputPath] = originalMetafile.inputs[originalInputPath]; - } - } - } - } - const imports = [ - ...chunk.imports.map((path) => ({ path, kind: 'import-statement' })), - ...(chunk.dynamicImports?.map((path) => ({ path, kind: 'dynamic-import' })) ?? []), - ]; - newMetafile.outputs[chunk.fileName] = { - bytes: Buffer.byteLength(chunk.code, 'utf8'), - inputs: newOutputInputs, - imports, - exports: chunk.exports ?? [], - entryPoint: chunk.isEntry && chunk.facadeModuleId - ? originalMetafile.outputs[chunk.facadeModuleId]?.entryPoint - : undefined, - }; - } - return newMetafile; -} -/** - * Creates an InitialFileRecord object with a specified depth. - * @param depth The depth of the file in the dependency graph. - * @returns An InitialFileRecord object. - */ -function createInitialFileRecord(depth) { - return { - type: 'script', - entrypoint: false, - external: false, - serverFile: false, - depth, - }; -} -/** - * Creates an esbuild message object for a chunk optimization failure. - * @param message The error message detailing the cause of the failure. - * @returns A partial esbuild message object. - */ -function createChunkOptimizationFailureMessage(message) { - // Most of these fields are not actually needed for printing the error - return { - id: '', - text: 'Chunk optimization failed', - detail: undefined, - pluginName: '', - location: null, - notes: [ - { - text: message, - location: null, - }, - ], - }; -} -/** - * Optimizes the chunks of a build result using rolldown. - * - * This function takes the output of an esbuild build, identifies the main browser entry point, - * and uses rolldown to bundle and optimize the JavaScript chunks. The optimized chunks - * replace the original ones in the build result, and the metafile is updated to reflect - * the changes. - * - * @param original The original build result from esbuild. - * @param sourcemap A boolean or 'hidden' to control sourcemap generation. - * @returns A promise that resolves to the updated build result with optimized chunks. - */ -async function optimizeChunks(original, sourcemap) { - // Failed builds cannot be optimized - if (original.errors) { - return original; - } - // Find the main browser entrypoint - let mainFile; - for (const [file, record] of original.initialFiles) { - if (record.name === 'main' && - record.entrypoint && - !record.serverFile && - record.type === 'script') { - mainFile = file; - break; - } - } - // No action required if no browser main entrypoint or metafile for stats - if (!mainFile || !original.metafile) { - return original; - } - const chunks = {}; - const maps = {}; - for (const originalFile of original.outputFiles) { - if (originalFile.type !== bundler_context_1.BuildOutputFileType.Browser) { - continue; - } - if (originalFile.path.endsWith('.js')) { - chunks[originalFile.path] = originalFile; - } - else if (originalFile.path.endsWith('.js.map')) { - // Create mapping of JS file to sourcemap content - maps[originalFile.path.slice(0, -4)] = originalFile; - } - } - const usedChunks = new Set(); - let bundle; - let optimizedOutput; - try { - bundle = await (0, rollup_1.rollup)({ - input: mainFile, - plugins: [ - { - name: 'angular-bundle', - resolveId(source) { - // Remove leading `./` if present - const file = source[0] === '.' && source[1] === '/' ? source.slice(2) : source; - if (chunks[file]) { - return file; - } - // All other identifiers are considered external to maintain behavior - return { id: source, external: true }; - }, - load(id) { - (0, node_assert_1.default)(chunks[id], `Angular chunk content should always be present in chunk optimizer [${id}].`); - usedChunks.add(id); - const result = { - code: chunks[id].text, - map: maps[id]?.text, - }; - return result; - }, - }, - ], - }); - const result = await bundle.generate({ - compact: true, - sourcemap, - chunkFileNames: (chunkInfo) => `${chunkInfo.name.replace(/-[a-zA-Z0-9]{8}$/, '')}-[hash].js`, - }); - optimizedOutput = result.output; - } - catch (e) { - (0, error_1.assertIsError)(e); - return { - errors: [createChunkOptimizationFailureMessage(e.message)], - warnings: original.warnings, - }; - } - finally { - await bundle?.close(); - } - // Update metafile - const newMetafile = rolldownToEsbuildMetafile(optimizedOutput, original.metafile); - // Add back the outputs that were not part of the optimization - for (const [path, output] of Object.entries(original.metafile.outputs)) { - if (usedChunks.has(path)) { - continue; - } - newMetafile.outputs[path] = output; - for (const inputPath of Object.keys(output.inputs)) { - if (!newMetafile.inputs[inputPath]) { - newMetafile.inputs[inputPath] = original.metafile.inputs[inputPath]; - } - } - } - original.metafile = newMetafile; - // Remove used chunks and associated sourcemaps from the original result - original.outputFiles = original.outputFiles.filter((file) => !usedChunks.has(file.path) && - !(file.path.endsWith('.map') && usedChunks.has(file.path.slice(0, -4)))); - // Add new optimized chunks - const importsPerFile = {}; - for (const optimizedFile of optimizedOutput) { - if (optimizedFile.type !== 'chunk') { - continue; - } - importsPerFile[optimizedFile.fileName] = optimizedFile.imports; - original.outputFiles.push((0, utils_1.createOutputFile)(optimizedFile.fileName, optimizedFile.code, bundler_context_1.BuildOutputFileType.Browser)); - if (optimizedFile.map && optimizedFile.sourcemapFileName) { - original.outputFiles.push((0, utils_1.createOutputFile)(optimizedFile.sourcemapFileName, optimizedFile.map.toString(), bundler_context_1.BuildOutputFileType.Browser)); - } - } - // Update initial files to reflect optimized chunks - const entriesToAnalyze = []; - for (const usedFile of usedChunks) { - // Leave the main file since its information did not change - if (usedFile === mainFile) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - entriesToAnalyze.push([mainFile, original.initialFiles.get(mainFile)]); - continue; - } - // Remove all other used chunks - original.initialFiles.delete(usedFile); - } - // Analyze for transitive initial files - let currentEntry; - while ((currentEntry = entriesToAnalyze.pop())) { - const [entryPath, entryRecord] = currentEntry; - for (const importPath of importsPerFile[entryPath]) { - const existingRecord = original.initialFiles.get(importPath); - if (existingRecord) { - // Store the smallest value depth - if (existingRecord.depth > entryRecord.depth + 1) { - existingRecord.depth = entryRecord.depth + 1; - } - continue; - } - const record = createInitialFileRecord(entryRecord.depth + 1); - entriesToAnalyze.push([importPath, record]); - } - } - return original; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-build.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-build.d.ts deleted file mode 100755 index 5e980e6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-build.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BuilderContext } from '@angular-devkit/architect'; -import { ExecutionResult, RebuildState } from '../../tools/esbuild/bundler-execution-result'; -import { NormalizedApplicationBuildOptions } from './options'; -export declare function executeBuild(options: NormalizedApplicationBuildOptions, context: BuilderContext, rebuildState?: RebuildState): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-build.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-build.js deleted file mode 100755 index 1097813..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-build.js +++ /dev/null @@ -1,249 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.executeBuild = executeBuild; -const compilation_1 = require("../../tools/angular/compilation"); -const source_file_cache_1 = require("../../tools/esbuild/angular/source-file-cache"); -const budget_stats_1 = require("../../tools/esbuild/budget-stats"); -const bundler_context_1 = require("../../tools/esbuild/bundler-context"); -const bundler_execution_result_1 = require("../../tools/esbuild/bundler-execution-result"); -const commonjs_checker_1 = require("../../tools/esbuild/commonjs-checker"); -const license_extractor_1 = require("../../tools/esbuild/license-extractor"); -const profiling_1 = require("../../tools/esbuild/profiling"); -const utils_1 = require("../../tools/esbuild/utils"); -const bundle_calculator_1 = require("../../utils/bundle-calculator"); -const environment_options_1 = require("../../utils/environment-options"); -const resolve_assets_1 = require("../../utils/resolve-assets"); -const manifest_1 = require("../../utils/server-rendering/manifest"); -const supported_browsers_1 = require("../../utils/supported-browsers"); -const execute_post_bundle_1 = require("./execute-post-bundle"); -const i18n_1 = require("./i18n"); -const setup_bundling_1 = require("./setup-bundling"); -// eslint-disable-next-line max-lines-per-function -async function executeBuild(options, context, rebuildState) { - const { projectRoot, workspaceRoot, i18nOptions, optimizationOptions, assets, cacheOptions, serverEntryPoint, baseHref, ssrOptions, verbose, colors, jsonLogs, } = options; - // TODO: Consider integrating into watch mode. Would require full rebuild on target changes. - const browsers = (0, supported_browsers_1.getSupportedBrowsers)(projectRoot, context.logger); - // Load active translations if inlining - // TODO: Integrate into watch mode and only load changed translations - if (i18nOptions.shouldInline) { - await (0, i18n_1.loadActiveTranslations)(context, i18nOptions); - } - // Reuse rebuild state or create new bundle contexts for code and global stylesheets - let bundlerContexts; - let componentStyleBundler; - let codeBundleCache; - let bundlingResult; - let templateUpdates; - if (rebuildState) { - bundlerContexts = rebuildState.rebuildContexts; - componentStyleBundler = rebuildState.componentStyleBundler; - codeBundleCache = rebuildState.codeBundleCache; - templateUpdates = rebuildState.templateUpdates; - // Reset template updates for new rebuild - templateUpdates?.clear(); - const allFileChanges = rebuildState.fileChanges.all; - // Bundle all contexts that do not require TypeScript changed file checks. - // These will automatically use cached results based on the changed files. - bundlingResult = await bundler_context_1.BundlerContext.bundleAll(bundlerContexts.otherContexts, allFileChanges); - // Check the TypeScript code bundling cache for changes. If invalid, force a rebundle of - // all TypeScript related contexts. - const forceTypeScriptRebuild = codeBundleCache?.invalidate(allFileChanges); - const typescriptResults = []; - for (const typescriptContext of bundlerContexts.typescriptContexts) { - typescriptContext.invalidate(allFileChanges); - const result = await typescriptContext.bundle(forceTypeScriptRebuild); - typescriptResults.push(result); - } - bundlingResult = bundler_context_1.BundlerContext.mergeResults([bundlingResult, ...typescriptResults]); - } - else { - const target = (0, utils_1.transformSupportedBrowsersToTargets)(browsers); - codeBundleCache = new source_file_cache_1.SourceFileCache(cacheOptions.enabled ? cacheOptions.path : undefined); - componentStyleBundler = (0, setup_bundling_1.createComponentStyleBundler)(options, target); - if (options.templateUpdates) { - templateUpdates = new Map(); - } - bundlerContexts = (0, setup_bundling_1.setupBundlerContexts)(options, target, codeBundleCache, componentStyleBundler, - // Create new reusable compilation for the appropriate mode based on the `jit` plugin option - await (0, compilation_1.createAngularCompilation)(!!options.jit, !options.serverEntryPoint), templateUpdates); - // Bundle everything on initial build - bundlingResult = await bundler_context_1.BundlerContext.bundleAll([ - ...bundlerContexts.typescriptContexts, - ...bundlerContexts.otherContexts, - ]); - } - // Update any external component styles if enabled and rebuilding. - // TODO: Only attempt rebundling of invalidated styles once incremental build results are supported. - if (rebuildState && options.externalRuntimeStyles) { - componentStyleBundler.invalidate(rebuildState.fileChanges.all); - const componentResults = await componentStyleBundler.bundleAllFiles(true, true); - bundlingResult = bundler_context_1.BundlerContext.mergeResults([bundlingResult, ...componentResults]); - } - if (options.optimizationOptions.scripts && environment_options_1.shouldOptimizeChunks) { - const { optimizeChunks } = await Promise.resolve().then(() => __importStar(require('./chunk-optimizer'))); - bundlingResult = await (0, profiling_1.profileAsync)('OPTIMIZE_CHUNKS', () => optimizeChunks(bundlingResult, options.sourcemapOptions.scripts ? !options.sourcemapOptions.hidden || 'hidden' : false)); - } - const executionResult = new bundler_execution_result_1.ExecutionResult(bundlerContexts, componentStyleBundler, codeBundleCache, templateUpdates); - executionResult.addWarnings(bundlingResult.warnings); - // Add used external component style referenced files to be watched - if (options.externalRuntimeStyles) { - executionResult.extraWatchFiles.push(...componentStyleBundler.collectReferencedFiles()); - } - // Return if the bundling has errors - if (bundlingResult.errors) { - executionResult.addErrors(bundlingResult.errors); - return executionResult; - } - // Analyze external imports if external options are enabled - if (options.externalPackages || bundlingResult.externalConfiguration) { - const { externalConfiguration = [], externalImports: { browser = [], server = [] }, } = bundlingResult; - // Similar to esbuild, --external:@foo/bar automatically implies --external:@foo/bar/*, - // which matches import paths like @foo/bar/baz. - // This means all paths within the @foo/bar package are also marked as external. - const exclusionsPrefixes = externalConfiguration.map((exclusion) => exclusion + '/'); - const exclusions = new Set(externalConfiguration); - const explicitExternal = new Set(); - const isExplicitExternal = (dep) => { - if (exclusions.has(dep)) { - return true; - } - for (const prefix of exclusionsPrefixes) { - if (dep.startsWith(prefix)) { - return true; - } - } - return false; - }; - const implicitBrowser = []; - for (const dep of browser) { - if (isExplicitExternal(dep)) { - explicitExternal.add(dep); - } - else { - implicitBrowser.push(dep); - } - } - const implicitServer = []; - for (const dep of server) { - if (isExplicitExternal(dep)) { - explicitExternal.add(dep); - } - else { - implicitServer.push(dep); - } - } - executionResult.setExternalMetadata(implicitBrowser, implicitServer, [...explicitExternal]); - } - const { metafile, initialFiles, outputFiles } = bundlingResult; - executionResult.outputFiles.push(...outputFiles); - // Analyze files for bundle budget failures if present - let budgetFailures; - if (options.budgets) { - const compatStats = (0, budget_stats_1.generateBudgetStats)(metafile, outputFiles, initialFiles); - budgetFailures = [...(0, bundle_calculator_1.checkBudgets)(options.budgets, compatStats, true)]; - for (const { message, severity } of budgetFailures) { - if (severity === 'error') { - executionResult.addError(message); - } - else { - executionResult.addWarning(message); - } - } - } - // Calculate estimated transfer size if scripts are optimized - let estimatedTransferSizes; - if (optimizationOptions.scripts || optimizationOptions.styles.minify) { - estimatedTransferSizes = await (0, utils_1.calculateEstimatedTransferSizes)(executionResult.outputFiles); - } - // Check metafile for CommonJS module usage if optimizing scripts - if (optimizationOptions.scripts) { - const messages = (0, commonjs_checker_1.checkCommonJSModules)(metafile, options.allowedCommonJsDependencies); - executionResult.addWarnings(messages); - } - // Copy assets - if (assets) { - executionResult.addAssets(await (0, resolve_assets_1.resolveAssets)(assets, workspaceRoot)); - } - // Extract and write licenses for used packages - if (options.extractLicenses) { - executionResult.addOutputFile('3rdpartylicenses.txt', await (0, license_extractor_1.extractLicenses)(metafile, workspaceRoot), bundler_context_1.BuildOutputFileType.Root); - } - // Watch input index HTML file if configured - if (options.indexHtmlOptions) { - executionResult.extraWatchFiles.push(options.indexHtmlOptions.input); - executionResult.htmlIndexPath = options.indexHtmlOptions.output; - executionResult.htmlBaseHref = options.baseHref; - } - // Create server app engine manifest - if (serverEntryPoint) { - executionResult.addOutputFile(manifest_1.SERVER_APP_ENGINE_MANIFEST_FILENAME, (0, manifest_1.generateAngularServerAppEngineManifest)(i18nOptions, baseHref), bundler_context_1.BuildOutputFileType.ServerRoot); - } - // Perform i18n translation inlining if enabled - if (i18nOptions.shouldInline) { - const result = await (0, i18n_1.inlineI18n)(metafile, options, executionResult, initialFiles); - executionResult.addErrors(result.errors); - executionResult.addWarnings(result.warnings); - executionResult.addPrerenderedRoutes(result.prerenderedRoutes); - } - else { - const result = await (0, execute_post_bundle_1.executePostBundleSteps)(metafile, options, executionResult.outputFiles, executionResult.assetFiles, initialFiles, - // Set lang attribute to the defined source locale if present - i18nOptions.hasDefinedSourceLocale ? i18nOptions.sourceLocale : undefined); - // Deduplicate and add errors and warnings - executionResult.addErrors([...new Set(result.errors)]); - executionResult.addWarnings([...new Set(result.warnings)]); - executionResult.addPrerenderedRoutes(result.prerenderedRoutes); - executionResult.outputFiles.push(...result.additionalOutputFiles); - executionResult.assetFiles.push(...result.additionalAssets); - } - executionResult.addOutputFile('prerendered-routes.json', JSON.stringify({ routes: executionResult.prerenderedRoutes }, null, 2), bundler_context_1.BuildOutputFileType.Root); - // Write metafile if stats option is enabled - if (options.stats) { - executionResult.addOutputFile('stats.json', JSON.stringify(metafile, null, 2), bundler_context_1.BuildOutputFileType.Root); - } - if (!jsonLogs) { - const changedFiles = rebuildState && executionResult.findChangedFiles(rebuildState.previousOutputInfo); - executionResult.addLog((0, utils_1.logBuildStats)(metafile, outputFiles, initialFiles, budgetFailures, colors, changedFiles, estimatedTransferSizes, !!ssrOptions, verbose)); - } - return executionResult; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-post-bundle.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-post-bundle.d.ts deleted file mode 100755 index 27f9e94..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-post-bundle.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Metafile } from 'esbuild'; -import { BuildOutputFile, InitialFileRecord } from '../../tools/esbuild/bundler-context'; -import { BuildOutputAsset, PrerenderedRoutesRecord } from '../../tools/esbuild/bundler-execution-result'; -import { NormalizedApplicationBuildOptions } from './options'; -/** - * Run additional builds steps including SSG, AppShell, Index HTML file and Service worker generation. - * @param metafile An esbuild metafile object. - * @param options The normalized application builder options used to create the build. - * @param outputFiles The output files of an executed build. - * @param assetFiles The assets of an executed build. - * @param initialFiles A map containing initial file information for the executed build. - * @param locale A language locale to insert in the index.html. - */ -export declare function executePostBundleSteps(metafile: Metafile, options: NormalizedApplicationBuildOptions, outputFiles: BuildOutputFile[], assetFiles: BuildOutputAsset[], initialFiles: Map, locale: string | undefined): Promise<{ - errors: string[]; - warnings: string[]; - additionalOutputFiles: BuildOutputFile[]; - additionalAssets: BuildOutputAsset[]; - prerenderedRoutes: PrerenderedRoutesRecord; -}>; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-post-bundle.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-post-bundle.js deleted file mode 100755 index 1d412c6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/execute-post-bundle.js +++ /dev/null @@ -1,135 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.executePostBundleSteps = executePostBundleSteps; -const node_assert_1 = __importDefault(require("node:assert")); -const bundler_context_1 = require("../../tools/esbuild/bundler-context"); -const index_html_generator_1 = require("../../tools/esbuild/index-html-generator"); -const utils_1 = require("../../tools/esbuild/utils"); -const environment_options_1 = require("../../utils/environment-options"); -const manifest_1 = require("../../utils/server-rendering/manifest"); -const models_1 = require("../../utils/server-rendering/models"); -const prerender_1 = require("../../utils/server-rendering/prerender"); -const service_worker_1 = require("../../utils/service-worker"); -const options_1 = require("./options"); -const schema_1 = require("./schema"); -/** - * Run additional builds steps including SSG, AppShell, Index HTML file and Service worker generation. - * @param metafile An esbuild metafile object. - * @param options The normalized application builder options used to create the build. - * @param outputFiles The output files of an executed build. - * @param assetFiles The assets of an executed build. - * @param initialFiles A map containing initial file information for the executed build. - * @param locale A language locale to insert in the index.html. - */ -// eslint-disable-next-line max-lines-per-function -async function executePostBundleSteps(metafile, options, outputFiles, assetFiles, initialFiles, locale) { - const additionalAssets = []; - const additionalOutputFiles = []; - const allErrors = []; - const allWarnings = []; - const prerenderedRoutes = {}; - const { baseHref = '/', serviceWorker, ssrOptions, indexHtmlOptions, optimizationOptions, sourcemapOptions, outputMode, serverEntryPoint, prerenderOptions, appShellOptions, publicPath, workspaceRoot, partialSSRBuild, } = options; - // Index HTML content without CSS inlining to be used for server rendering (AppShell, SSG and SSR). - // NOTE: Critical CSS inlining is deliberately omitted here, as it will be handled during server rendering. - // Additionally, when using prerendering or AppShell, the index HTML file may be regenerated. - // To prevent generating duplicate files with the same filename, a `Map` is used to store and manage the files. - const additionalHtmlOutputFiles = new Map(); - // Generate index HTML file - // If localization is enabled, index generation is handled in the inlining process. - if (indexHtmlOptions) { - const { csrContent, ssrContent, errors, warnings } = await (0, index_html_generator_1.generateIndexHtml)(initialFiles, outputFiles, options, locale); - allErrors.push(...errors); - allWarnings.push(...warnings); - additionalHtmlOutputFiles.set(indexHtmlOptions.output, (0, utils_1.createOutputFile)(indexHtmlOptions.output, csrContent, bundler_context_1.BuildOutputFileType.Browser)); - if (ssrContent) { - additionalHtmlOutputFiles.set(options_1.INDEX_HTML_SERVER, (0, utils_1.createOutputFile)(options_1.INDEX_HTML_SERVER, ssrContent, bundler_context_1.BuildOutputFileType.ServerApplication)); - } - } - // Create server manifest - const initialFilesPaths = new Set(initialFiles.keys()); - if (serverEntryPoint && (outputMode || prerenderOptions || appShellOptions || ssrOptions)) { - const { manifestContent, serverAssetsChunks } = (0, manifest_1.generateAngularServerAppManifest)(additionalHtmlOutputFiles, outputFiles, optimizationOptions.styles.inlineCritical ?? false, undefined, locale, baseHref, initialFilesPaths, metafile, publicPath); - additionalOutputFiles.push(...serverAssetsChunks, (0, utils_1.createOutputFile)(manifest_1.SERVER_APP_MANIFEST_FILENAME, manifestContent, bundler_context_1.BuildOutputFileType.ServerApplication)); - } - // Pre-render (SSG) and App-shell - // If localization is enabled, prerendering is handled in the inlining process. - if (!partialSSRBuild && - (prerenderOptions || appShellOptions || (outputMode && serverEntryPoint)) && - !allErrors.length) { - (0, node_assert_1.default)(indexHtmlOptions, 'The "index" option is required when using the "ssg" or "appShell" options.'); - const { output, warnings, errors, serializableRouteTreeNode } = await (0, prerender_1.prerenderPages)(workspaceRoot, baseHref, appShellOptions, prerenderOptions, [...outputFiles, ...additionalOutputFiles], assetFiles, outputMode, sourcemapOptions.scripts, environment_options_1.maxWorkers); - allErrors.push(...errors); - allWarnings.push(...warnings); - const indexHasBeenPrerendered = output[indexHtmlOptions.output]; - for (const [path, { content, appShellRoute }] of Object.entries(output)) { - // Update the index contents with the app shell under these conditions: - // - Replace 'index.html' with the app shell only if it hasn't been prerendered yet. - // - Always replace 'index.csr.html' with the app shell. - let filePath = path; - if (appShellRoute && !indexHasBeenPrerendered) { - if (outputMode !== schema_1.OutputMode.Server && indexHtmlOptions.output === options_1.INDEX_HTML_CSR) { - filePath = 'index.html'; - } - else { - filePath = indexHtmlOptions.output; - } - } - additionalHtmlOutputFiles.set(filePath, (0, utils_1.createOutputFile)(filePath, content, bundler_context_1.BuildOutputFileType.Browser)); - } - const serializableRouteTreeNodeForManifest = []; - for (const metadata of serializableRouteTreeNode) { - serializableRouteTreeNodeForManifest.push(metadata); - if (metadata.renderMode === models_1.RouteRenderMode.Prerender && !metadata.route.includes('*')) { - prerenderedRoutes[metadata.route] = { headers: metadata.headers }; - } - } - if (outputMode === schema_1.OutputMode.Server) { - // Regenerate the manifest to append route tree. This is only needed if SSR is enabled. - const manifest = additionalOutputFiles.find((f) => f.path === manifest_1.SERVER_APP_MANIFEST_FILENAME); - (0, node_assert_1.default)(manifest, `${manifest_1.SERVER_APP_MANIFEST_FILENAME} was not found in output files.`); - const { manifestContent, serverAssetsChunks } = (0, manifest_1.generateAngularServerAppManifest)(additionalHtmlOutputFiles, outputFiles, optimizationOptions.styles.inlineCritical ?? false, serializableRouteTreeNodeForManifest, locale, baseHref, initialFilesPaths, metafile, publicPath); - for (const chunk of serverAssetsChunks) { - const idx = additionalOutputFiles.findIndex(({ path }) => path === chunk.path); - if (idx === -1) { - additionalOutputFiles.push(chunk); - } - else { - additionalOutputFiles[idx] = chunk; - } - } - manifest.contents = new TextEncoder().encode(manifestContent); - } - } - additionalOutputFiles.push(...additionalHtmlOutputFiles.values()); - // Augment the application with service worker support - // If localization is enabled, service worker is handled in the inlining process. - if (serviceWorker) { - try { - const serviceWorkerResult = await (0, service_worker_1.augmentAppWithServiceWorkerEsbuild)(workspaceRoot, serviceWorker, baseHref, options.indexHtmlOptions?.output, - // Ensure additional files recently added are used - [...outputFiles, ...additionalOutputFiles], assetFiles); - additionalOutputFiles.push((0, utils_1.createOutputFile)('ngsw.json', serviceWorkerResult.manifest, bundler_context_1.BuildOutputFileType.Browser)); - additionalAssets.push(...serviceWorkerResult.assetFiles); - } - catch (error) { - allErrors.push(error instanceof Error ? error.message : `${error}`); - } - } - return { - errors: allErrors, - warnings: allWarnings, - additionalAssets, - prerenderedRoutes, - additionalOutputFiles, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/i18n.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/i18n.d.ts deleted file mode 100755 index cf6d661..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/i18n.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BuilderContext } from '@angular-devkit/architect'; -import type { Metafile } from 'esbuild'; -import { InitialFileRecord } from '../../tools/esbuild/bundler-context'; -import { ExecutionResult, PrerenderedRoutesRecord } from '../../tools/esbuild/bundler-execution-result'; -import { NormalizedApplicationBuildOptions } from './options'; -/** - * Inlines all active locales as specified by the application build options into all - * application JavaScript files created during the build. - * @param metafile An esbuild metafile object. - * @param options The normalized application builder options used to create the build. - * @param executionResult The result of an executed build. - * @param initialFiles A map containing initial file information for the executed build. - */ -export declare function inlineI18n(metafile: Metafile, options: NormalizedApplicationBuildOptions, executionResult: ExecutionResult, initialFiles: Map): Promise<{ - errors: string[]; - warnings: string[]; - prerenderedRoutes: PrerenderedRoutesRecord; -}>; -/** - * Loads all active translations using the translation loaders from the `@angular/localize` package. - * @param context The architect builder context for the current build. - * @param i18n The normalized i18n options to use. - */ -export declare function loadActiveTranslations(context: BuilderContext, i18n: NormalizedApplicationBuildOptions['i18nOptions']): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/i18n.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/i18n.js deleted file mode 100755 index 97eeca6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/i18n.js +++ /dev/null @@ -1,137 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.inlineI18n = inlineI18n; -exports.loadActiveTranslations = loadActiveTranslations; -const node_path_1 = require("node:path"); -const bundler_context_1 = require("../../tools/esbuild/bundler-context"); -const i18n_inliner_1 = require("../../tools/esbuild/i18n-inliner"); -const environment_options_1 = require("../../utils/environment-options"); -const i18n_options_1 = require("../../utils/i18n-options"); -const load_translations_1 = require("../../utils/load-translations"); -const execute_post_bundle_1 = require("./execute-post-bundle"); -const options_1 = require("./options"); -/** - * Inlines all active locales as specified by the application build options into all - * application JavaScript files created during the build. - * @param metafile An esbuild metafile object. - * @param options The normalized application builder options used to create the build. - * @param executionResult The result of an executed build. - * @param initialFiles A map containing initial file information for the executed build. - */ -async function inlineI18n(metafile, options, executionResult, initialFiles) { - const { i18nOptions, optimizationOptions, baseHref, cacheOptions } = options; - // Create the multi-threaded inliner with common options and the files generated from the build. - const inliner = new i18n_inliner_1.I18nInliner({ - missingTranslation: i18nOptions.missingTranslationBehavior ?? 'warning', - outputFiles: executionResult.outputFiles, - shouldOptimize: optimizationOptions.scripts, - persistentCachePath: cacheOptions.enabled ? cacheOptions.path : undefined, - }, environment_options_1.maxWorkers); - const inlineResult = { - errors: [], - warnings: [], - prerenderedRoutes: {}, - }; - // For each active locale, use the inliner to process the output files of the build. - const updatedOutputFiles = []; - const updatedAssetFiles = []; - // Root and SSR entry files are not modified. - const unModifiedOutputFiles = executionResult.outputFiles.filter(({ type }) => type === bundler_context_1.BuildOutputFileType.Root || type === bundler_context_1.BuildOutputFileType.ServerRoot); - try { - for (const locale of i18nOptions.inlineLocales) { - // A locale specific set of files is returned from the inliner. - const localeInlineResult = await inliner.inlineForLocale(locale, i18nOptions.locales[locale].translation); - const localeOutputFiles = localeInlineResult.outputFiles; - inlineResult.errors.push(...localeInlineResult.errors); - inlineResult.warnings.push(...localeInlineResult.warnings); - const { errors, warnings, additionalAssets, additionalOutputFiles, prerenderedRoutes: generatedRoutes, } = await (0, execute_post_bundle_1.executePostBundleSteps)(metafile, { - ...options, - baseHref: (0, options_1.getLocaleBaseHref)(baseHref, i18nOptions, locale) ?? baseHref, - }, [...unModifiedOutputFiles, ...localeOutputFiles], executionResult.assetFiles, initialFiles, locale); - localeOutputFiles.push(...additionalOutputFiles); - inlineResult.errors.push(...errors); - inlineResult.warnings.push(...warnings); - // Update directory with locale base or subPath - const subPath = i18nOptions.locales[locale].subPath; - if (i18nOptions.flatOutput !== true) { - localeOutputFiles.forEach((file) => { - file.path = (0, node_path_1.join)(subPath, file.path); - }); - for (const assetFile of [...executionResult.assetFiles, ...additionalAssets]) { - updatedAssetFiles.push({ - source: assetFile.source, - destination: (0, node_path_1.join)(subPath, assetFile.destination), - }); - } - } - else { - executionResult.assetFiles.push(...additionalAssets); - } - inlineResult.prerenderedRoutes = { ...inlineResult.prerenderedRoutes, ...generatedRoutes }; - updatedOutputFiles.push(...localeOutputFiles); - } - } - finally { - await inliner.close(); - } - // Update the result with all localized files. - executionResult.outputFiles = [ - // Root and SSR entry files are not modified. - ...unModifiedOutputFiles, - // Updated files for each locale. - ...updatedOutputFiles, - ]; - // Assets are only changed if not using the flat output option - if (!i18nOptions.flatOutput) { - executionResult.assetFiles = updatedAssetFiles; - } - // Inline any template updates if present - if (executionResult.templateUpdates?.size) { - // The development server only allows a single locale but issue a warning if used programmatically (experimental) - // with multiple locales and template HMR. - if (i18nOptions.inlineLocales.size > 1) { - inlineResult.warnings.push(`Component HMR updates can only be inlined with a single locale. The first locale will be used.`); - } - const firstLocale = [...i18nOptions.inlineLocales][0]; - for (const [id, content] of executionResult.templateUpdates) { - const templateUpdateResult = await inliner.inlineTemplateUpdate(firstLocale, i18nOptions.locales[firstLocale].translation, content, id); - executionResult.templateUpdates.set(id, templateUpdateResult.code); - inlineResult.errors.push(...templateUpdateResult.errors); - inlineResult.warnings.push(...templateUpdateResult.warnings); - } - } - return inlineResult; -} -/** - * Loads all active translations using the translation loaders from the `@angular/localize` package. - * @param context The architect builder context for the current build. - * @param i18n The normalized i18n options to use. - */ -async function loadActiveTranslations(context, i18n) { - // Load locale data and translations (if present) - let loader; - for (const [locale, desc] of Object.entries(i18n.locales)) { - if (!i18n.inlineLocales.has(locale) && locale !== i18n.sourceLocale) { - continue; - } - if (!desc.files.length) { - continue; - } - loader ??= await (0, load_translations_1.createTranslationLoader)(); - (0, i18n_options_1.loadTranslations)(locale, desc, context.workspaceRoot, loader, { - warn(message) { - context.logger.warn(message); - }, - error(message) { - throw new Error(message); - }, - }, undefined, i18n.duplicateTranslationBehavior); - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/index.d.ts deleted file mode 100755 index 11369ae..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { Builder, BuilderContext, BuilderOutput } from '@angular-devkit/architect'; -import { ApplicationBuilderExtensions, ApplicationBuilderInternalOptions } from './options'; -import { Result } from './results'; -import { Schema as ApplicationBuilderOptions } from './schema'; -export type { ApplicationBuilderOptions }; -export declare function buildApplicationInternal(options: ApplicationBuilderInternalOptions, context: BuilderContext & { - signal?: AbortSignal; -}, extensions?: ApplicationBuilderExtensions): AsyncIterable; -/** - * Builds an application using the `application` builder with the provided - * options. - * - * Usage of the `extensions` parameter is NOT supported and may cause unexpected - * build output or build failures. - * - * @experimental Direct usage of this function is considered experimental. - * - * @param options The options defined by the builder's schema to use. - * @param context An Architect builder context instance. - * @param extensions An object contain extension points for the build. - * @returns The build output results of the build. - */ -export declare function buildApplication(options: ApplicationBuilderOptions, context: BuilderContext, extensions?: ApplicationBuilderExtensions): AsyncIterable; -declare const builder: Builder; -export default builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/index.js deleted file mode 100755 index 69e9fe9..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/index.js +++ /dev/null @@ -1,252 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.buildApplicationInternal = buildApplicationInternal; -exports.buildApplication = buildApplication; -const architect_1 = require("@angular-devkit/architect"); -const node_assert_1 = __importDefault(require("node:assert")); -const promises_1 = __importDefault(require("node:fs/promises")); -const node_path_1 = __importDefault(require("node:path")); -const bundler_context_1 = require("../../tools/esbuild/bundler-context"); -const utils_1 = require("../../tools/esbuild/utils"); -const color_1 = require("../../utils/color"); -const delete_output_dir_1 = require("../../utils/delete-output-dir"); -const environment_options_1 = require("../../utils/environment-options"); -const purge_cache_1 = require("../../utils/purge-cache"); -const version_1 = require("../../utils/version"); -const build_action_1 = require("./build-action"); -const execute_build_1 = require("./execute-build"); -const options_1 = require("./options"); -const results_1 = require("./results"); -const isNodeV22orHigher = Number(process.versions.node.split('.', 1)[0]) >= 22; -async function* buildApplicationInternal(options, -// TODO: Integrate abort signal support into builder system -context, extensions) { - const { workspaceRoot, logger, target } = context; - // Check Angular version. - (0, version_1.assertCompatibleAngularVersion)(workspaceRoot); - // Purge old build disk cache. - await (0, purge_cache_1.purgeStaleBuildCache)(context); - // Determine project name from builder context target - const projectName = target?.project; - if (!projectName) { - context.logger.error(`The 'application' builder requires a target to be specified.`); - // Only the vite-based dev server current uses the errors value - yield { kind: results_1.ResultKind.Failure, errors: [] }; - return; - } - if (environment_options_1.bazelEsbuildPluginPath) { - extensions ??= {}; - extensions.codePlugins ??= []; - const { default: bazelEsbuildPlugin } = await Promise.resolve(`${environment_options_1.bazelEsbuildPluginPath}`).then(s => __importStar(require(s))); - extensions.codePlugins.push(bazelEsbuildPlugin); - } - const normalizedOptions = await (0, options_1.normalizeOptions)(context, projectName, options, extensions); - if (!normalizedOptions.outputOptions.ignoreServer) { - const { browser, server } = normalizedOptions.outputOptions; - if (browser === '') { - context.logger.error(`'outputPath.browser' cannot be configured to an empty string when SSR is enabled.`); - yield { kind: results_1.ResultKind.Failure, errors: [] }; - return; - } - if (browser === server) { - context.logger.error(`'outputPath.browser' and 'outputPath.server' cannot be configured to the same value.`); - yield { kind: results_1.ResultKind.Failure, errors: [] }; - return; - } - } - // Setup an abort controller with a builder teardown if no signal is present - let signal = context.signal; - if (!signal) { - const controller = new AbortController(); - signal = controller.signal; - context.addTeardown(() => controller.abort('builder-teardown')); - } - yield* (0, build_action_1.runEsBuildBuildAction)(async (rebuildState) => { - const { serverEntryPoint, jsonLogs, partialSSRBuild } = normalizedOptions; - const startTime = process.hrtime.bigint(); - const result = await (0, execute_build_1.executeBuild)(normalizedOptions, context, rebuildState); - if (jsonLogs) { - result.addLog(await (0, utils_1.createJsonBuildManifest)(result, normalizedOptions)); - } - else { - if (serverEntryPoint && !partialSSRBuild) { - const prerenderedRoutesLength = Object.keys(result.prerenderedRoutes).length; - let prerenderMsg = `Prerendered ${prerenderedRoutesLength} static route`; - prerenderMsg += prerenderedRoutesLength !== 1 ? 's.' : '.'; - result.addLog(color_1.colors.magenta(prerenderMsg)); - } - const buildTime = Number(process.hrtime.bigint() - startTime) / 10 ** 9; - const hasError = result.errors.length > 0; - result.addLog(`Application bundle generation ${hasError ? 'failed' : 'complete'}.` + - ` [${buildTime.toFixed(3)} seconds] - ${new Date().toISOString()}\n`); - } - return result; - }, { - watch: normalizedOptions.watch, - preserveSymlinks: normalizedOptions.preserveSymlinks, - poll: normalizedOptions.poll, - cacheOptions: normalizedOptions.cacheOptions, - outputOptions: normalizedOptions.outputOptions, - verbose: normalizedOptions.verbose, - projectRoot: normalizedOptions.projectRoot, - workspaceRoot: normalizedOptions.workspaceRoot, - progress: normalizedOptions.progress, - clearScreen: normalizedOptions.clearScreen, - colors: normalizedOptions.colors, - jsonLogs: normalizedOptions.jsonLogs, - incrementalResults: normalizedOptions.incrementalResults, - logger, - signal, - }); -} -/** - * Builds an application using the `application` builder with the provided - * options. - * - * Usage of the `extensions` parameter is NOT supported and may cause unexpected - * build output or build failures. - * - * @experimental Direct usage of this function is considered experimental. - * - * @param options The options defined by the builder's schema to use. - * @param context An Architect builder context instance. - * @param extensions An object contain extension points for the build. - * @returns The build output results of the build. - */ -async function* buildApplication(options, context, extensions) { - let initial = true; - const internalOptions = { ...options, incrementalResults: true }; - for await (const result of buildApplicationInternal(internalOptions, context, extensions)) { - const outputOptions = result.detail?.['outputOptions']; - if (initial) { - initial = false; - // Clean the output location if requested. - // Output options may not be present if the build failed. - if (outputOptions?.clean) { - await (0, delete_output_dir_1.deleteOutputDir)(context.workspaceRoot, outputOptions.base, [ - outputOptions.browser, - outputOptions.server, - ]); - } - } - if (result.kind === results_1.ResultKind.Failure) { - yield { success: false }; - continue; - } - (0, node_assert_1.default)(outputOptions, 'Application output options are required for builder usage.'); - (0, node_assert_1.default)(result.kind === results_1.ResultKind.Full || result.kind === results_1.ResultKind.Incremental, 'Application build did not provide a file result output.'); - // TODO: Restructure output logging to better handle stdout JSON piping - if (!environment_options_1.useJSONBuildLogs) { - context.logger.info(`Output location: ${outputOptions.base}\n`); - } - // Writes the output files to disk and ensures the containing directories are present - const directoryExists = new Set(); - await (0, utils_1.emitFilesToDisk)(Object.entries(result.files), async ([filePath, file]) => { - if (outputOptions.ignoreServer && - (file.type === bundler_context_1.BuildOutputFileType.ServerApplication || - file.type === bundler_context_1.BuildOutputFileType.ServerRoot)) { - return; - } - const fullFilePath = generateFullPath(filePath, file.type, outputOptions); - // Ensure output subdirectories exist - const fileBasePath = node_path_1.default.dirname(fullFilePath); - if (fileBasePath && !directoryExists.has(fileBasePath)) { - await promises_1.default.mkdir(fileBasePath, { recursive: true }); - directoryExists.add(fileBasePath); - } - if (file.origin === 'memory') { - // Write file contents - await promises_1.default.writeFile(fullFilePath, file.contents); - } - else { - // Copy file contents - if (isNodeV22orHigher) { - // Use newer `cp` API on Node.js 22+ (minimum v22 for CLI is 22.11) - await promises_1.default.cp(file.inputPath, fullFilePath, { - mode: promises_1.default.constants.COPYFILE_FICLONE, - preserveTimestamps: true, - }); - } - else { - // For Node.js 20 use `copyFile` (`cp` is not stable for v20) - // TODO: Remove when Node.js 20 is no longer supported - await promises_1.default.copyFile(file.inputPath, fullFilePath, promises_1.default.constants.COPYFILE_FICLONE); - } - } - }); - // Delete any removed files if incremental - if (result.kind === results_1.ResultKind.Incremental && result.removed?.length) { - await Promise.all(result.removed.map((file) => { - const fullFilePath = generateFullPath(file.path, file.type, outputOptions); - return promises_1.default.rm(fullFilePath, { force: true, maxRetries: 3 }); - })); - } - yield { success: true }; - } -} -function generateFullPath(filePath, type, outputOptions) { - let typeDirectory; - switch (type) { - case bundler_context_1.BuildOutputFileType.Browser: - case bundler_context_1.BuildOutputFileType.Media: - typeDirectory = outputOptions.browser; - break; - case bundler_context_1.BuildOutputFileType.ServerApplication: - case bundler_context_1.BuildOutputFileType.ServerRoot: - typeDirectory = outputOptions.server; - break; - case bundler_context_1.BuildOutputFileType.Root: - typeDirectory = ''; - break; - default: - throw new Error(`Unhandled write for file "${filePath}" with type "${bundler_context_1.BuildOutputFileType[type]}".`); - } - // NOTE: 'base' is a fully resolved path at this point - const fullFilePath = node_path_1.default.join(outputOptions.base, typeDirectory, filePath); - return fullFilePath; -} -const builder = (0, architect_1.createBuilder)(buildApplication); -exports.default = builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/options.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/options.d.ts deleted file mode 100755 index 5c3a94b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/options.d.ts +++ /dev/null @@ -1,210 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuilderContext } from '@angular-devkit/architect'; -import type { Plugin } from 'esbuild'; -import { I18nOptions } from '../../utils/i18n-options'; -import { IndexHtmlTransform } from '../../utils/index-file/index-html-generator'; -import { Schema as ApplicationBuilderOptions, ExperimentalPlatform, I18NTranslation, OutputMode, OutputPathClass } from './schema'; -/** - * The filename for the client-side rendered HTML template. - * This template is used for client-side rendering (CSR) in a web application. - */ -export declare const INDEX_HTML_CSR = "index.csr.html"; -/** - * The filename for the server-side rendered HTML template. - * This template is used for server-side rendering (SSR) in a web application. - */ -export declare const INDEX_HTML_SERVER = "index.server.html"; -export type NormalizedOutputOptions = Required & { - clean: boolean; - ignoreServer: boolean; -}; -export type NormalizedApplicationBuildOptions = Awaited>; -export interface ApplicationBuilderExtensions { - codePlugins?: Plugin[]; - indexHtmlTransformer?: IndexHtmlTransform; -} -/** Internal options hidden from builder schema but available when invoked programmatically. */ -interface InternalOptions { - /** - * Entry points to use for the compilation. Incompatible with `browser`, which must not be provided. May be relative or absolute paths. - * If given a relative path, it is resolved relative to the current workspace and will generate an output at the same relative location - * in the output directory. If given an absolute path, the output will be generated in the root of the output directory with the same base - * name. - * - * If provided a Map, the key is the name of the output bundle and the value is the entry point file. - */ - entryPoints?: Set | Map; - /** File extension to use for the generated output files. */ - outExtension?: 'js' | 'mjs'; - /** - * Indicates whether all node packages should be marked as external. - * Currently used by the dev-server to support prebundling. - */ - externalPackages?: boolean | { - exclude: string[]; - }; - /** - * Forces the output from the localize post-processing to not create nested directories per locale output. - * This is only used by the development server which currently only supports a single locale per build. - */ - forceI18nFlatOutput?: boolean; - /** - * When set to `true`, enables fast SSR in development mode by disabling the full manifest generation and prerendering. - * - * This option is intended to optimize performance during development by skipping prerendering and route extraction when not required. - * @default false - */ - partialSSRBuild?: boolean; - /** - * Enables the use of AOT compiler emitted external runtime styles. - * External runtime styles use `link` elements instead of embedded style content in the output JavaScript. - * This option is only intended to be used with a development server that can process and serve component - * styles. - */ - externalRuntimeStyles?: boolean; - /** - * Enables the AOT compiler to generate template component update functions. - * This option is only intended to be used with a development server that can process and serve component - * template updates. - */ - templateUpdates?: boolean; - /** - * Enables emitting incremental build results when in watch mode. A full build result will only be emitted - * for the initial build. This option also requires watch to be enabled to have an effect. - */ - incrementalResults?: boolean; - /** - * Enables instrumentation to collect code coverage data for specific files. - * - * Used exclusively for tests and shouldn't be used for other kinds of builds. - */ - instrumentForCoverage?: (filename: string) => boolean; -} -/** Full set of options for `application` builder. */ -export type ApplicationBuilderInternalOptions = Omit & { - browser?: string; -}; -/** - * Normalize the user provided options by creating full paths for all path based options - * and converting multi-form options into a single form that can be directly used - * by the build process. - * - * @param context The context for current builder execution. - * @param projectName The name of the project for the current execution. - * @param options An object containing the options to use for the build. - * @param plugins An optional array of programmatically supplied build plugins. - * @returns An object containing normalized options required to perform the build. - */ -export declare function normalizeOptions(context: BuilderContext, projectName: string, options: ApplicationBuilderInternalOptions, extensions?: ApplicationBuilderExtensions): Promise<{ - advancedOptimizations: boolean; - allowedCommonJsDependencies: string[] | undefined; - baseHref: string | undefined; - cacheOptions: import("../../utils/normalize-cache").NormalizedCachedOptions; - crossOrigin: import("./schema").CrossOrigin | undefined; - externalDependencies: string[] | undefined; - externalPackages: boolean | { - exclude: string[] | undefined; - } | undefined; - extractLicenses: boolean | undefined; - inlineStyleLanguage: string; - jit: boolean; - stats: boolean; - polyfills: string[] | undefined; - poll: number | undefined; - progress: boolean; - preserveSymlinks: boolean; - stylePreprocessorOptions: import("./schema").StylePreprocessorOptions | undefined; - subresourceIntegrity: boolean | undefined; - serverEntryPoint: string | undefined; - prerenderOptions: { - discoverRoutes: boolean; - routesFile: string | undefined; - } | undefined; - appShellOptions: { - route: string; - } | undefined; - outputMode: OutputMode | undefined; - ssrOptions: { - entry?: undefined; - platform?: undefined; - } | { - entry: string | undefined; - platform: ExperimentalPlatform; - } | undefined; - verbose: boolean | undefined; - watch: boolean | undefined; - workspaceRoot: string; - entryPoints: Record; - optimizationOptions: import("../../utils").NormalizedOptimizationOptions; - outputOptions: NormalizedOutputOptions; - outExtension: "js" | "mjs" | undefined; - sourcemapOptions: import("./schema").SourceMapClass; - tsconfig: string; - projectRoot: string; - assets: (import("./schema").AssetPatternClass & { - output: string; - })[] | undefined; - outputNames: { - bundles: string; - media: string; - }; - fileReplacements: Record | undefined; - globalStyles: { - name: string; - files: string[]; - initial: boolean; - }[]; - globalScripts: { - name: string; - files: string[]; - initial: boolean; - }[]; - serviceWorker: string | undefined; - indexHtmlOptions: { - input: string; - output: string; - insertionOrder: [string, boolean][]; - transformer: IndexHtmlTransform | undefined; - preloadInitial: boolean; - } | undefined; - tailwindConfiguration: { - file: string; - package: string; - } | undefined; - postcssConfiguration: import("../../utils/postcss-configuration").PostcssConfiguration | undefined; - i18nOptions: I18nOptions & { - duplicateTranslationBehavior?: I18NTranslation; - missingTranslationBehavior?: I18NTranslation; - }; - namedChunks: boolean | undefined; - budgets: import("./schema").Budget[] | undefined; - publicPath: string | undefined; - plugins: Plugin[] | undefined; - loaderExtensions: Record | undefined; - jsonLogs: boolean; - colors: boolean; - clearScreen: boolean | undefined; - define: { - [key: string]: string; - } | undefined; - partialSSRBuild: boolean; - externalRuntimeStyles: boolean | undefined; - instrumentForCoverage: ((filename: string) => boolean) | undefined; - security: { - autoCsp: { - unsafeEval: boolean; - } | undefined; - }; - templateUpdates: boolean; - incrementalResults: boolean; - customConditions: string[] | undefined; - frameworkVersion: string; -}>; -export declare function getLocaleBaseHref(baseHref: string | undefined, i18n: NormalizedApplicationBuildOptions['i18nOptions'], locale: string): string | undefined; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/options.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/options.js deleted file mode 100755 index 28bb02d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/options.js +++ /dev/null @@ -1,490 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.INDEX_HTML_SERVER = exports.INDEX_HTML_CSR = void 0; -exports.normalizeOptions = normalizeOptions; -exports.getLocaleBaseHref = getLocaleBaseHref; -const node_fs_1 = require("node:fs"); -const promises_1 = require("node:fs/promises"); -const node_module_1 = require("node:module"); -const node_path_1 = __importDefault(require("node:path")); -const utils_1 = require("../../utils"); -const color_1 = require("../../utils/color"); -const environment_options_1 = require("../../utils/environment-options"); -const i18n_options_1 = require("../../utils/i18n-options"); -const normalize_cache_1 = require("../../utils/normalize-cache"); -const postcss_configuration_1 = require("../../utils/postcss-configuration"); -const project_metadata_1 = require("../../utils/project-metadata"); -const url_1 = require("../../utils/url"); -const schema_1 = require("./schema"); -/** - * The filename for the client-side rendered HTML template. - * This template is used for client-side rendering (CSR) in a web application. - */ -exports.INDEX_HTML_CSR = 'index.csr.html'; -/** - * The filename for the server-side rendered HTML template. - * This template is used for server-side rendering (SSR) in a web application. - */ -exports.INDEX_HTML_SERVER = 'index.server.html'; -/** - * Normalize the user provided options by creating full paths for all path based options - * and converting multi-form options into a single form that can be directly used - * by the build process. - * - * @param context The context for current builder execution. - * @param projectName The name of the project for the current execution. - * @param options An object containing the options to use for the build. - * @param plugins An optional array of programmatically supplied build plugins. - * @returns An object containing normalized options required to perform the build. - */ -// eslint-disable-next-line max-lines-per-function -async function normalizeOptions(context, projectName, options, extensions) { - // If not explicitly set, default to the Node.js process argument - const preserveSymlinks = options.preserveSymlinks ?? process.execArgv.includes('--preserve-symlinks'); - // Setup base paths based on workspace root and project information - const workspaceRoot = preserveSymlinks - ? context.workspaceRoot - : // NOTE: promises.realpath should not be used here since it uses realpath.native which - // can cause case conversion and other undesirable behavior on Windows systems. - // ref: https://github.com/nodejs/node/issues/7726 - (0, node_fs_1.realpathSync)(context.workspaceRoot); - const projectMetadata = await context.getProjectMetadata(projectName); - const { projectRoot, projectSourceRoot } = (0, project_metadata_1.getProjectRootPaths)(workspaceRoot, projectMetadata); - // Gather persistent caching option and provide a project specific cache location - const cacheOptions = (0, normalize_cache_1.normalizeCacheOptions)(projectMetadata, workspaceRoot); - cacheOptions.path = node_path_1.default.join(cacheOptions.path, projectName); - const i18nOptions = (0, i18n_options_1.createI18nOptions)(projectMetadata, options.localize, context.logger, !!options.ssr); - i18nOptions.duplicateTranslationBehavior = options.i18nDuplicateTranslation; - i18nOptions.missingTranslationBehavior = options.i18nMissingTranslation; - if (options.forceI18nFlatOutput) { - i18nOptions.flatOutput = true; - } - const entryPoints = normalizeEntryPoints(workspaceRoot, projectSourceRoot, options.browser, options.entryPoints); - const tsconfig = node_path_1.default.join(workspaceRoot, options.tsConfig); - const optimizationOptions = (0, utils_1.normalizeOptimization)(options.optimization); - const sourcemapOptions = (0, utils_1.normalizeSourceMaps)(options.sourceMap ?? false); - const assets = options.assets?.length - ? (0, utils_1.normalizeAssetPatterns)(options.assets, workspaceRoot, projectRoot, projectSourceRoot) - : undefined; - let fileReplacements; - if (options.fileReplacements) { - for (const replacement of options.fileReplacements) { - const fileReplaceWith = node_path_1.default.join(workspaceRoot, replacement.with); - try { - await (0, promises_1.access)(fileReplaceWith, promises_1.constants.F_OK); - } - catch { - throw new Error(`The ${fileReplaceWith} path in file replacements does not exist.`); - } - fileReplacements ??= {}; - fileReplacements[node_path_1.default.join(workspaceRoot, replacement.replace)] = fileReplaceWith; - } - } - let loaderExtensions; - if (options.loader) { - for (const [extension, value] of Object.entries(options.loader)) { - if (extension[0] !== '.' || /\.[cm]?[jt]sx?$/.test(extension)) { - continue; - } - if (value !== 'text' && - value !== 'binary' && - value !== 'file' && - value !== 'dataurl' && - value !== 'base64' && - value !== 'empty') { - continue; - } - loaderExtensions ??= {}; - loaderExtensions[extension] = value; - } - } - // Validate prerender and ssr options when using the outputMode - if (options.outputMode === schema_1.OutputMode.Server) { - if (!options.server) { - throw new Error('The "server" option is required when "outputMode" is set to "server".'); - } - if (typeof options.ssr === 'boolean' || !options.ssr?.entry) { - throw new Error('The "ssr.entry" option is required when "outputMode" is set to "server".'); - } - } - if (options.outputMode) { - if (!options.server) { - options.ssr = false; - } - if (options.prerender !== undefined) { - context.logger.warn('The "prerender" option is not considered when "outputMode" is specified.'); - } - options.prerender = !!options.server; - if (options.appShell !== undefined) { - context.logger.warn('The "appShell" option is not considered when "outputMode" is specified.'); - } - } - // A configuration file can exist in the project or workspace root - const searchDirectories = await (0, postcss_configuration_1.generateSearchDirectories)([projectRoot, workspaceRoot]); - const postcssConfiguration = await (0, postcss_configuration_1.loadPostcssConfiguration)(searchDirectories); - // Skip tailwind configuration if postcss is customized - const tailwindConfiguration = postcssConfiguration - ? undefined - : await getTailwindConfig(searchDirectories, workspaceRoot, context); - let serverEntryPoint; - if (typeof options.server === 'string') { - if (options.server === '') { - throw new Error('The "server" option cannot be an empty string.'); - } - serverEntryPoint = node_path_1.default.join(workspaceRoot, options.server); - } - let prerenderOptions; - if (options.prerender) { - const { discoverRoutes = true, routesFile = undefined } = options.prerender === true ? {} : options.prerender; - prerenderOptions = { - discoverRoutes, - routesFile: routesFile && node_path_1.default.join(workspaceRoot, routesFile), - }; - } - let ssrOptions; - if (options.ssr === true) { - ssrOptions = {}; - } - else if (typeof options.ssr === 'object') { - const { entry, experimentalPlatform = schema_1.ExperimentalPlatform.Node } = options.ssr; - ssrOptions = { - entry: entry && node_path_1.default.join(workspaceRoot, entry), - platform: experimentalPlatform, - }; - } - let appShellOptions; - if (options.appShell) { - appShellOptions = { - route: 'shell', - }; - } - const outputPath = options.outputPath ?? node_path_1.default.join(workspaceRoot, 'dist', projectName); - const outputOptions = { - browser: 'browser', - server: 'server', - media: 'media', - ...(typeof outputPath === 'string' ? undefined : outputPath), - base: (0, project_metadata_1.normalizeDirectoryPath)(node_path_1.default.resolve(workspaceRoot, typeof outputPath === 'string' ? outputPath : outputPath.base)), - clean: options.deleteOutputPath ?? true, - // For app-shell and SSG server files are not required by users. - // Omit these when SSR is not enabled. - ignoreServer: ((ssrOptions === undefined || serverEntryPoint === undefined) && - options.outputMode === undefined) || - options.outputMode === schema_1.OutputMode.Static, - }; - const outputNames = { - bundles: options.outputHashing === schema_1.OutputHashing.All || options.outputHashing === schema_1.OutputHashing.Bundles - ? '[name]-[hash]' - : '[name]', - media: outputOptions.media + - (options.outputHashing === schema_1.OutputHashing.All || options.outputHashing === schema_1.OutputHashing.Media - ? '/[name]-[hash]' - : '/[name]'), - }; - const globalStyles = normalizeGlobalEntries(options.styles, 'styles'); - const globalScripts = normalizeGlobalEntries(options.scripts, 'scripts'); - let indexHtmlOptions; - // index can never have a value of `true` but in the schema it's of type `boolean`. - if (typeof options.index !== 'boolean') { - let indexInput; - let indexOutput; - // The output file will be created within the configured output path - if (typeof options.index === 'string') { - indexInput = indexOutput = node_path_1.default.join(workspaceRoot, options.index); - } - else if (typeof options.index === 'undefined') { - indexInput = node_path_1.default.join(projectSourceRoot, 'index.html'); - indexOutput = 'index.html'; - } - else { - indexInput = node_path_1.default.join(workspaceRoot, options.index.input); - indexOutput = options.index.output || 'index.html'; - } - /** - * If SSR is activated, create a distinct entry file for the `index.html`. - * This is necessary because numerous server/cloud providers automatically serve the `index.html` as a static file - * if it exists (handling SSG). - * - * For instance, accessing `foo.com/` would lead to `foo.com/index.html` being served instead of hitting the server. - * - * This approach can also be applied to service workers, where the `index.csr.html` is served instead of the prerendered `index.html`. - */ - const indexBaseName = node_path_1.default.basename(indexOutput); - indexOutput = - (ssrOptions || prerenderOptions) && indexBaseName === 'index.html' - ? exports.INDEX_HTML_CSR - : indexBaseName; - indexHtmlOptions = { - input: indexInput, - output: indexOutput, - insertionOrder: [ - ['polyfills', true], - ...globalStyles.filter((s) => s.initial).map((s) => [s.name, false]), - ...globalScripts.filter((s) => s.initial).map((s) => [s.name, false]), - ['main', true], - // [name, esm] - ], - transformer: extensions?.indexHtmlTransformer, - // Preload initial defaults to true - preloadInitial: typeof options.index !== 'object' || (options.index.preloadInitial ?? true), - }; - } - if (appShellOptions || ssrOptions || prerenderOptions) { - if (!serverEntryPoint) { - throw new Error('The "server" option is required when enabling "ssr", "prerender" or "app-shell".'); - } - if (!indexHtmlOptions) { - throw new Error('The "index" option cannot be set to false when enabling "ssr", "prerender" or "app-shell".'); - } - } - const autoCsp = options.security?.autoCsp; - const security = { - autoCsp: autoCsp - ? { - unsafeEval: autoCsp === true ? false : !!autoCsp.unsafeEval, - } - : undefined, - }; - // Initial options to keep - const { allowedCommonJsDependencies, aot = true, baseHref, crossOrigin, externalDependencies, extractLicenses, inlineStyleLanguage = 'css', outExtension, serviceWorker, poll, polyfills, statsJson, outputMode, stylePreprocessorOptions, subresourceIntegrity, verbose, watch, progress = true, externalPackages, namedChunks, budgets, deployUrl, clearScreen, define, partialSSRBuild = false, externalRuntimeStyles, instrumentForCoverage, } = options; - // Return all the normalized options - return { - advancedOptimizations: !!aot && optimizationOptions.scripts, - allowedCommonJsDependencies, - baseHref, - cacheOptions, - crossOrigin, - externalDependencies: normalizeExternals(externalDependencies), - externalPackages: typeof externalPackages === 'object' - ? { - ...externalPackages, - exclude: normalizeExternals(externalPackages.exclude), - } - : externalPackages, - extractLicenses, - inlineStyleLanguage, - jit: !aot, - stats: !!statsJson, - polyfills: polyfills === undefined || Array.isArray(polyfills) ? polyfills : [polyfills], - poll, - progress, - preserveSymlinks, - stylePreprocessorOptions, - subresourceIntegrity, - serverEntryPoint, - prerenderOptions, - appShellOptions, - outputMode, - ssrOptions, - verbose, - watch, - workspaceRoot, - entryPoints, - optimizationOptions, - outputOptions, - outExtension, - sourcemapOptions, - tsconfig, - projectRoot, - assets, - outputNames, - fileReplacements, - globalStyles, - globalScripts, - serviceWorker: serviceWorker - ? node_path_1.default.join(workspaceRoot, typeof serviceWorker === 'string' ? serviceWorker : 'src/ngsw-config.json') - : undefined, - indexHtmlOptions, - tailwindConfiguration, - postcssConfiguration, - i18nOptions, - namedChunks, - budgets: budgets?.length ? budgets : undefined, - publicPath: deployUrl, - plugins: extensions?.codePlugins?.length ? extensions?.codePlugins : undefined, - loaderExtensions, - jsonLogs: environment_options_1.useJSONBuildLogs, - colors: (0, color_1.supportColor)(), - clearScreen, - define, - partialSSRBuild: environment_options_1.usePartialSsrBuild || partialSSRBuild, - externalRuntimeStyles: aot && externalRuntimeStyles, - instrumentForCoverage, - security, - templateUpdates: !!options.templateUpdates, - incrementalResults: !!options.incrementalResults, - customConditions: options.conditions, - frameworkVersion: await findFrameworkVersion(projectRoot), - }; -} -async function getTailwindConfig(searchDirectories, workspaceRoot, context) { - const tailwindConfigurationPath = (0, postcss_configuration_1.findTailwindConfiguration)(searchDirectories); - if (!tailwindConfigurationPath) { - return undefined; - } - // Create a node resolver from the configuration file - const resolver = (0, node_module_1.createRequire)(tailwindConfigurationPath); - try { - return { - file: tailwindConfigurationPath, - package: resolver.resolve('tailwindcss'), - }; - } - catch { - const relativeTailwindConfigPath = node_path_1.default.relative(workspaceRoot, tailwindConfigurationPath); - context.logger.warn(`Tailwind CSS configuration file found (${relativeTailwindConfigPath})` + - ` but the 'tailwindcss' package is not installed.` + - ` To enable Tailwind CSS, please install the 'tailwindcss' package.`); - } - return undefined; -} -/** - * Normalize entry point options. To maintain compatibility with the legacy browser builder, we need a single `browser` - * option which defines a single entry point. However, we also want to support multiple entry points as an internal option. - * The two options are mutually exclusive and if `browser` is provided it will be used as the sole entry point. - * If `entryPoints` are provided, they will be used as the set of entry points. - * - * @param workspaceRoot Path to the root of the Angular workspace. - * @param browser The `browser` option pointing at the application entry point. While required per the schema file, it may be omitted by - * programmatic usages of `browser-esbuild`. - * @param entryPoints Set of entry points to use if provided. - * @returns An object mapping entry point names to their file paths. - */ -function normalizeEntryPoints(workspaceRoot, projectSourceRoot, browser, entryPoints) { - if (browser === '') { - throw new Error('`browser` option cannot be an empty string.'); - } - // `browser` and `entryPoints` are mutually exclusive. - if (browser && entryPoints) { - throw new Error('Only one of `browser` or `entryPoints` may be provided.'); - } - if (browser) { - // Use `browser` alone. - return { 'main': node_path_1.default.join(workspaceRoot, browser) }; - } - else if (!entryPoints) { - // Default browser entry if no explicit entry points - return { 'main': node_path_1.default.join(projectSourceRoot, 'main.ts') }; - } - else if (entryPoints instanceof Map) { - return Object.fromEntries(Array.from(entryPoints.entries(), ([name, entryPoint]) => { - // Get the full file path to a relative entry point input. Leave bare specifiers alone so they are resolved as modules. - const isRelativePath = entryPoint.startsWith('.'); - const entryPointPath = isRelativePath ? node_path_1.default.join(workspaceRoot, entryPoint) : entryPoint; - return [name, entryPointPath]; - })); - } - else { - // Use `entryPoints` alone. - const entryPointPaths = {}; - for (const entryPoint of entryPoints) { - const parsedEntryPoint = node_path_1.default.parse(entryPoint); - // Use the input file path without an extension as the "name" of the entry point dictating its output location. - // Relative entry points are generated at the same relative path in the output directory. - // Absolute entry points are always generated with the same file name in the root of the output directory. This includes absolute - // paths pointing at files actually within the workspace root. - const entryPointName = node_path_1.default.isAbsolute(entryPoint) - ? parsedEntryPoint.name - : node_path_1.default.join(parsedEntryPoint.dir, parsedEntryPoint.name); - // Get the full file path to a relative entry point input. Leave bare specifiers alone so they are resolved as modules. - const isRelativePath = entryPoint.startsWith('.'); - const entryPointPath = isRelativePath ? node_path_1.default.join(workspaceRoot, entryPoint) : entryPoint; - // Check for conflicts with previous entry points. - const existingEntryPointPath = entryPointPaths[entryPointName]; - if (existingEntryPointPath) { - throw new Error(`\`${existingEntryPointPath}\` and \`${entryPointPath}\` both output to the same location \`${entryPointName}\`.` + - ' Rename or move one of the files to fix the conflict.'); - } - entryPointPaths[entryPointName] = entryPointPath; - } - return entryPointPaths; - } -} -function normalizeGlobalEntries(rawEntries, defaultName) { - if (!rawEntries?.length) { - return []; - } - const bundles = new Map(); - for (const rawEntry of rawEntries) { - let entry; - if (typeof rawEntry === 'string') { - // string entries use default bundle name and inject values - entry = { input: rawEntry }; - } - else { - entry = rawEntry; - } - const { bundleName, input, inject = true } = entry; - // Non-injected entries default to the file name - const name = bundleName || (inject ? defaultName : node_path_1.default.basename(input, node_path_1.default.extname(input))); - const existing = bundles.get(name); - if (!existing) { - bundles.set(name, { name, files: [input], initial: inject }); - continue; - } - if (existing.initial !== inject) { - throw new Error(`The "${name}" bundle is mixing injected and non-injected entries. ` + - 'Verify that the project options are correct.'); - } - existing.files.push(input); - } - return [...bundles.values()]; -} -function getLocaleBaseHref(baseHref = '', i18n, locale) { - if (i18n.flatOutput) { - return undefined; - } - const localeData = i18n.locales[locale]; - if (!localeData) { - return undefined; - } - const baseHrefSuffix = localeData.baseHref ?? localeData.subPath + '/'; - return baseHrefSuffix !== '' ? (0, url_1.urlJoin)(baseHref, baseHrefSuffix) : undefined; -} -/** - * Normalizes an array of external dependency paths by ensuring that - * wildcard patterns (`/*`) are removed from package names. - * - * This avoids the need to handle this normalization repeatedly in our plugins, - * as esbuild already treats `--external:@foo/bar` as implicitly including - * `--external:@foo/bar/*`. By standardizing the input, we ensure consistency - * and reduce redundant checks across our plugins. - * - * @param value - An optional array of dependency paths to normalize. - * @returns A new array with wildcard patterns removed from package names, or `undefined` if input is `undefined`. - */ -function normalizeExternals(value) { - if (!value) { - return undefined; - } - return [ - ...new Set(value.map((d) => - // remove "/*" wildcard in the end if provided string is not path-like - d.endsWith('/*') && !/^\.{0,2}\//.test(d) ? d.slice(0, -2) : d)), - ]; -} -async function findFrameworkVersion(projectRoot) { - // Create a custom require function for ESM compliance. - // NOTE: The trailing slash is significant. - const projectResolve = (0, node_module_1.createRequire)(projectRoot + '/').resolve; - try { - const manifestPath = projectResolve('@angular/core/package.json'); - const manifestData = await (0, promises_1.readFile)(manifestPath, 'utf-8'); - const manifestObject = JSON.parse(manifestData); - const version = manifestObject.version; - return version; - } - catch { - throw new Error('Error: It appears that "@angular/core" is missing as a dependency. Please ensure it is included in your project.'); - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/results.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/results.d.ts deleted file mode 100755 index 9bc82d5..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/results.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BuildOutputFileType } from '../../tools/esbuild/bundler-context'; -export declare enum ResultKind { - Failure = 0, - Full = 1, - Incremental = 2, - ComponentUpdate = 3 -} -export type Result = FailureResult | FullResult | IncrementalResult | ComponentUpdateResult; -export interface BaseResult { - kind: ResultKind; - warnings?: ResultMessage[]; - duration?: number; - detail?: Record; -} -export interface FailureResult extends BaseResult { - kind: ResultKind.Failure; - errors: ResultMessage[]; -} -export interface FullResult extends BaseResult { - kind: ResultKind.Full; - files: Record; -} -export interface IncrementalResult extends BaseResult { - kind: ResultKind.Incremental; - background?: boolean; - added: string[]; - removed: { - path: string; - type: BuildOutputFileType; - }[]; - modified: string[]; - files: Record; -} -export type ResultFile = DiskFile | MemoryFile; -export interface BaseResultFile { - origin: 'memory' | 'disk'; - type: BuildOutputFileType; -} -export interface DiskFile extends BaseResultFile { - origin: 'disk'; - inputPath: string; -} -export interface MemoryFile extends BaseResultFile { - origin: 'memory'; - hash: string; - contents: Uint8Array; -} -export interface ResultMessage { - text: string; - location?: { - file: string; - line: number; - column: number; - } | null; - notes?: { - text: string; - }[]; -} -export interface ComponentUpdateResult extends BaseResult { - kind: ResultKind.ComponentUpdate; - updates: { - id: string; - type: 'style' | 'template'; - content: string; - }[]; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/results.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/results.js deleted file mode 100755 index 505a8c2..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/results.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResultKind = void 0; -var ResultKind; -(function (ResultKind) { - ResultKind[ResultKind["Failure"] = 0] = "Failure"; - ResultKind[ResultKind["Full"] = 1] = "Full"; - ResultKind[ResultKind["Incremental"] = 2] = "Incremental"; - ResultKind[ResultKind["ComponentUpdate"] = 3] = "ComponentUpdate"; -})(ResultKind || (exports.ResultKind = ResultKind = {})); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.d.ts deleted file mode 100755 index 6f48a1c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.d.ts +++ /dev/null @@ -1,644 +0,0 @@ -/** - * Application builder target options - */ -export type Schema = { - /** - * A list of CommonJS or AMD packages that are allowed to be used without a build time - * warning. Use `'*'` to allow all. - */ - allowedCommonJsDependencies?: string[]; - /** - * Build using Ahead of Time compilation. - */ - aot?: boolean; - /** - * Generates an application shell during build time. - */ - appShell?: boolean; - /** - * Define the assets to be copied to the output directory. These assets are copied as-is - * without any further processing or hashing. - */ - assets?: AssetPattern[]; - /** - * Base url for the application being built. - */ - baseHref?: string; - /** - * The full path for the browser entry point to the application, relative to the current - * workspace. - */ - browser?: string; - /** - * Budget thresholds to ensure parts of your application stay within boundaries which you - * set. - */ - budgets?: Budget[]; - /** - * Automatically clear the terminal screen during rebuilds. - */ - clearScreen?: boolean; - /** - * Custom package resolution conditions used to resolve conditional exports/imports. - * Defaults to ['module', 'development'/'production']. The following special conditions are - * always present if the requirements are satisfied: 'default', 'import', 'require', - * 'browser', 'node'. - */ - conditions?: string[]; - /** - * Define the crossorigin attribute setting of elements that provide CORS support. - */ - crossOrigin?: CrossOrigin; - /** - * Defines global identifiers that will be replaced with a specified constant value when - * found in any JavaScript or TypeScript code including libraries. The value will be used - * directly. String values must be put in quotes. Identifiers within Angular metadata such - * as Component Decorators will not be replaced. - */ - define?: { - [key: string]: string; - }; - /** - * Delete the output path before building. - */ - deleteOutputPath?: boolean; - /** - * Customize the base path for the URLs of resources in 'index.html' and component - * stylesheets. This option is only necessary for specific deployment scenarios, such as - * with Angular Elements or when utilizing different CDN locations. - */ - deployUrl?: string; - /** - * Exclude the listed external dependencies from being bundled into the bundle. Instead, the - * created bundle relies on these dependencies to be available during runtime. Note: - * `@foo/bar` marks all paths within the `@foo/bar` package as external, including sub-paths - * like `@foo/bar/baz`. - */ - externalDependencies?: string[]; - /** - * Extract all licenses in a separate file. - */ - extractLicenses?: boolean; - /** - * Replace compilation source files with other compilation source files in the build. - */ - fileReplacements?: FileReplacement[]; - /** - * How to handle duplicate translations for i18n. - */ - i18nDuplicateTranslation?: I18NTranslation; - /** - * How to handle missing translations for i18n. - */ - i18nMissingTranslation?: I18NTranslation; - /** - * Configures the generation of the application's HTML index. - */ - index?: IndexUnion; - /** - * The stylesheet language to use for the application's inline component styles. - */ - inlineStyleLanguage?: InlineStyleLanguage; - /** - * Defines the type of loader to use with a specified file extension when used with a - * JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content - * as a Uint8Array; `file` emits the file and provides the runtime location of the file; - * `dataurl` inlines the content as a data URL with best guess of MIME type; `base64` - * inlines the content as a Base64-encoded string; `empty` considers the content to be empty - * and not include it in bundles. - */ - loader?: { - [key: string]: any; - }; - /** - * Translate the bundles in one or more locales. - */ - localize?: Localize; - /** - * Use file name for lazy loaded chunks. - */ - namedChunks?: boolean; - /** - * Enables optimization of the build output. Including minification of scripts and styles, - * tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For - * more information, see - * https://angular.dev/reference/configs/workspace-config#optimization-configuration. - */ - optimization?: OptimizationUnion; - /** - * Define the output filename cache-busting hashing mode. - * - * - `none`: No hashing. - * - `all`: Hash for all output bundles. - * - `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in - * CSS files). - * - `bundles`: Hash for output of lazy and main bundles. - */ - outputHashing?: OutputHashing; - /** - * Defines the type of build output artifact. 'static': Generates a static site build - * artifact for deployment on any static hosting service. 'server': Generates a server - * application build artifact, required for applications using hybrid rendering or APIs. - */ - outputMode?: OutputMode; - /** - * Specify the output path relative to workspace root. - */ - outputPath?: OutputPathUnion; - /** - * Enable and define the file watching poll time period in milliseconds. - */ - poll?: number; - /** - * A list of polyfills to include in the build. Can be a full path for a file, relative to - * the current workspace or module specifier. Example: 'zone.js'. - */ - polyfills?: string[]; - /** - * Prerender (SSG) pages of your application during build time. - */ - prerender?: PrerenderUnion; - /** - * Do not use the real path when resolving modules. If unset then will default to `true` if - * NodeJS option --preserve-symlinks is set. - */ - preserveSymlinks?: boolean; - /** - * Log progress to the console while building. - */ - progress?: boolean; - /** - * Global scripts to be included in the build. - */ - scripts?: ScriptElement[]; - /** - * Security features to protect against XSS and other common attacks - */ - security?: Security; - /** - * The full path for the server entry point to the application, relative to the current - * workspace. - */ - server?: Serv; - /** - * Generates a service worker configuration. - */ - serviceWorker?: Serv; - /** - * Output source maps for scripts and styles. For more information, see - * https://angular.dev/reference/configs/workspace-config#source-map-configuration. - */ - sourceMap?: SourceMapUnion; - /** - * Server side render (SSR) pages of your application during runtime. - */ - ssr?: SsrUnion; - /** - * Generates a 'stats.json' file which can be analyzed with - * https://esbuild.github.io/analyze/. - */ - statsJson?: boolean; - /** - * Options to pass to style preprocessors. - */ - stylePreprocessorOptions?: StylePreprocessorOptions; - /** - * Global styles to be included in the build. - */ - styles?: StyleElement[]; - /** - * Enables the use of subresource integrity validation. - */ - subresourceIntegrity?: boolean; - /** - * The full path for the TypeScript configuration file, relative to the current workspace. - */ - tsConfig: string; - /** - * Adds more details to output logging. - */ - verbose?: boolean; - /** - * Run build when files change. - */ - watch?: boolean; - /** - * TypeScript configuration for Web Worker modules. - */ - webWorkerTsConfig?: string; -}; -export type AssetPattern = AssetPatternClass | string; -export type AssetPatternClass = { - /** - * Allow glob patterns to follow symlink directories. This allows subdirectories of the - * symlink to be searched. - */ - followSymlinks?: boolean; - /** - * The pattern to match. - */ - glob: string; - /** - * An array of globs to ignore. - */ - ignore?: string[]; - /** - * The input directory path in which to apply 'glob'. Defaults to the project root. - */ - input: string; - /** - * Absolute path within the output. - */ - output?: string; -}; -export type Budget = { - /** - * The baseline size for comparison. - */ - baseline?: string; - /** - * The threshold for error relative to the baseline (min & max). - */ - error?: string; - /** - * The maximum threshold for error relative to the baseline. - */ - maximumError?: string; - /** - * The maximum threshold for warning relative to the baseline. - */ - maximumWarning?: string; - /** - * The minimum threshold for error relative to the baseline. - */ - minimumError?: string; - /** - * The minimum threshold for warning relative to the baseline. - */ - minimumWarning?: string; - /** - * The name of the bundle. - */ - name?: string; - /** - * The type of budget. - */ - type: Type; - /** - * The threshold for warning relative to the baseline (min & max). - */ - warning?: string; -}; -/** - * The type of budget. - */ -export declare enum Type { - All = "all", - AllScript = "allScript", - Any = "any", - AnyComponentStyle = "anyComponentStyle", - AnyScript = "anyScript", - Bundle = "bundle", - Initial = "initial" -} -/** - * Define the crossorigin attribute setting of elements that provide CORS support. - */ -export declare enum CrossOrigin { - Anonymous = "anonymous", - None = "none", - UseCredentials = "use-credentials" -} -export type FileReplacement = { - replace: string; - with: string; -}; -/** - * How to handle duplicate translations for i18n. - * - * How to handle missing translations for i18n. - */ -export declare enum I18NTranslation { - Error = "error", - Ignore = "ignore", - Warning = "warning" -} -/** - * Configures the generation of the application's HTML index. - */ -export type IndexUnion = boolean | IndexObject | string; -export type IndexObject = { - /** - * The path of a file to use for the application's generated HTML index. - */ - input: string; - /** - * The output path of the application's generated HTML index file. The full provided path - * will be used and will be considered relative to the application's configured output path. - */ - output?: string; - /** - * Generates 'preload', 'modulepreload', and 'preconnect' link elements for initial - * application files and resources. - */ - preloadInitial?: boolean; - [property: string]: any; -}; -/** - * The stylesheet language to use for the application's inline component styles. - */ -export declare enum InlineStyleLanguage { - Css = "css", - Less = "less", - Sass = "sass", - Scss = "scss" -} -/** - * Translate the bundles in one or more locales. - */ -export type Localize = string[] | boolean; -/** - * Enables optimization of the build output. Including minification of scripts and styles, - * tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For - * more information, see - * https://angular.dev/reference/configs/workspace-config#optimization-configuration. - */ -export type OptimizationUnion = boolean | OptimizationClass; -export type OptimizationClass = { - /** - * Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` - * environment variable can be used to specify a proxy server. - */ - fonts?: FontsUnion; - /** - * Enables optimization of the scripts output. - */ - scripts?: boolean; - /** - * Enables optimization of the styles output. - */ - styles?: StylesUnion; -}; -/** - * Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` - * environment variable can be used to specify a proxy server. - */ -export type FontsUnion = boolean | FontsClass; -export type FontsClass = { - /** - * Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS - * definitions in the application's HTML index file. This option requires internet access. - * `HTTPS_PROXY` environment variable can be used to specify a proxy server. - */ - inline?: boolean; -}; -/** - * Enables optimization of the styles output. - */ -export type StylesUnion = boolean | StylesClass; -export type StylesClass = { - /** - * Extract and inline critical CSS definitions to improve first paint time. - */ - inlineCritical?: boolean; - /** - * Minify CSS definitions by removing extraneous whitespace and comments, merging - * identifiers and minimizing values. - */ - minify?: boolean; - /** - * Remove comments in global CSS that contains '@license' or '@preserve' or that starts with - * '//!' or '/*!'. - */ - removeSpecialComments?: boolean; -}; -/** - * Define the output filename cache-busting hashing mode. - * - * - `none`: No hashing. - * - `all`: Hash for all output bundles. - * - `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in - * CSS files). - * - `bundles`: Hash for output of lazy and main bundles. - */ -export declare enum OutputHashing { - All = "all", - Bundles = "bundles", - Media = "media", - None = "none" -} -/** - * Defines the type of build output artifact. 'static': Generates a static site build - * artifact for deployment on any static hosting service. 'server': Generates a server - * application build artifact, required for applications using hybrid rendering or APIs. - */ -export declare enum OutputMode { - Server = "server", - Static = "static" -} -/** - * Specify the output path relative to workspace root. - */ -export type OutputPathUnion = OutputPathClass | string; -export type OutputPathClass = { - /** - * Specify the output path relative to workspace root. - */ - base: string; - /** - * The output directory name of your browser build within the output path base. Defaults to - * 'browser'. - */ - browser?: string; - /** - * The output directory name of your media files within the output browser directory. - * Defaults to 'media'. - */ - media?: string; - /** - * The output directory name of your server build within the output path base. Defaults to - * 'server'. - */ - server?: string; -}; -/** - * Prerender (SSG) pages of your application during build time. - */ -export type PrerenderUnion = boolean | PrerenderClass; -export type PrerenderClass = { - /** - * Whether the builder should process the Angular Router configuration to find all - * unparameterized routes and prerender them. - */ - discoverRoutes?: boolean; - /** - * The path to a file that contains a list of all routes to prerender, separated by - * newlines. This option is useful if you want to prerender routes with parameterized URLs. - */ - routesFile?: string; -}; -export type ScriptElement = ScriptClass | string; -export type ScriptClass = { - /** - * The bundle name for this extra entry point. - */ - bundleName?: string; - /** - * If the bundle will be referenced in the HTML file. - */ - inject?: boolean; - /** - * The file to include. - */ - input: string; -}; -/** - * Security features to protect against XSS and other common attacks - */ -export type Security = { - /** - * Enables automatic generation of a hash-based Strict Content Security Policy - * (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will - * default to true once we are out of experimental/preview phases. - */ - autoCsp?: AutoCspUnion; -}; -/** - * Enables automatic generation of a hash-based Strict Content Security Policy - * (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will - * default to true once we are out of experimental/preview phases. - */ -export type AutoCspUnion = boolean | AutoCspClass; -export type AutoCspClass = { - /** - * Include the `unsafe-eval` directive (https://web.dev/articles/strict-csp#remove-eval) in - * the auto-CSP. Please only enable this if you are absolutely sure that you need to, as - * allowing calls to eval will weaken the XSS defenses provided by the auto-CSP. - */ - unsafeEval?: boolean; -}; -/** - * The full path for the server entry point to the application, relative to the current - * workspace. - * - * Generates a service worker configuration. - */ -export type Serv = boolean | string; -/** - * Output source maps for scripts and styles. For more information, see - * https://angular.dev/reference/configs/workspace-config#source-map-configuration. - */ -export type SourceMapUnion = boolean | SourceMapClass; -export type SourceMapClass = { - /** - * Output source maps used for error reporting tools. - */ - hidden?: boolean; - /** - * Output source maps for all scripts. - */ - scripts?: boolean; - /** - * Output original source content for files within the source map. - */ - sourcesContent?: boolean; - /** - * Output source maps for all styles. - */ - styles?: boolean; - /** - * Resolve vendor packages source maps. - */ - vendor?: boolean; -}; -/** - * Server side render (SSR) pages of your application during runtime. - */ -export type SsrUnion = boolean | SsrClass; -export type SsrClass = { - /** - * The server entry-point that when executed will spawn the web server. - */ - entry?: string; - /** - * Specifies the platform for which the server bundle is generated. This affects the APIs - * and modules available in the server-side code. - * - * - `node`: (Default) Generates a bundle optimized for Node.js environments. - * - `neutral`: Generates a platform-neutral bundle suitable for environments like edge - * workers, and other serverless platforms. This option avoids using Node.js-specific APIs, - * making the bundle more portable. - * - * Please note that this feature does not provide polyfills for Node.js modules. - * Additionally, it is experimental, and the schematics may undergo changes in future - * versions. - */ - experimentalPlatform?: ExperimentalPlatform; -}; -/** - * Specifies the platform for which the server bundle is generated. This affects the APIs - * and modules available in the server-side code. - * - * - `node`: (Default) Generates a bundle optimized for Node.js environments. - * - `neutral`: Generates a platform-neutral bundle suitable for environments like edge - * workers, and other serverless platforms. This option avoids using Node.js-specific APIs, - * making the bundle more portable. - * - * Please note that this feature does not provide polyfills for Node.js modules. - * Additionally, it is experimental, and the schematics may undergo changes in future - * versions. - */ -export declare enum ExperimentalPlatform { - Neutral = "neutral", - Node = "node" -} -/** - * Options to pass to style preprocessors. - */ -export type StylePreprocessorOptions = { - /** - * Paths to include. Paths will be resolved to workspace root. - */ - includePaths?: string[]; - /** - * Options to pass to the sass preprocessor. - */ - sass?: Sass; -}; -/** - * Options to pass to the sass preprocessor. - */ -export type Sass = { - /** - * A set of deprecations to treat as fatal. If a deprecation warning of any provided type is - * encountered during compilation, the compiler will error instead. If a Version is - * provided, then all deprecations that were active in that compiler version will be treated - * as fatal. - */ - fatalDeprecations?: string[]; - /** - * A set of future deprecations to opt into early. Future deprecations passed here will be - * treated as active by the compiler, emitting warnings as necessary. - */ - futureDeprecations?: string[]; - /** - * A set of active deprecations to ignore. If a deprecation warning of any provided type is - * encountered during compilation, the compiler will ignore it instead. - */ - silenceDeprecations?: string[]; -}; -export type StyleElement = StyleClass | string; -export type StyleClass = { - /** - * The bundle name for this extra entry point. - */ - bundleName?: string; - /** - * If the bundle will be referenced in the HTML file. - */ - inject?: boolean; - /** - * The file to include. - */ - input: string; -}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.js deleted file mode 100755 index ee708c2..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE -// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExperimentalPlatform = exports.OutputMode = exports.OutputHashing = exports.InlineStyleLanguage = exports.I18NTranslation = exports.CrossOrigin = exports.Type = void 0; -/** - * The type of budget. - */ -var Type; -(function (Type) { - Type["All"] = "all"; - Type["AllScript"] = "allScript"; - Type["Any"] = "any"; - Type["AnyComponentStyle"] = "anyComponentStyle"; - Type["AnyScript"] = "anyScript"; - Type["Bundle"] = "bundle"; - Type["Initial"] = "initial"; -})(Type || (exports.Type = Type = {})); -/** - * Define the crossorigin attribute setting of elements that provide CORS support. - */ -var CrossOrigin; -(function (CrossOrigin) { - CrossOrigin["Anonymous"] = "anonymous"; - CrossOrigin["None"] = "none"; - CrossOrigin["UseCredentials"] = "use-credentials"; -})(CrossOrigin || (exports.CrossOrigin = CrossOrigin = {})); -/** - * How to handle duplicate translations for i18n. - * - * How to handle missing translations for i18n. - */ -var I18NTranslation; -(function (I18NTranslation) { - I18NTranslation["Error"] = "error"; - I18NTranslation["Ignore"] = "ignore"; - I18NTranslation["Warning"] = "warning"; -})(I18NTranslation || (exports.I18NTranslation = I18NTranslation = {})); -/** - * The stylesheet language to use for the application's inline component styles. - */ -var InlineStyleLanguage; -(function (InlineStyleLanguage) { - InlineStyleLanguage["Css"] = "css"; - InlineStyleLanguage["Less"] = "less"; - InlineStyleLanguage["Sass"] = "sass"; - InlineStyleLanguage["Scss"] = "scss"; -})(InlineStyleLanguage || (exports.InlineStyleLanguage = InlineStyleLanguage = {})); -/** - * Define the output filename cache-busting hashing mode. - * - * - `none`: No hashing. - * - `all`: Hash for all output bundles. - * - `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in - * CSS files). - * - `bundles`: Hash for output of lazy and main bundles. - */ -var OutputHashing; -(function (OutputHashing) { - OutputHashing["All"] = "all"; - OutputHashing["Bundles"] = "bundles"; - OutputHashing["Media"] = "media"; - OutputHashing["None"] = "none"; -})(OutputHashing || (exports.OutputHashing = OutputHashing = {})); -/** - * Defines the type of build output artifact. 'static': Generates a static site build - * artifact for deployment on any static hosting service. 'server': Generates a server - * application build artifact, required for applications using hybrid rendering or APIs. - */ -var OutputMode; -(function (OutputMode) { - OutputMode["Server"] = "server"; - OutputMode["Static"] = "static"; -})(OutputMode || (exports.OutputMode = OutputMode = {})); -/** - * Specifies the platform for which the server bundle is generated. This affects the APIs - * and modules available in the server-side code. - * - * - `node`: (Default) Generates a bundle optimized for Node.js environments. - * - `neutral`: Generates a platform-neutral bundle suitable for environments like edge - * workers, and other serverless platforms. This option avoids using Node.js-specific APIs, - * making the bundle more portable. - * - * Please note that this feature does not provide polyfills for Node.js modules. - * Additionally, it is experimental, and the schematics may undergo changes in future - * versions. - */ -var ExperimentalPlatform; -(function (ExperimentalPlatform) { - ExperimentalPlatform["Neutral"] = "neutral"; - ExperimentalPlatform["Node"] = "node"; -})(ExperimentalPlatform || (exports.ExperimentalPlatform = ExperimentalPlatform = {})); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.json b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.json deleted file mode 100755 index 8db4e61..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/schema.json +++ /dev/null @@ -1,720 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "title": "Application schema for Build Facade.", - "description": "Application builder target options", - "type": "object", - "properties": { - "assets": { - "type": "array", - "description": "Define the assets to be copied to the output directory. These assets are copied as-is without any further processing or hashing.", - "default": [], - "items": { - "$ref": "#/definitions/assetPattern" - } - }, - "browser": { - "type": "string", - "description": "The full path for the browser entry point to the application, relative to the current workspace." - }, - "server": { - "description": "The full path for the server entry point to the application, relative to the current workspace.", - "oneOf": [ - { - "type": "string", - "description": "The full path for the server entry point to the application, relative to the current workspace." - }, - { - "const": false, - "type": "boolean", - "description": "Indicates that a server entry point is not provided." - } - ] - }, - "polyfills": { - "description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.", - "type": "array", - "items": { - "type": "string", - "uniqueItems": true - }, - "default": [] - }, - "tsConfig": { - "type": "string", - "description": "The full path for the TypeScript configuration file, relative to the current workspace." - }, - "deployUrl": { - "type": "string", - "description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations." - }, - "security": { - "description": "Security features to protect against XSS and other common attacks", - "type": "object", - "additionalProperties": false, - "properties": { - "autoCsp": { - "description": "Enables automatic generation of a hash-based Strict Content Security Policy (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will default to true once we are out of experimental/preview phases.", - "default": false, - "oneOf": [ - { - "type": "object", - "properties": { - "unsafeEval": { - "type": "boolean", - "description": "Include the `unsafe-eval` directive (https://web.dev/articles/strict-csp#remove-eval) in the auto-CSP. Please only enable this if you are absolutely sure that you need to, as allowing calls to eval will weaken the XSS defenses provided by the auto-CSP.", - "default": false - } - }, - "additionalProperties": false - }, - { - "type": "boolean" - } - ] - } - } - }, - "scripts": { - "description": "Global scripts to be included in the build.", - "type": "array", - "default": [], - "items": { - "oneOf": [ - { - "type": "object", - "properties": { - "input": { - "type": "string", - "description": "The file to include.", - "pattern": "\\.[cm]?jsx?$" - }, - "bundleName": { - "type": "string", - "pattern": "^[\\w\\-.]*$", - "description": "The bundle name for this extra entry point." - }, - "inject": { - "type": "boolean", - "description": "If the bundle will be referenced in the HTML file.", - "default": true - } - }, - "additionalProperties": false, - "required": ["input"] - }, - { - "type": "string", - "description": "The JavaScript/TypeScript file or package containing the file to include." - } - ] - } - }, - "styles": { - "description": "Global styles to be included in the build.", - "type": "array", - "default": [], - "items": { - "oneOf": [ - { - "type": "object", - "properties": { - "input": { - "type": "string", - "description": "The file to include.", - "pattern": "\\.(?:css|scss|sass|less)$" - }, - "bundleName": { - "type": "string", - "pattern": "^[\\w\\-.]*$", - "description": "The bundle name for this extra entry point." - }, - "inject": { - "type": "boolean", - "description": "If the bundle will be referenced in the HTML file.", - "default": true - } - }, - "additionalProperties": false, - "required": ["input"] - }, - { - "type": "string", - "description": "The file to include.", - "pattern": "\\.(?:css|scss|sass|less)$" - } - ] - } - }, - "inlineStyleLanguage": { - "description": "The stylesheet language to use for the application's inline component styles.", - "type": "string", - "default": "css", - "enum": ["css", "less", "sass", "scss"] - }, - "stylePreprocessorOptions": { - "description": "Options to pass to style preprocessors.", - "type": "object", - "properties": { - "includePaths": { - "description": "Paths to include. Paths will be resolved to workspace root.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "sass": { - "description": "Options to pass to the sass preprocessor.", - "type": "object", - "properties": { - "fatalDeprecations": { - "description": "A set of deprecations to treat as fatal. If a deprecation warning of any provided type is encountered during compilation, the compiler will error instead. If a Version is provided, then all deprecations that were active in that compiler version will be treated as fatal.", - "type": "array", - "items": { - "type": "string" - } - }, - "silenceDeprecations": { - "description": " A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead.", - "type": "array", - "items": { - "type": "string" - } - }, - "futureDeprecations": { - "description": "A set of future deprecations to opt into early. Future deprecations passed here will be treated as active by the compiler, emitting warnings as necessary.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "externalDependencies": { - "description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime. Note: `@foo/bar` marks all paths within the `@foo/bar` package as external, including sub-paths like `@foo/bar/baz`.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "clearScreen": { - "type": "boolean", - "default": false, - "description": "Automatically clear the terminal screen during rebuilds." - }, - "optimization": { - "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.", - "default": true, - "x-user-analytics": "ep.ng_optimization", - "oneOf": [ - { - "type": "object", - "properties": { - "scripts": { - "type": "boolean", - "description": "Enables optimization of the scripts output.", - "default": true - }, - "styles": { - "description": "Enables optimization of the styles output.", - "default": true, - "oneOf": [ - { - "type": "object", - "properties": { - "minify": { - "type": "boolean", - "description": "Minify CSS definitions by removing extraneous whitespace and comments, merging identifiers and minimizing values.", - "default": true - }, - "inlineCritical": { - "type": "boolean", - "description": "Extract and inline critical CSS definitions to improve first paint time.", - "default": true - }, - "removeSpecialComments": { - "type": "boolean", - "description": "Remove comments in global CSS that contains '@license' or '@preserve' or that starts with '//!' or '/*!'.", - "default": true - } - }, - "additionalProperties": false - }, - { - "type": "boolean" - } - ] - }, - "fonts": { - "description": "Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.", - "default": true, - "oneOf": [ - { - "type": "object", - "properties": { - "inline": { - "type": "boolean", - "description": "Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS definitions in the application's HTML index file. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.", - "default": true - } - }, - "additionalProperties": false - }, - { - "type": "boolean" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "boolean" - } - ] - }, - "loader": { - "description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `dataurl` inlines the content as a data URL with best guess of MIME type; `base64` inlines the content as a Base64-encoded string; `empty` considers the content to be empty and not include it in bundles.", - "type": "object", - "patternProperties": { - "^\\.\\S+$": { "enum": ["text", "binary", "file", "dataurl", "base64", "empty"] } - } - }, - "define": { - "description": "Defines global identifiers that will be replaced with a specified constant value when found in any JavaScript or TypeScript code including libraries. The value will be used directly. String values must be put in quotes. Identifiers within Angular metadata such as Component Decorators will not be replaced.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "conditions": { - "description": "Custom package resolution conditions used to resolve conditional exports/imports. Defaults to ['module', 'development'/'production']. The following special conditions are always present if the requirements are satisfied: 'default', 'import', 'require', 'browser', 'node'.", - "type": "array", - "items": { - "type": "string" - } - }, - "fileReplacements": { - "description": "Replace compilation source files with other compilation source files in the build.", - "type": "array", - "items": { - "$ref": "#/definitions/fileReplacement" - }, - "default": [] - }, - "outputPath": { - "description": "Specify the output path relative to workspace root.", - "oneOf": [ - { - "type": "object", - "properties": { - "base": { - "type": "string", - "description": "Specify the output path relative to workspace root." - }, - "browser": { - "type": "string", - "pattern": "^[-\\w\\.]*$", - "default": "browser", - "description": "The output directory name of your browser build within the output path base. Defaults to 'browser'." - }, - "server": { - "type": "string", - "pattern": "^[-\\w\\.]*$", - "default": "server", - "description": "The output directory name of your server build within the output path base. Defaults to 'server'." - }, - "media": { - "type": "string", - "pattern": "^[-\\w\\.]+$", - "default": "media", - "description": "The output directory name of your media files within the output browser directory. Defaults to 'media'." - } - }, - "required": ["base"], - "additionalProperties": false - }, - { - "type": "string" - } - ] - }, - "aot": { - "type": "boolean", - "description": "Build using Ahead of Time compilation.", - "x-user-analytics": "ep.ng_aot", - "default": true - }, - "sourceMap": { - "description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.", - "default": false, - "oneOf": [ - { - "type": "object", - "properties": { - "scripts": { - "type": "boolean", - "description": "Output source maps for all scripts.", - "default": true - }, - "styles": { - "type": "boolean", - "description": "Output source maps for all styles.", - "default": true - }, - "hidden": { - "type": "boolean", - "description": "Output source maps used for error reporting tools.", - "default": false - }, - "vendor": { - "type": "boolean", - "description": "Resolve vendor packages source maps.", - "default": false - }, - "sourcesContent": { - "type": "boolean", - "description": "Output original source content for files within the source map.", - "default": true - } - }, - "additionalProperties": false - }, - { - "type": "boolean" - } - ] - }, - "baseHref": { - "type": "string", - "description": "Base url for the application being built." - }, - "verbose": { - "type": "boolean", - "description": "Adds more details to output logging.", - "default": false - }, - "progress": { - "type": "boolean", - "description": "Log progress to the console while building.", - "default": true - }, - "i18nMissingTranslation": { - "type": "string", - "description": "How to handle missing translations for i18n.", - "enum": ["warning", "error", "ignore"], - "default": "warning" - }, - "i18nDuplicateTranslation": { - "type": "string", - "description": "How to handle duplicate translations for i18n.", - "enum": ["warning", "error", "ignore"], - "default": "warning" - }, - "localize": { - "description": "Translate the bundles in one or more locales.", - "oneOf": [ - { - "type": "boolean", - "description": "Translate all locales." - }, - { - "type": "array", - "description": "List of locales ID's to translate.", - "minItems": 1, - "items": { - "type": "string", - "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$" - } - } - ] - }, - "watch": { - "type": "boolean", - "description": "Run build when files change.", - "default": false - }, - "outputHashing": { - "type": "string", - "description": "Define the output filename cache-busting hashing mode.\n\n- `none`: No hashing.\n- `all`: Hash for all output bundles. \n- `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in CSS files).\n- `bundles`: Hash for output of lazy and main bundles.", - "default": "none", - "enum": ["none", "all", "media", "bundles"] - }, - "poll": { - "type": "number", - "description": "Enable and define the file watching poll time period in milliseconds." - }, - "deleteOutputPath": { - "type": "boolean", - "description": "Delete the output path before building.", - "default": true - }, - "preserveSymlinks": { - "type": "boolean", - "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set." - }, - "extractLicenses": { - "type": "boolean", - "description": "Extract all licenses in a separate file.", - "default": true - }, - "namedChunks": { - "type": "boolean", - "description": "Use file name for lazy loaded chunks.", - "default": false - }, - "subresourceIntegrity": { - "type": "boolean", - "description": "Enables the use of subresource integrity validation.", - "default": false - }, - "serviceWorker": { - "description": "Generates a service worker configuration.", - "default": false, - "oneOf": [ - { - "type": "string", - "description": "Path to ngsw-config.json." - }, - { - "const": false, - "type": "boolean", - "description": "Does not generate a service worker configuration." - } - ] - }, - "index": { - "description": "Configures the generation of the application's HTML index.", - "oneOf": [ - { - "type": "string", - "description": "The path of a file to use for the application's HTML index. The filename of the specified path will be used for the generated file and will be created in the root of the application's configured output path." - }, - { - "type": "object", - "description": "", - "properties": { - "input": { - "type": "string", - "minLength": 1, - "description": "The path of a file to use for the application's generated HTML index." - }, - "output": { - "type": "string", - "minLength": 1, - "default": "index.html", - "description": "The output path of the application's generated HTML index file. The full provided path will be used and will be considered relative to the application's configured output path." - }, - "preloadInitial": { - "type": "boolean", - "default": true, - "description": "Generates 'preload', 'modulepreload', and 'preconnect' link elements for initial application files and resources." - } - }, - "required": ["input"] - }, - { - "const": false, - "type": "boolean", - "description": "Does not generate an `index.html` file." - } - ] - }, - "statsJson": { - "type": "boolean", - "description": "Generates a 'stats.json' file which can be analyzed with https://esbuild.github.io/analyze/.", - "default": false - }, - "budgets": { - "description": "Budget thresholds to ensure parts of your application stay within boundaries which you set.", - "type": "array", - "items": { - "$ref": "#/definitions/budget" - }, - "default": [] - }, - "webWorkerTsConfig": { - "type": "string", - "description": "TypeScript configuration for Web Worker modules." - }, - "crossOrigin": { - "type": "string", - "description": "Define the crossorigin attribute setting of elements that provide CORS support.", - "default": "none", - "enum": ["none", "anonymous", "use-credentials"] - }, - "allowedCommonJsDependencies": { - "description": "A list of CommonJS or AMD packages that are allowed to be used without a build time warning. Use `'*'` to allow all.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "prerender": { - "description": "Prerender (SSG) pages of your application during build time.", - "oneOf": [ - { - "type": "boolean", - "description": "Enable prerending of pages of your application during build time." - }, - { - "type": "object", - "properties": { - "routesFile": { - "type": "string", - "description": "The path to a file that contains a list of all routes to prerender, separated by newlines. This option is useful if you want to prerender routes with parameterized URLs." - }, - "discoverRoutes": { - "type": "boolean", - "description": "Whether the builder should process the Angular Router configuration to find all unparameterized routes and prerender them.", - "default": true - } - }, - "additionalProperties": false - } - ] - }, - "ssr": { - "description": "Server side render (SSR) pages of your application during runtime.", - "default": false, - "oneOf": [ - { - "type": "boolean", - "description": "Enable the server bundles to be written to disk." - }, - { - "type": "object", - "properties": { - "entry": { - "type": "string", - "description": "The server entry-point that when executed will spawn the web server." - }, - "experimentalPlatform": { - "description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules. Additionally, it is experimental, and the schematics may undergo changes in future versions.", - "default": "node", - "enum": ["node", "neutral"] - } - }, - "additionalProperties": false - } - ] - }, - "appShell": { - "type": "boolean", - "description": "Generates an application shell during build time." - }, - "outputMode": { - "type": "string", - "description": "Defines the type of build output artifact. 'static': Generates a static site build artifact for deployment on any static hosting service. 'server': Generates a server application build artifact, required for applications using hybrid rendering or APIs.", - "enum": ["static", "server"] - } - }, - "additionalProperties": false, - "required": ["tsConfig"], - "definitions": { - "assetPattern": { - "oneOf": [ - { - "type": "object", - "properties": { - "followSymlinks": { - "type": "boolean", - "default": false, - "description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched." - }, - "glob": { - "type": "string", - "description": "The pattern to match." - }, - "input": { - "type": "string", - "description": "The input directory path in which to apply 'glob'. Defaults to the project root." - }, - "ignore": { - "description": "An array of globs to ignore.", - "type": "array", - "items": { - "type": "string" - } - }, - "output": { - "type": "string", - "default": "", - "description": "Absolute path within the output." - } - }, - "additionalProperties": false, - "required": ["glob", "input"] - }, - { - "type": "string" - } - ] - }, - "fileReplacement": { - "type": "object", - "properties": { - "replace": { - "type": "string", - "pattern": "\\.(([cm]?[jt])sx?|json)$" - }, - "with": { - "type": "string", - "pattern": "\\.(([cm]?[jt])sx?|json)$" - } - }, - "additionalProperties": false, - "required": ["replace", "with"] - }, - "budget": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "The type of budget.", - "enum": ["all", "allScript", "any", "anyScript", "anyComponentStyle", "bundle", "initial"] - }, - "name": { - "type": "string", - "description": "The name of the bundle." - }, - "baseline": { - "type": "string", - "description": "The baseline size for comparison." - }, - "maximumWarning": { - "type": "string", - "description": "The maximum threshold for warning relative to the baseline." - }, - "maximumError": { - "type": "string", - "description": "The maximum threshold for error relative to the baseline." - }, - "minimumWarning": { - "type": "string", - "description": "The minimum threshold for warning relative to the baseline." - }, - "minimumError": { - "type": "string", - "description": "The minimum threshold for error relative to the baseline." - }, - "warning": { - "type": "string", - "description": "The threshold for warning relative to the baseline (min & max)." - }, - "error": { - "type": "string", - "description": "The threshold for error relative to the baseline (min & max)." - } - }, - "additionalProperties": false, - "required": ["type"] - } - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/setup-bundling.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/setup-bundling.d.ts deleted file mode 100755 index ab0253c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/setup-bundling.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { AngularCompilation } from '../../tools/angular/compilation'; -import { ComponentStylesheetBundler } from '../../tools/esbuild/angular/component-stylesheets'; -import { SourceFileCache } from '../../tools/esbuild/angular/source-file-cache'; -import { BundlerContext } from '../../tools/esbuild/bundler-context'; -import { NormalizedApplicationBuildOptions } from './options'; -/** - * Generates one or more BundlerContext instances based on the builder provided - * configuration. - * @param options The normalized application builder options to use. - * @param browsers An string array of browserslist browsers to support. - * @param codeBundleCache An instance of the TypeScript source file cache. - * @returns An array of BundlerContext objects. - */ -export declare function setupBundlerContexts(options: NormalizedApplicationBuildOptions, target: string[], codeBundleCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler, angularCompilation: AngularCompilation, templateUpdates: Map | undefined): { - typescriptContexts: BundlerContext[]; - otherContexts: BundlerContext[]; -}; -export declare function createComponentStyleBundler(options: NormalizedApplicationBuildOptions, target: string[]): ComponentStylesheetBundler; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/setup-bundling.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/setup-bundling.js deleted file mode 100755 index 06f86f8..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/application/setup-bundling.js +++ /dev/null @@ -1,103 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.setupBundlerContexts = setupBundlerContexts; -exports.createComponentStyleBundler = createComponentStyleBundler; -const component_stylesheets_1 = require("../../tools/esbuild/angular/component-stylesheets"); -const application_code_bundle_1 = require("../../tools/esbuild/application-code-bundle"); -const bundler_context_1 = require("../../tools/esbuild/bundler-context"); -const global_scripts_1 = require("../../tools/esbuild/global-scripts"); -const global_styles_1 = require("../../tools/esbuild/global-styles"); -const utils_1 = require("../../tools/esbuild/utils"); -/** - * Generates one or more BundlerContext instances based on the builder provided - * configuration. - * @param options The normalized application builder options to use. - * @param browsers An string array of browserslist browsers to support. - * @param codeBundleCache An instance of the TypeScript source file cache. - * @returns An array of BundlerContext objects. - */ -function setupBundlerContexts(options, target, codeBundleCache, stylesheetBundler, angularCompilation, templateUpdates) { - const { outputMode, serverEntryPoint, appShellOptions, prerenderOptions, ssrOptions, workspaceRoot, watch = false, } = options; - const typescriptContexts = []; - const otherContexts = []; - // Browser application code - typescriptContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, (0, application_code_bundle_1.createBrowserCodeBundleOptions)(options, target, codeBundleCache, stylesheetBundler, angularCompilation, templateUpdates))); - // Browser polyfills code - const browserPolyfillBundleOptions = (0, application_code_bundle_1.createBrowserPolyfillBundleOptions)(options, target, codeBundleCache, stylesheetBundler); - if (browserPolyfillBundleOptions) { - const browserPolyfillContext = new bundler_context_1.BundlerContext(workspaceRoot, watch, browserPolyfillBundleOptions); - if (typeof browserPolyfillBundleOptions === 'function') { - otherContexts.push(browserPolyfillContext); - } - else { - typescriptContexts.push(browserPolyfillContext); - } - } - // Global Stylesheets - if (options.globalStyles.length > 0) { - for (const initial of [true, false]) { - const bundleOptions = (0, global_styles_1.createGlobalStylesBundleOptions)(options, target, initial); - if (bundleOptions) { - otherContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, bundleOptions, () => initial)); - } - } - } - // Global Scripts - if (options.globalScripts.length > 0) { - for (const initial of [true, false]) { - const bundleOptions = (0, global_scripts_1.createGlobalScriptsBundleOptions)(options, target, initial); - if (bundleOptions) { - otherContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, bundleOptions, () => initial)); - } - } - } - // Skip server build when none of the features are enabled. - if (serverEntryPoint && (outputMode || prerenderOptions || appShellOptions || ssrOptions)) { - const nodeTargets = [...target, ...(0, utils_1.getSupportedNodeTargets)()]; - typescriptContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, (0, application_code_bundle_1.createServerMainCodeBundleOptions)(options, nodeTargets, codeBundleCache, stylesheetBundler))); - if (outputMode && ssrOptions?.entry) { - // New behavior introduced: 'server.ts' is now bundled separately from 'main.server.ts'. - typescriptContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, (0, application_code_bundle_1.createSsrEntryCodeBundleOptions)(options, nodeTargets, codeBundleCache, stylesheetBundler))); - } - // Server polyfills code - const serverPolyfillBundleOptions = (0, application_code_bundle_1.createServerPolyfillBundleOptions)(options, nodeTargets, codeBundleCache.loadResultCache); - if (serverPolyfillBundleOptions) { - otherContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, serverPolyfillBundleOptions)); - } - } - return { typescriptContexts, otherContexts }; -} -function createComponentStyleBundler(options, target) { - const { workspaceRoot, optimizationOptions, sourcemapOptions, outputNames, externalDependencies, preserveSymlinks, stylePreprocessorOptions, inlineStyleLanguage, cacheOptions, tailwindConfiguration, postcssConfiguration, publicPath, } = options; - const incremental = !!options.watch; - return new component_stylesheets_1.ComponentStylesheetBundler({ - workspaceRoot, - inlineFonts: !!optimizationOptions.fonts.inline, - optimization: !!optimizationOptions.styles.minify, - sourcemap: - // Hidden component stylesheet sourcemaps are inaccessible which is effectively - // the same as being disabled. Disabling has the advantage of avoiding the overhead - // of sourcemap processing. - sourcemapOptions.styles && !sourcemapOptions.hidden ? 'linked' : false, - sourcesContent: sourcemapOptions.sourcesContent, - outputNames, - includePaths: stylePreprocessorOptions?.includePaths, - // string[] | undefined' is not assignable to type '(Version | DeprecationOrId)[] | undefined'. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sass: stylePreprocessorOptions?.sass, - externalDependencies, - target, - preserveSymlinks, - tailwindConfiguration, - postcssConfiguration, - cacheOptions, - publicPath, - }, inlineStyleLanguage, incremental); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/builder.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/builder.d.ts deleted file mode 100755 index 3d0c4f8..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/builder.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuilderContext } from '@angular-devkit/architect'; -import type { Plugin } from 'esbuild'; -import type http from 'node:http'; -import { type IndexHtmlTransform } from './internal'; -import type { DevServerBuilderOutput } from './output'; -import type { Schema as DevServerBuilderOptions } from './schema'; -/** - * A Builder that executes a development server based on the provided browser target option. - * - * Usage of the `transforms` and/or `extensions` parameters is NOT supported and may cause - * unexpected build output or build failures. - * - * @param options Dev Server options. - * @param context The build context. - * @param extensions An optional object containing an array of build plugins (esbuild-based) - * and/or HTTP request middleware. - * - * @experimental Direct usage of this function is considered experimental. - */ -export declare function execute(options: DevServerBuilderOptions, context: BuilderContext, extensions?: { - buildPlugins?: Plugin[]; - middleware?: ((req: http.IncomingMessage, res: http.ServerResponse, next: (err?: unknown) => void) => void)[]; - indexHtmlTransformer?: IndexHtmlTransform; -}): AsyncIterable; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/builder.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/builder.js deleted file mode 100755 index 3965771..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/builder.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.execute = execute; -const check_port_1 = require("../../utils/check-port"); -const internal_1 = require("./internal"); -const options_1 = require("./options"); -const vite_server_1 = require("./vite-server"); -/** - * A Builder that executes a development server based on the provided browser target option. - * - * Usage of the `transforms` and/or `extensions` parameters is NOT supported and may cause - * unexpected build output or build failures. - * - * @param options Dev Server options. - * @param context The build context. - * @param extensions An optional object containing an array of build plugins (esbuild-based) - * and/or HTTP request middleware. - * - * @experimental Direct usage of this function is considered experimental. - */ -async function* execute(options, context, extensions) { - // Determine project name from builder context target - const projectName = context.target?.project; - if (!projectName) { - context.logger.error(`The "dev-server" builder requires a target to be specified.`); - return; - } - const { builderName, normalizedOptions } = await initialize(options, projectName, context); - yield* (0, vite_server_1.serveWithVite)(normalizedOptions, builderName, (options, context, plugins) => (0, internal_1.buildApplicationInternal)(options, context, { codePlugins: plugins }), context, { indexHtml: extensions?.indexHtmlTransformer }, extensions); -} -async function initialize(initialOptions, projectName, context) { - // Purge old build disk cache. - await (0, internal_1.purgeStaleBuildCache)(context); - const normalizedOptions = await (0, options_1.normalizeOptions)(context, projectName, initialOptions); - const builderName = await context.getBuilderNameForTarget(normalizedOptions.buildTarget); - if (!/^127\.\d+\.\d+\.\d+/g.test(normalizedOptions.host) && - normalizedOptions.host !== '::1' && - normalizedOptions.host !== 'localhost') { - context.logger.warn(` -Warning: This is a simple server for use in testing or debugging Angular applications -locally. It hasn't been reviewed for security issues. - -Binding this server to an open connection can result in compromising your application or -computer. Using a different host than the one passed to the "--host" flag might result in -websocket connection issues. - `); - } - normalizedOptions.port = await (0, check_port_1.checkPort)(normalizedOptions.port, normalizedOptions.host); - return { - builderName, - normalizedOptions, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/index.d.ts deleted file mode 100755 index 3e860d1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { Builder } from '@angular-devkit/architect'; -import { execute } from './builder'; -import type { DevServerBuilderOutput } from './output'; -import type { Schema as DevServerBuilderOptions } from './schema'; -export { type DevServerBuilderOptions, type DevServerBuilderOutput, execute as executeDevServerBuilder, }; -declare const builder: Builder; -export default builder; -export { execute as executeDevServer }; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/index.js deleted file mode 100755 index 599dd7c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.executeDevServer = exports.executeDevServerBuilder = void 0; -const architect_1 = require("@angular-devkit/architect"); -const builder_1 = require("./builder"); -Object.defineProperty(exports, "executeDevServerBuilder", { enumerable: true, get: function () { return builder_1.execute; } }); -Object.defineProperty(exports, "executeDevServer", { enumerable: true, get: function () { return builder_1.execute; } }); -const builder = (0, architect_1.createBuilder)(builder_1.execute); -exports.default = builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/internal.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/internal.d.ts deleted file mode 100755 index 1419f6e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/internal.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export { type BuildOutputFile, BuildOutputFileType } from '../../tools/esbuild/bundler-context'; -export { createRxjsEsmResolutionPlugin } from '../../tools/esbuild/rxjs-esm-resolution-plugin'; -export { JavaScriptTransformer } from '../../tools/esbuild/javascript-transformer'; -export { getFeatureSupport, isZonelessApp } from '../../tools/esbuild/utils'; -export { type IndexHtmlTransform } from '../../utils/index-file/index-html-generator'; -export { purgeStaleBuildCache } from '../../utils/purge-cache'; -export { getSupportedBrowsers } from '../../utils/supported-browsers'; -export { transformSupportedBrowsersToTargets } from '../../tools/esbuild/utils'; -export { buildApplicationInternal } from '../../builders/application'; -export type { ApplicationBuilderInternalOptions } from '../../builders/application/options'; -export type { ExternalResultMetadata } from '../../tools/esbuild/bundler-execution-result'; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/internal.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/internal.js deleted file mode 100755 index 2561519..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/internal.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.buildApplicationInternal = exports.transformSupportedBrowsersToTargets = exports.getSupportedBrowsers = exports.purgeStaleBuildCache = exports.isZonelessApp = exports.getFeatureSupport = exports.JavaScriptTransformer = exports.createRxjsEsmResolutionPlugin = exports.BuildOutputFileType = void 0; -var bundler_context_1 = require("../../tools/esbuild/bundler-context"); -Object.defineProperty(exports, "BuildOutputFileType", { enumerable: true, get: function () { return bundler_context_1.BuildOutputFileType; } }); -var rxjs_esm_resolution_plugin_1 = require("../../tools/esbuild/rxjs-esm-resolution-plugin"); -Object.defineProperty(exports, "createRxjsEsmResolutionPlugin", { enumerable: true, get: function () { return rxjs_esm_resolution_plugin_1.createRxjsEsmResolutionPlugin; } }); -var javascript_transformer_1 = require("../../tools/esbuild/javascript-transformer"); -Object.defineProperty(exports, "JavaScriptTransformer", { enumerable: true, get: function () { return javascript_transformer_1.JavaScriptTransformer; } }); -var utils_1 = require("../../tools/esbuild/utils"); -Object.defineProperty(exports, "getFeatureSupport", { enumerable: true, get: function () { return utils_1.getFeatureSupport; } }); -Object.defineProperty(exports, "isZonelessApp", { enumerable: true, get: function () { return utils_1.isZonelessApp; } }); -var purge_cache_1 = require("../../utils/purge-cache"); -Object.defineProperty(exports, "purgeStaleBuildCache", { enumerable: true, get: function () { return purge_cache_1.purgeStaleBuildCache; } }); -var supported_browsers_1 = require("../../utils/supported-browsers"); -Object.defineProperty(exports, "getSupportedBrowsers", { enumerable: true, get: function () { return supported_browsers_1.getSupportedBrowsers; } }); -var utils_2 = require("../../tools/esbuild/utils"); -Object.defineProperty(exports, "transformSupportedBrowsersToTargets", { enumerable: true, get: function () { return utils_2.transformSupportedBrowsersToTargets; } }); -var application_1 = require("../../builders/application"); -Object.defineProperty(exports, "buildApplicationInternal", { enumerable: true, get: function () { return application_1.buildApplicationInternal; } }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/options.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/options.d.ts deleted file mode 100755 index ed8e102..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/options.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BuilderContext } from '@angular-devkit/architect'; -import { Schema as DevServerOptions } from './schema'; -export type NormalizedDevServerOptions = Awaited>; -/** - * Normalize the user provided options by creating full paths for all path based options - * and converting multi-form options into a single form that can be directly used - * by the build process. - * - * @param context The context for current builder execution. - * @param projectName The name of the project for the current execution. - * @param options An object containing the options to use for the build. - * @returns An object containing normalized options required to perform the build. - */ -export declare function normalizeOptions(context: BuilderContext, projectName: string, options: DevServerOptions): Promise<{ - buildTarget: import("@angular-devkit/architect").Target; - host: string; - port: number; - poll: number | undefined; - open: boolean | undefined; - verbose: boolean | undefined; - watch: boolean | undefined; - liveReload: boolean; - hmr: boolean; - headers: { - [key: string]: string; - } | undefined; - workspaceRoot: string; - projectRoot: string; - cacheOptions: import("../../utils/normalize-cache").NormalizedCachedOptions; - proxyConfig: string | undefined; - servePath: string | undefined; - ssl: boolean | undefined; - sslCert: string | undefined; - sslKey: string | undefined; - prebundle: import("./schema").PrebundleUnion | undefined; - inspect: boolean | { - host?: string; - port?: number; - }; - allowedHosts: true | string[]; -}>; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/options.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/options.js deleted file mode 100755 index 58dc59e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/options.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.normalizeOptions = normalizeOptions; -const architect_1 = require("@angular-devkit/architect"); -const node_path_1 = __importDefault(require("node:path")); -const utils_1 = require("../../utils"); -const normalize_cache_1 = require("../../utils/normalize-cache"); -/** - * Normalize the user provided options by creating full paths for all path based options - * and converting multi-form options into a single form that can be directly used - * by the build process. - * - * @param context The context for current builder execution. - * @param projectName The name of the project for the current execution. - * @param options An object containing the options to use for the build. - * @returns An object containing normalized options required to perform the build. - */ -async function normalizeOptions(context, projectName, options) { - const { workspaceRoot, logger } = context; - const projectMetadata = await context.getProjectMetadata(projectName); - const projectRoot = node_path_1.default.join(workspaceRoot, projectMetadata.root ?? ''); - const cacheOptions = (0, normalize_cache_1.normalizeCacheOptions)(projectMetadata, workspaceRoot); - // Target specifier defaults to the current project's build target using a development configuration - const buildTargetSpecifier = options.buildTarget ?? `::development`; - const buildTarget = (0, architect_1.targetFromTargetString)(buildTargetSpecifier, projectName, 'build'); - // Get the application builder options. - const browserBuilderName = await context.getBuilderNameForTarget(buildTarget); - const rawBuildOptions = await context.getTargetOptions(buildTarget); - const buildOptions = (await context.validateOptions(rawBuildOptions, browserBuilderName)); - const optimization = (0, utils_1.normalizeOptimization)(buildOptions.optimization); - if (options.prebundle) { - if (!cacheOptions.enabled) { - // Warn if the initial options provided by the user enable prebundling but caching is disabled - logger.warn('Prebundling has been configured but will not be used because caching has been disabled.'); - } - else if (optimization.scripts) { - // Warn if the initial options provided by the user enable prebundling but script optimization is enabled. - logger.warn('Prebundling has been configured but will not be used because scripts optimization is enabled.'); - } - } - let inspect = false; - const inspectRaw = options.inspect; - if (inspectRaw === true || inspectRaw === '' || inspectRaw === 'true') { - inspect = { - host: undefined, - port: undefined, - }; - } - else if (typeof inspectRaw === 'string' && inspectRaw !== 'false') { - const port = +inspectRaw; - if (isFinite(port)) { - inspect = { - host: undefined, - port, - }; - } - else { - const [host, port] = inspectRaw.split(':'); - inspect = { - host, - port: isNaN(+port) ? undefined : +port, - }; - } - } - // Initial options to keep - const { host, port, poll, open, verbose, watch, liveReload, hmr, headers, proxyConfig, servePath, ssl, sslCert, sslKey, prebundle, allowedHosts, } = options; - // Return all the normalized options - return { - buildTarget, - host: host ?? 'localhost', - port: port ?? 4200, - poll, - open, - verbose, - watch, - liveReload: !!liveReload, - hmr: hmr ?? !!liveReload, - headers, - workspaceRoot, - projectRoot, - cacheOptions, - proxyConfig, - servePath, - ssl, - sslCert, - sslKey, - // Prebundling defaults to true but requires caching to function - prebundle: cacheOptions.enabled && !optimization.scripts && prebundle, - inspect, - allowedHosts: allowedHosts ? allowedHosts : [], - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/output.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/output.d.ts deleted file mode 100755 index df4a38c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/output.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BuilderOutput } from '@angular-devkit/architect'; -/** - * @experimental Direct usage of this type is considered experimental. - */ -export interface DevServerBuilderOutput extends BuilderOutput { - baseUrl: string; - port?: number; - address?: string; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/output.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/output.js deleted file mode 100755 index 7c2bf23..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/output.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.d.ts deleted file mode 100755 index 39742e1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.d.ts +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Dev Server target options for Build Facade. - */ -export type Schema = { - /** - * The hosts that the development server will respond to. This option sets the Vite option - * of the same name. For further details: - * https://vite.dev/config/server-options.html#server-allowedhosts - */ - allowedHosts?: AllowedHosts; - /** - * A build builder target to serve in the format of `project:target[:configuration]`. You - * can also pass in more than one configuration name as a comma-separated list. Example: - * `project:target:production,staging`. - */ - buildTarget: string; - /** - * Custom HTTP headers to be added to all responses. - */ - headers?: { - [key: string]: string; - }; - /** - * Enable hot module replacement. Defaults to the value of 'liveReload'. Currently, only - * global and component stylesheets are supported. - */ - hmr?: boolean; - /** - * Host to listen on. - */ - host?: string; - /** - * Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are - * enabled. - */ - inspect?: Inspect; - /** - * Whether to reload the page on change, using live-reload. - */ - liveReload?: boolean; - /** - * Opens the url in default browser. - */ - open?: boolean; - /** - * Enable and define the file watching poll time period in milliseconds. - */ - poll?: number; - /** - * Port to listen on. - */ - port?: number; - /** - * Enable and control the Vite-based development server's prebundling capabilities. To - * enable prebundling, the Angular CLI cache must also be enabled. - */ - prebundle?: PrebundleUnion; - /** - * Proxy configuration file. For more information, see - * https://angular.dev/tools/cli/serve#proxying-to-a-backend-server. - */ - proxyConfig?: string; - /** - * The pathname where the application will be served. - */ - servePath?: string; - /** - * Serve using HTTPS. - */ - ssl?: boolean; - /** - * SSL certificate to use for serving HTTPS. - */ - sslCert?: string; - /** - * SSL key to use for serving HTTPS. - */ - sslKey?: string; - /** - * Adds more details to output logging. - */ - verbose?: boolean; - /** - * Rebuild on change. - */ - watch?: boolean; -}; -/** - * The hosts that the development server will respond to. This option sets the Vite option - * of the same name. For further details: - * https://vite.dev/config/server-options.html#server-allowedhosts - */ -export type AllowedHosts = string[] | boolean; -/** - * Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are - * enabled. - */ -export type Inspect = boolean | string; -/** - * Enable and control the Vite-based development server's prebundling capabilities. To - * enable prebundling, the Angular CLI cache must also be enabled. - */ -export type PrebundleUnion = boolean | PrebundleClass; -export type PrebundleClass = { - /** - * List of package imports that should not be prebundled by the development server. The - * packages will be bundled into the application code itself. Note: specifying `@foo/bar` - * marks all paths within the `@foo/bar` package as excluded, including sub-paths like - * `@foo/bar/baz`. - */ - exclude: string[]; -}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.js deleted file mode 100755 index 4fb6d3d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE -// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.json b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.json deleted file mode 100755 index 41902e4..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/schema.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "title": "Dev Server Target", - "description": "Dev Server target options for Build Facade.", - "type": "object", - "properties": { - "buildTarget": { - "type": "string", - "description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.", - "pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$" - }, - "port": { - "type": "number", - "description": "Port to listen on.", - "default": 4200 - }, - "host": { - "type": "string", - "description": "Host to listen on.", - "default": "localhost" - }, - "proxyConfig": { - "type": "string", - "description": "Proxy configuration file. For more information, see https://angular.dev/tools/cli/serve#proxying-to-a-backend-server." - }, - "ssl": { - "type": "boolean", - "description": "Serve using HTTPS.", - "default": false - }, - "sslKey": { - "type": "string", - "description": "SSL key to use for serving HTTPS." - }, - "sslCert": { - "type": "string", - "description": "SSL certificate to use for serving HTTPS." - }, - "allowedHosts": { - "description": "The hosts that the development server will respond to. This option sets the Vite option of the same name. For further details: https://vite.dev/config/server-options.html#server-allowedhosts", - "default": [], - "oneOf": [ - { - "type": "array", - "description": "A list of hosts that the development server will respond to.", - "items": { - "type": "string" - } - }, - { - "type": "boolean", - "description": "Indicates that all hosts are allowed. This is not recommended and a security risk." - } - ] - }, - "headers": { - "type": "object", - "description": "Custom HTTP headers to be added to all responses.", - "propertyNames": { - "pattern": "^[-_A-Za-z0-9]+$" - }, - "additionalProperties": { - "type": "string" - } - }, - "open": { - "type": "boolean", - "description": "Opens the url in default browser.", - "default": false, - "alias": "o" - }, - "verbose": { - "type": "boolean", - "description": "Adds more details to output logging." - }, - "liveReload": { - "type": "boolean", - "description": "Whether to reload the page on change, using live-reload.", - "default": true - }, - "servePath": { - "type": "string", - "description": "The pathname where the application will be served." - }, - "hmr": { - "type": "boolean", - "description": "Enable hot module replacement. Defaults to the value of 'liveReload'. Currently, only global and component stylesheets are supported." - }, - "watch": { - "type": "boolean", - "description": "Rebuild on change.", - "default": true - }, - "poll": { - "type": "number", - "description": "Enable and define the file watching poll time period in milliseconds." - }, - "inspect": { - "default": false, - "description": "Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are enabled.", - "oneOf": [ - { - "type": "string", - "description": "Activate the inspector on host and port in the format of `[[host:]port]`. See the security warning in https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure regarding the host parameter usage." - }, - { "type": "boolean" } - ] - }, - "prebundle": { - "description": "Enable and control the Vite-based development server's prebundling capabilities. To enable prebundling, the Angular CLI cache must also be enabled.", - "default": true, - "oneOf": [ - { "type": "boolean" }, - { - "type": "object", - "properties": { - "exclude": { - "description": "List of package imports that should not be prebundled by the development server. The packages will be bundled into the application code itself. Note: specifying `@foo/bar` marks all paths within the `@foo/bar` package as excluded, including sub-paths like `@foo/bar/baz`.", - "type": "array", - "items": { "type": "string" } - } - }, - "additionalProperties": false, - "required": ["exclude"] - } - ] - } - }, - "additionalProperties": false, - "required": ["buildTarget"] -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/vite-server.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/vite-server.d.ts deleted file mode 100755 index 2452ec4..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/vite-server.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuilderContext } from '@angular-devkit/architect'; -import type { Plugin } from 'esbuild'; -import type { Connect, InlineConfig } from 'vite'; -import type { ComponentStyleRecord } from '../../tools/vite/middlewares'; -import { ServerSsrMode } from '../../tools/vite/plugins'; -import { EsbuildLoaderOption } from '../../tools/vite/utils'; -import { Result } from '../application/results'; -import { type ApplicationBuilderInternalOptions, BuildOutputFileType, type ExternalResultMetadata, JavaScriptTransformer } from './internal'; -import type { NormalizedDevServerOptions } from './options'; -import type { DevServerBuilderOutput } from './output'; -interface OutputFileRecord { - contents: Uint8Array; - size: number; - hash: string; - updated: boolean; - servable: boolean; - type: BuildOutputFileType; -} -interface OutputAssetRecord { - source: string; - updated: boolean; -} -interface DevServerExternalResultMetadata extends Omit { - explicitBrowser: string[]; - explicitServer: string[]; -} -export type BuilderAction = (options: ApplicationBuilderInternalOptions, context: BuilderContext, plugins?: Plugin[]) => AsyncIterable; -export declare function serveWithVite(serverOptions: NormalizedDevServerOptions, builderName: string, builderAction: BuilderAction, context: BuilderContext, transformers?: { - indexHtml?: (content: string) => Promise; -}, extensions?: { - middleware?: Connect.NextHandleFunction[]; - buildPlugins?: Plugin[]; -}): AsyncIterableIterator; -export declare function setupServer(serverOptions: NormalizedDevServerOptions, outputFiles: Map, assets: Map, preserveSymlinks: boolean | undefined, externalMetadata: DevServerExternalResultMetadata, ssrMode: ServerSsrMode, prebundleTransformer: JavaScriptTransformer, target: string[], zoneless: boolean, componentStyles: Map, templateUpdates: Map, prebundleLoaderExtensions: EsbuildLoaderOption | undefined, define: ApplicationBuilderInternalOptions['define'], extensionMiddleware?: Connect.NextHandleFunction[], indexHtmlTransformer?: (content: string) => Promise, thirdPartySourcemaps?: boolean): Promise; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/vite-server.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/vite-server.js deleted file mode 100755 index e441a51..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/dev-server/vite-server.js +++ /dev/null @@ -1,735 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.serveWithVite = serveWithVite; -exports.setupServer = setupServer; -const node_assert_1 = __importDefault(require("node:assert")); -const promises_1 = require("node:fs/promises"); -const node_module_1 = require("node:module"); -const node_path_1 = require("node:path"); -const plugins_1 = require("../../tools/vite/plugins"); -const utils_1 = require("../../tools/vite/utils"); -const utils_2 = require("../../utils"); -const environment_options_1 = require("../../utils/environment-options"); -const load_esm_1 = require("../../utils/load-esm"); -const results_1 = require("../application/results"); -const schema_1 = require("../application/schema"); -const internal_1 = require("./internal"); -/** - * Build options that are also present on the dev server but are only passed - * to the build. - */ -const CONVENIENCE_BUILD_OPTIONS = ['watch', 'poll', 'verbose']; -// eslint-disable-next-line max-lines-per-function -async function* serveWithVite(serverOptions, builderName, builderAction, context, transformers, extensions) { - // Get the browser configuration from the target name. - const rawBrowserOptions = await context.getTargetOptions(serverOptions.buildTarget); - // Deploy url is not used in the dev-server. - delete rawBrowserOptions.deployUrl; - // Copy convenience options to build - for (const optionName of CONVENIENCE_BUILD_OPTIONS) { - const optionValue = serverOptions[optionName]; - if (optionValue !== undefined) { - rawBrowserOptions[optionName] = optionValue; - } - } - // TODO: Adjust architect to not force a JsonObject derived return type - const browserOptions = (await context.validateOptions(rawBrowserOptions, builderName)); - if (browserOptions.prerender || (browserOptions.outputMode && browserOptions.server)) { - // Disable prerendering if enabled and force SSR. - // This is so instead of prerendering all the routes for every change, the page is "prerendered" when it is requested. - browserOptions.prerender = undefined; - browserOptions.ssr ||= true; - } - // Disable auto CSP. - browserOptions.security = { - autoCsp: false, - }; - // Disable JSON build stats. - // These are not accessible with the dev server and can cause HMR fallbacks. - if (browserOptions.statsJson === true) { - context.logger.warn('Build JSON statistics output (`statsJson` option) has been disabled.' + - ' The development server does not support this option.'); - } - browserOptions.statsJson = false; - // Set all packages as external to support Vite's prebundle caching - browserOptions.externalPackages = serverOptions.prebundle; - // Disable generating a full manifest with routes. - // This is done during runtime when using the dev-server. - browserOptions.partialSSRBuild = true; - // The development server currently only supports a single locale when localizing. - // This matches the behavior of the Webpack-based development server but could be expanded in the future. - if (browserOptions.localize === true || - (Array.isArray(browserOptions.localize) && browserOptions.localize.length > 1)) { - context.logger.warn('Localization (`localize` option) has been disabled. The development server only supports localizing a single locale per build.'); - browserOptions.localize = false; - } - else if (browserOptions.localize) { - // When localization is enabled with a single locale, force a flat path to maintain behavior with the existing Webpack-based dev server. - browserOptions.forceI18nFlatOutput = true; - } - const { vendor: thirdPartySourcemaps, scripts: scriptsSourcemaps } = (0, utils_2.normalizeSourceMaps)(browserOptions.sourceMap ?? false); - if (scriptsSourcemaps && browserOptions.server) { - // https://nodejs.org/api/process.html#processsetsourcemapsenabledval - process.setSourceMapsEnabled(true); - } - if (serverOptions.hmr && - (browserOptions.outputHashing === schema_1.OutputHashing.All || - browserOptions.outputHashing === schema_1.OutputHashing.Bundles)) { - serverOptions.hmr = false; - context.logger.warn(`Hot Module Replacement (HMR) is disabled because the 'outputHashing' option is set to '${browserOptions.outputHashing}'. ` + - 'HMR is incompatible with this setting.'); - } - const componentsHmrCanBeUsed = browserOptions.aot && serverOptions.liveReload && serverOptions.hmr; - // Enable to support link-based component style hot reloading (`NG_HMR_CSTYLES=1` can be used to enable) - browserOptions.externalRuntimeStyles = componentsHmrCanBeUsed && environment_options_1.useComponentStyleHmr; - // Enable to support component template hot replacement (`NG_HMR_TEMPLATE=0` can be used to disable selectively) - // This will also replace file-based/inline styles as code if external runtime styles are not enabled. - browserOptions.templateUpdates = componentsHmrCanBeUsed && environment_options_1.useComponentTemplateHmr; - browserOptions.incrementalResults = true; - // Setup the prebundling transformer that will be shared across Vite prebundling requests - const prebundleTransformer = new internal_1.JavaScriptTransformer( - // Always enable JIT linking to support applications built with and without AOT. - // In a development environment the additional scope information does not - // have a negative effect unlike production where final output size is relevant. - { sourcemap: true, jit: true, thirdPartySourcemaps }, 1); - // The index HTML path will be updated from the build results if provided by the builder - let htmlIndexPath = 'index.html'; - // dynamically import Vite for ESM compatibility - const { createServer, normalizePath } = await (0, load_esm_1.loadEsmModule)('vite'); - let server; - let serverUrl; - let hadError = false; - const generatedFiles = new Map(); - const assetFiles = new Map(); - const externalMetadata = { - implicitBrowser: [], - implicitServer: [], - explicitBrowser: [], - explicitServer: [], - }; - const componentStyles = new Map(); - const templateUpdates = new Map(); - // Add cleanup logic via a builder teardown. - let deferred; - context.addTeardown(async () => { - await server?.close(); - await prebundleTransformer.close(); - deferred?.(); - }); - // TODO: Switch this to an architect schedule call when infrastructure settings are supported - for await (const result of builderAction(browserOptions, context, extensions?.buildPlugins)) { - if (result.kind === results_1.ResultKind.Failure) { - if (result.errors.length && server) { - hadError = true; - server.ws.send({ - type: 'error', - err: { - message: result.errors[0].text, - stack: '', - loc: result.errors[0].location ?? undefined, - }, - }); - } - yield { baseUrl: '', success: false }; - continue; - } - // Clear existing error overlay on successful result - if (hadError && server) { - hadError = false; - // Send an empty update to clear the error overlay - server.ws.send({ - 'type': 'update', - updates: [], - }); - } - let needClientUpdate = true; - switch (result.kind) { - case results_1.ResultKind.Full: - if (result.detail?.['htmlIndexPath']) { - htmlIndexPath = result.detail['htmlIndexPath']; - } - if (serverOptions.servePath === undefined && result.detail?.['htmlBaseHref']) { - const baseHref = result.detail['htmlBaseHref']; - // Remove trailing slash - serverOptions.servePath = - baseHref !== './' && baseHref[baseHref.length - 1] === '/' - ? baseHref.slice(0, -1) - : baseHref; - } - assetFiles.clear(); - componentStyles.clear(); - generatedFiles.clear(); - for (const [outputPath, file] of Object.entries(result.files)) { - updateResultRecord(outputPath, file, normalizePath, htmlIndexPath, generatedFiles, assetFiles, componentStyles, - // The initial build will not yet have a server setup - !server); - } - // Clear stale template updates on code rebuilds - templateUpdates.clear(); - break; - case results_1.ResultKind.Incremental: - (0, node_assert_1.default)(server, 'Builder must provide an initial full build before incremental results.'); - // Background updates should only update server files/options - needClientUpdate = !result.background; - for (const removed of result.removed) { - const filePath = '/' + normalizePath(removed.path); - generatedFiles.delete(filePath); - assetFiles.delete(filePath); - } - for (const modified of result.modified) { - updateResultRecord(modified, result.files[modified], normalizePath, htmlIndexPath, generatedFiles, assetFiles, componentStyles); - } - for (const added of result.added) { - updateResultRecord(added, result.files[added], normalizePath, htmlIndexPath, generatedFiles, assetFiles, componentStyles); - } - break; - case results_1.ResultKind.ComponentUpdate: - (0, node_assert_1.default)(serverOptions.hmr, 'Component updates are only supported with HMR enabled.'); - (0, node_assert_1.default)(server, 'Builder must provide an initial full build before component update results.'); - for (const componentUpdate of result.updates) { - if (componentUpdate.type === 'template') { - templateUpdates.set(componentUpdate.id, componentUpdate.content); - server.ws.send('angular:component-update', { - id: componentUpdate.id, - timestamp: Date.now(), - }); - } - } - context.logger.info('Component update sent to client(s).'); - continue; - default: - context.logger.warn(`Unknown result kind [${result.kind}] provided by build.`); - continue; - } - // To avoid disconnecting the array objects from the option, these arrays need to be mutated instead of replaced. - if (result.detail?.['externalMetadata']) { - const { implicitBrowser, implicitServer, explicit } = result.detail['externalMetadata']; - const implicitServerFiltered = implicitServer.filter((m) => !(0, node_module_1.isBuiltin)(m) && !isAbsoluteUrl(m)); - const implicitBrowserFiltered = implicitBrowser.filter((m) => !isAbsoluteUrl(m)); - // Empty Arrays to avoid growing unlimited with every re-build. - externalMetadata.explicitBrowser.length = 0; - externalMetadata.explicitServer.length = 0; - externalMetadata.implicitServer.length = 0; - externalMetadata.implicitBrowser.length = 0; - const externalDeps = browserOptions.externalDependencies ?? []; - externalMetadata.explicitBrowser.push(...explicit, ...externalDeps); - externalMetadata.explicitServer.push(...explicit, ...externalDeps, ...node_module_1.builtinModules); - externalMetadata.implicitServer.push(...implicitServerFiltered); - externalMetadata.implicitBrowser.push(...implicitBrowserFiltered); - // The below needs to be sorted as Vite uses these options are part of the hashing invalidation algorithm. - // See: https://github.com/vitejs/vite/blob/0873bae0cfe0f0718ad2f5743dd34a17e4ab563d/packages/vite/src/node/optimizer/index.ts#L1203-L1239 - externalMetadata.explicitBrowser.sort(); - externalMetadata.explicitServer.sort(); - externalMetadata.implicitServer.sort(); - externalMetadata.implicitBrowser.sort(); - } - if (server) { - // Update fs allow list to include any new assets from the build option. - server.config.server.fs.allow = [ - ...new Set([ - ...server.config.server.fs.allow, - ...[...assetFiles.values()].map(({ source }) => source), - ]), - ]; - const updatedFiles = await invalidateUpdatedFiles(normalizePath, generatedFiles, assetFiles, server); - if (needClientUpdate) { - handleUpdate(server, serverOptions, context.logger, componentStyles, updatedFiles); - } - } - else { - const projectName = context.target?.project; - if (!projectName) { - throw new Error('The builder requires a target.'); - } - context.logger.info('NOTE: Raw file sizes do not reflect development server per-request transformations.'); - if (browserOptions.ssr && serverOptions.inspect) { - const { host, port } = serverOptions.inspect; - const { default: inspector } = await Promise.resolve().then(() => __importStar(require('node:inspector'))); - inspector.open(port, host, true); - context.addTeardown(() => inspector.close()); - } - const { root = '' } = await context.getProjectMetadata(projectName); - const projectRoot = (0, node_path_1.join)(context.workspaceRoot, root); - const browsers = (0, internal_1.getSupportedBrowsers)(projectRoot, context.logger); - const target = (0, internal_1.transformSupportedBrowsersToTargets)(browsers); - // Needed for browser-esbuild as polyfills can be a string. - const polyfills = Array.isArray((browserOptions.polyfills ??= [])) - ? browserOptions.polyfills - : [browserOptions.polyfills]; - let ssrMode = plugins_1.ServerSsrMode.NoSsr; - if (browserOptions.outputMode && - typeof browserOptions.ssr === 'object' && - browserOptions.ssr.entry) { - ssrMode = plugins_1.ServerSsrMode.ExternalSsrMiddleware; - } - else if (browserOptions.ssr) { - ssrMode = plugins_1.ServerSsrMode.InternalSsrMiddleware; - } - if (browserOptions.progress !== false && ssrMode !== plugins_1.ServerSsrMode.NoSsr) { - // This is a workaround for https://github.com/angular/angular-cli/issues/28336, which is caused by the interaction between `zone.js` and `listr2`. - process.once('SIGINT', () => { - process.kill(process.pid); - }); - } - // Setup server and start listening - const serverConfiguration = await setupServer(serverOptions, generatedFiles, assetFiles, browserOptions.preserveSymlinks, externalMetadata, ssrMode, prebundleTransformer, target, (0, internal_1.isZonelessApp)(polyfills), componentStyles, templateUpdates, browserOptions.loader, { - ...browserOptions.define, - 'ngJitMode': browserOptions.aot ? 'false' : 'true', - 'ngHmrMode': browserOptions.templateUpdates ? 'true' : 'false', - }, extensions?.middleware, transformers?.indexHtml, thirdPartySourcemaps); - server = await createServer(serverConfiguration); - await server.listen(); - // Setup builder context logging for browser clients - server.hot.on('angular:log', (data) => { - if (typeof data?.text !== 'string') { - context.logger.warn('Development server client sent invalid internal log event.'); - } - switch (data.kind) { - case 'error': - context.logger.error(`[CLIENT ERROR]: ${data.text}`); - break; - case 'warning': - context.logger.warn(`[CLIENT WARNING]: ${data.text}`); - break; - default: - context.logger.info(`[CLIENT INFO]: ${data.text}`); - break; - } - }); - // Setup component HMR invalidation - // Invalidation occurs when the runtime cannot update a component - server.hot.on('angular:invalidate', (data) => { - if (typeof data?.id !== 'string') { - context.logger.warn('Development server client sent invalid internal invalidate event.'); - } - // Clear invalid template update - templateUpdates.delete(data.id); - // Some cases are expected unsupported update scenarios but some may be errors. - // If an error occurred, log the error in addition to the invalidation. - if (data.error) { - context.logger.error(`Component update failed${data.message ? `: ${data.message}` : '.'}` + - '\nPlease consider reporting the error at https://github.com/angular/angular-cli/issues'); - } - else { - context.logger.warn(`Component update unsupported${data.message ? `: ${data.message}` : '.'}`); - } - server?.ws.send({ - type: 'full-reload', - path: '*', - }); - context.logger.info('Page reload sent to client(s).'); - }); - const urls = server.resolvedUrls; - if (urls && (urls.local.length || urls.network.length)) { - serverUrl = new URL(urls.local[0] ?? urls.network[0]); - } - // log connection information - server.printUrls(); - server.bindCLIShortcuts({ - print: true, - customShortcuts: [ - { - key: 'r', - description: 'force reload browser', - action(server) { - componentStyles.forEach((record) => record.used?.clear()); - server.ws.send({ - type: 'full-reload', - path: '*', - }); - }, - }, - ], - }); - } - // TODO: adjust output typings to reflect both development servers - yield { - success: true, - port: serverUrl?.port, - baseUrl: serverUrl?.href, - }; - } - await new Promise((resolve) => (deferred = resolve)); -} -/** - * Invalidates any updated asset or generated files and resets their `updated` state. - * This function also clears the server application cache when necessary. - * - * @returns A list of files that were updated and invalidated. - */ -async function invalidateUpdatedFiles(normalizePath, generatedFiles, assetFiles, server) { - const updatedFiles = []; - // Invalidate any updated asset - for (const [file, record] of assetFiles) { - if (!record.updated) { - continue; - } - record.updated = false; - updatedFiles.push(file); - } - // Invalidate any updated files - let serverApplicationChanged = false; - for (const [file, record] of generatedFiles) { - if (!record.updated) { - continue; - } - record.updated = false; - updatedFiles.push(file); - serverApplicationChanged ||= record.type === internal_1.BuildOutputFileType.ServerApplication; - const updatedModules = server.moduleGraph.getModulesByFile(normalizePath((0, node_path_1.join)(server.config.root, file))); - updatedModules?.forEach((m) => server.moduleGraph.invalidateModule(m)); - } - if (serverApplicationChanged) { - // Clear the server app cache and - // trigger module evaluation before reload to initiate dependency optimization. - const { ɵdestroyAngularServerApp } = (await server.ssrLoadModule('/main.server.mjs')); - ɵdestroyAngularServerApp(); - } - return updatedFiles; -} -/** - * Handles updates for the client by sending HMR or full page reload commands - * based on the updated files. It also ensures proper tracking of component styles and determines if - * a full reload is needed. - */ -function handleUpdate(server, serverOptions, logger, componentStyles, updatedFiles) { - if (!updatedFiles.length) { - return; - } - if (serverOptions.hmr) { - if (updatedFiles.every((f) => f.endsWith('.css'))) { - let requiresReload = false; - const timestamp = Date.now(); - const updates = updatedFiles.flatMap((filePath) => { - // For component styles, an HMR update must be sent for each one with the corresponding - // component identifier search parameter (`ngcomp`). The Vite client code will not keep - // the existing search parameters when it performs an update and each one must be - // specified explicitly. Typically, there is only one each though as specific style files - // are not typically reused across components. - const record = componentStyles.get(filePath); - if (record) { - if (record.reload) { - // Shadow DOM components currently require a full reload. - // Vite's CSS hot replacement does not support shadow root searching. - requiresReload = true; - return []; - } - return Array.from(record.used ?? []).map((id) => { - return { - type: 'css-update', - timestamp, - path: `${filePath}?ngcomp` + (typeof id === 'string' ? `=${id}` : ''), - acceptedPath: filePath, - }; - }); - } - return { - type: 'css-update', - timestamp, - path: filePath, - acceptedPath: filePath, - }; - }); - if (!requiresReload) { - server.ws.send({ - type: 'update', - updates, - }); - logger.info('Stylesheet update sent to client(s).'); - return; - } - } - } - // Send reload command to clients - if (serverOptions.liveReload) { - // Clear used component tracking on full reload - componentStyles.forEach((record) => record.used?.clear()); - server.ws.send({ - type: 'full-reload', - path: '*', - }); - logger.info('Page reload sent to client(s).'); - } -} -function updateResultRecord(outputPath, file, normalizePath, htmlIndexPath, generatedFiles, assetFiles, componentStyles, initial = false) { - if (file.origin === 'disk') { - assetFiles.set('/' + normalizePath(outputPath), { - source: normalizePath(file.inputPath), - updated: !initial, - }); - return; - } - let filePath; - if (outputPath === htmlIndexPath) { - // Convert custom index output path to standard index path for dev-server usage. - // This mimics the Webpack dev-server behavior. - filePath = '/index.html'; - } - else { - filePath = '/' + normalizePath(outputPath); - } - const servable = file.type === internal_1.BuildOutputFileType.Browser || file.type === internal_1.BuildOutputFileType.Media; - // Skip analysis of sourcemaps - if (filePath.endsWith('.map')) { - generatedFiles.set(filePath, { - contents: file.contents, - servable, - size: file.contents.byteLength, - hash: file.hash, - type: file.type, - updated: false, - }); - return; - } - // New or updated file - generatedFiles.set(filePath, { - contents: file.contents, - size: file.contents.byteLength, - hash: file.hash, - // Consider the files updated except on the initial build result - updated: !initial, - type: file.type, - servable, - }); - // Record any external component styles - if (filePath.endsWith('.css') && /^\/[a-f0-9]{64}\.css$/.test(filePath)) { - const componentStyle = componentStyles.get(filePath); - if (componentStyle) { - componentStyle.rawContent = file.contents; - } - else { - componentStyles.set(filePath, { - rawContent: file.contents, - }); - } - } -} -// eslint-disable-next-line max-lines-per-function -async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, externalMetadata, ssrMode, prebundleTransformer, target, zoneless, componentStyles, templateUpdates, prebundleLoaderExtensions, define, extensionMiddleware, indexHtmlTransformer, thirdPartySourcemaps = false) { - const proxy = await (0, utils_2.loadProxyConfiguration)(serverOptions.workspaceRoot, serverOptions.proxyConfig); - // dynamically import Vite for ESM compatibility - const { normalizePath } = await (0, load_esm_1.loadEsmModule)('vite'); - // Path will not exist on disk and only used to provide separate path for Vite requests - const virtualProjectRoot = normalizePath((0, node_path_1.join)(serverOptions.workspaceRoot, `.angular/vite-root`, serverOptions.buildTarget.project)); - // Files used for SSR warmup. - let ssrFiles; - switch (ssrMode) { - case plugins_1.ServerSsrMode.InternalSsrMiddleware: - ssrFiles = ['./main.server.mjs']; - break; - case plugins_1.ServerSsrMode.ExternalSsrMiddleware: - ssrFiles = ['./main.server.mjs', './server.mjs']; - break; - } - /** - * Required when using `externalDependencies` to prevent Vite load errors. - * - * @note Can be removed if Vite introduces native support for externals. - * @note Vite misresolves browser modules in SSR when accessing URLs with multiple segments - * (e.g., 'foo/bar'), as they are not correctly re-based from the base href. - */ - const preTransformRequests = externalMetadata.explicitBrowser.length === 0 && ssrMode === plugins_1.ServerSsrMode.NoSsr; - const cacheDir = (0, node_path_1.join)(serverOptions.cacheOptions.path, serverOptions.buildTarget.project, 'vite'); - const configuration = { - configFile: false, - envFile: false, - cacheDir, - root: virtualProjectRoot, - publicDir: false, - esbuild: false, - mode: 'development', - // We use custom as we do not rely on Vite's htmlFallbackMiddleware and indexHtmlMiddleware. - appType: 'custom', - css: { - devSourcemap: true, - }, - // Ensure custom 'file' loader build option entries are handled by Vite in application code that - // reference third-party libraries. Relative usage is handled directly by the build and not Vite. - // Only 'file' loader entries are currently supported directly by Vite. - assetsInclude: prebundleLoaderExtensions && - Object.entries(prebundleLoaderExtensions) - .filter(([, value]) => value === 'file') - // Create a file extension glob for each key - .map(([key]) => '*' + key), - // Vite will normalize the `base` option by adding a leading slash. - base: serverOptions.servePath, - resolve: { - mainFields: ['es2020', 'browser', 'module', 'main'], - preserveSymlinks, - }, - dev: { - preTransformRequests, - }, - server: { - preTransformRequests, - warmup: { - ssrFiles, - }, - port: serverOptions.port, - strictPort: true, - host: serverOptions.host, - open: serverOptions.open, - allowedHosts: serverOptions.allowedHosts, - headers: serverOptions.headers, - // Disable the websocket if live reload is disabled (false/undefined are the only valid values) - ws: serverOptions.liveReload === false && serverOptions.hmr === false ? false : undefined, - // When server-side rendering (SSR) is enabled togather with SSL and Express is being used, - // we must configure Vite to use HTTP/1.1. - // This is necessary because Express does not support HTTP/2. - // We achieve this by defining an empty proxy. - // See: https://github.com/vitejs/vite/blob/c4b532cc900bf988073583511f57bd581755d5e3/packages/vite/src/node/http.ts#L106 - proxy: serverOptions.ssl && ssrMode === plugins_1.ServerSsrMode.ExternalSsrMiddleware - ? (proxy ?? {}) - : proxy, - cors: { - // This will add the header `Access-Control-Allow-Origin: http://example.com`, - // where `http://example.com` is the requesting origin. - origin: true, - // Allow preflight requests to be proxied. - preflightContinue: true, - }, - // File watching is handled by the build directly. `null` disables file watching for Vite. - watch: null, - fs: { - // Ensure cache directory, node modules, and all assets are accessible by the client. - // The first two are required for Vite to function in prebundling mode (the default) and to load - // the Vite client-side code for browser reloading. These would be available by default but when - // the `allow` option is explicitly configured, they must be included manually. - allow: [ - cacheDir, - (0, node_path_1.join)(serverOptions.workspaceRoot, 'node_modules'), - ...[...assets.values()].map(({ source }) => source), - ], - }, - }, - ssr: { - // Note: `true` and `/.*/` have different sematics. When true, the `external` option is ignored. - noExternal: /.*/, - // Exclude any Node.js built in module and provided dependencies (currently build defined externals) - external: externalMetadata.explicitServer, - optimizeDeps: (0, utils_1.getDepOptimizationConfig)({ - // Only enable with caching since it causes prebundle dependencies to be cached - disabled: serverOptions.prebundle === false, - // Exclude any explicitly defined dependencies (currently build defined externals and node.js built-ins) - exclude: externalMetadata.explicitServer, - // Include all implict dependencies from the external packages internal option - include: externalMetadata.implicitServer, - ssr: true, - prebundleTransformer, - zoneless, - target, - loader: prebundleLoaderExtensions, - thirdPartySourcemaps, - define, - }), - }, - plugins: [ - (0, plugins_1.createAngularSetupMiddlewaresPlugin)({ - outputFiles, - assets, - indexHtmlTransformer, - extensionMiddleware, - componentStyles, - templateUpdates, - ssrMode, - resetComponentUpdates: () => templateUpdates.clear(), - projectRoot: serverOptions.projectRoot, - }), - (0, plugins_1.createRemoveIdPrefixPlugin)(externalMetadata.explicitBrowser), - await (0, plugins_1.createAngularSsrTransformPlugin)(serverOptions.workspaceRoot), - await (0, plugins_1.createAngularMemoryPlugin)({ - virtualProjectRoot, - outputFiles, - templateUpdates, - external: externalMetadata.explicitBrowser, - disableViteTransport: !serverOptions.liveReload, - }), - ], - // Browser only optimizeDeps. (This does not run for SSR dependencies). - optimizeDeps: (0, utils_1.getDepOptimizationConfig)({ - // Only enable with caching since it causes prebundle dependencies to be cached - disabled: serverOptions.prebundle === false, - // Exclude any explicitly defined dependencies (currently build defined externals) - exclude: externalMetadata.explicitBrowser, - // Include all implict dependencies from the external packages internal option - include: externalMetadata.implicitBrowser, - ssr: false, - prebundleTransformer, - target, - zoneless, - loader: prebundleLoaderExtensions, - thirdPartySourcemaps, - define, - }), - }; - if (serverOptions.ssl) { - if (serverOptions.sslCert && serverOptions.sslKey) { - configuration.server ??= {}; - // server configuration is defined above - configuration.server.https = { - cert: await (0, promises_1.readFile)(serverOptions.sslCert), - key: await (0, promises_1.readFile)(serverOptions.sslKey), - }; - } - else { - const { default: basicSslPlugin } = await Promise.resolve().then(() => __importStar(require('@vitejs/plugin-basic-ssl'))); - configuration.plugins ??= []; - configuration.plugins.push(basicSslPlugin()); - } - } - return configuration; -} -/** - * Checks if the given value is an absolute URL. - * - * This function helps in avoiding Vite's prebundling from processing absolute URLs (http://, https://, //) as files. - * - * @param value - The URL or path to check. - * @returns `true` if the value is not an absolute URL; otherwise, `false`. - */ -function isAbsoluteUrl(value) { - return /^(?:https?:)?\/\//.test(value); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/application-extraction.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/application-extraction.d.ts deleted file mode 100755 index 1bc7025..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/application-extraction.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { ɵParsedMessage as LocalizeMessage } from '@angular/localize'; -import type { MessageExtractor } from '@angular/localize/tools'; -import type { BuilderContext } from '@angular-devkit/architect'; -import type { ApplicationBuilderExtensions } from '../application/options'; -import type { NormalizedExtractI18nOptions } from './options'; -export declare function extractMessages(options: NormalizedExtractI18nOptions, builderName: string, context: BuilderContext, extractorConstructor: typeof MessageExtractor, extensions?: ApplicationBuilderExtensions): Promise<{ - success: boolean; - basePath: string; - messages: LocalizeMessage[]; - useLegacyIds: boolean; -}>; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/application-extraction.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/application-extraction.js deleted file mode 100755 index cf89ed6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/application-extraction.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.extractMessages = extractMessages; -const node_fs_1 = require("node:fs"); -const node_path_1 = __importDefault(require("node:path")); -const application_1 = require("../application"); -const results_1 = require("../application/results"); -const schema_1 = require("../application/schema"); -async function extractMessages(options, builderName, context, extractorConstructor, extensions) { - const messages = []; - // Setup the build options for the application based on the buildTarget option - const buildOptions = (await context.validateOptions(await context.getTargetOptions(options.buildTarget), builderName)); - buildOptions.optimization = false; - buildOptions.sourceMap = { scripts: true, vendor: true, styles: false }; - buildOptions.localize = false; - buildOptions.budgets = undefined; - buildOptions.index = false; - buildOptions.serviceWorker = false; - buildOptions.outputMode = schema_1.OutputMode.Static; - buildOptions.appShell = undefined; - buildOptions.ssr = undefined; - buildOptions.prerender = undefined; - buildOptions.server = undefined; - // Build the application with the build options - const builderResult = await first((0, application_1.buildApplicationInternal)(buildOptions, context, extensions)); - let success = false; - if (!builderResult || builderResult.kind === results_1.ResultKind.Failure) { - context.logger.error('Application build failed.'); - } - else if (builderResult.kind !== results_1.ResultKind.Full) { - context.logger.error('Application build did not provide a full output.'); - } - else { - // Setup the localize message extractor based on the in-memory files - const extractor = setupLocalizeExtractor(extractorConstructor, builderResult.files, context); - // Extract messages from each output JavaScript file. - // Output files are only present on a successful build. - for (const filePath of Object.keys(builderResult.files)) { - if (!filePath.endsWith('.js')) { - continue; - } - const fileMessages = extractor.extractMessages(filePath); - messages.push(...fileMessages); - } - success = true; - } - return { - success, - basePath: context.workspaceRoot, - messages, - // Legacy i18n identifiers are not supported with the new application builder - useLegacyIds: false, - }; -} -function setupLocalizeExtractor(extractorConstructor, files, context) { - const textDecoder = new TextDecoder(); - // Setup a virtual file system instance for the extractor - // * MessageExtractor itself uses readFile, relative and resolve - // * Internal SourceFileLoader (sourcemap support) uses dirname, exists, readFile, and resolve - const filesystem = { - readFile(path) { - // Output files are stored as relative to the workspace root - const requestedPath = node_path_1.default.relative(context.workspaceRoot, path); - const file = files[requestedPath]; - let content; - if (file?.origin === 'memory') { - content = textDecoder.decode(file.contents); - } - else if (file?.origin === 'disk') { - content = (0, node_fs_1.readFileSync)(file.inputPath, 'utf-8'); - } - if (content === undefined) { - throw new Error('Unknown file requested: ' + requestedPath); - } - return content; - }, - relative(from, to) { - return node_path_1.default.relative(from, to); - }, - resolve(...paths) { - return node_path_1.default.resolve(...paths); - }, - exists(path) { - // Output files are stored as relative to the workspace root - const requestedPath = node_path_1.default.relative(context.workspaceRoot, path); - return files[requestedPath] !== undefined; - }, - dirname(path) { - return node_path_1.default.dirname(path); - }, - }; - const logger = { - // level 2 is warnings - level: 2, - debug(...args) { - // eslint-disable-next-line no-console - console.debug(...args); - }, - info(...args) { - context.logger.info(args.join('')); - }, - warn(...args) { - context.logger.warn(args.join('')); - }, - error(...args) { - context.logger.error(args.join('')); - }, - }; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const extractor = new extractorConstructor(filesystem, logger, { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - basePath: context.workspaceRoot, - useSourceMaps: true, - }); - return extractor; -} -async function first(iterable) { - for await (const value of iterable) { - return value; - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/builder.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/builder.d.ts deleted file mode 100755 index c2d66fc..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/builder.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; -import type { ApplicationBuilderExtensions } from '../application/options'; -import { Schema as ExtractI18nBuilderOptions } from './schema'; -/** - * @experimental Direct usage of this function is considered experimental. - */ -export declare function execute(options: ExtractI18nBuilderOptions, context: BuilderContext, extensions?: ApplicationBuilderExtensions): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/builder.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/builder.js deleted file mode 100755 index bcf5ec0..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/builder.js +++ /dev/null @@ -1,162 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.execute = execute; -const node_fs_1 = __importDefault(require("node:fs")); -const node_path_1 = __importDefault(require("node:path")); -const load_esm_1 = require("../../utils/load-esm"); -const version_1 = require("../../utils/version"); -const options_1 = require("./options"); -const schema_1 = require("./schema"); -/** - * @experimental Direct usage of this function is considered experimental. - */ -async function execute(options, context, extensions) { - // Determine project name from builder context target - const projectName = context.target?.project; - if (!projectName) { - context.logger.error(`The 'extract-i18n' builder requires a target to be specified.`); - return { success: false }; - } - const { projectType } = (await context.getProjectMetadata(projectName)); - if (projectType !== 'application') { - context.logger.error(`Tried to extract from ${projectName} with 'projectType' ${projectType}, which is not supported.` + - ` The 'extract-i18n' builder can only extract from applications.`); - return { success: false }; - } - // Check Angular version. - (0, version_1.assertCompatibleAngularVersion)(context.workspaceRoot); - // Load the Angular localize package. - // The package is a peer dependency and might not be present - let localizeToolsModule; - try { - localizeToolsModule = - await (0, load_esm_1.loadEsmModule)('@angular/localize/tools'); - } - catch { - return { - success: false, - error: `i18n extraction requires the '@angular/localize' package.` + - ` You can add it by using 'ng add @angular/localize'.`, - }; - } - // Normalize options - const normalizedOptions = await (0, options_1.normalizeOptions)(context, projectName, options); - const builderName = await context.getBuilderNameForTarget(normalizedOptions.buildTarget); - // Extract messages based on configured builder - const { extractMessages } = await Promise.resolve().then(() => __importStar(require('./application-extraction'))); - const extractionResult = await extractMessages(normalizedOptions, builderName, context, localizeToolsModule.MessageExtractor, extensions); - if (!extractionResult.success) { - return { success: false }; - } - // Perform duplicate message checks - const { checkDuplicateMessages } = localizeToolsModule; - // The filesystem is used to create a relative path for each file - // from the basePath. This relative path is then used in the error message. - const checkFileSystem = { - relative(from, to) { - return node_path_1.default.relative(from, to); - }, - }; - const duplicateTranslationBehavior = normalizedOptions.i18nOptions.duplicateTranslationBehavior; - const diagnostics = checkDuplicateMessages( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - checkFileSystem, extractionResult.messages, duplicateTranslationBehavior, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - extractionResult.basePath); - if (diagnostics.messages.length > 0 && duplicateTranslationBehavior !== 'ignore') { - if (duplicateTranslationBehavior === 'error') { - context.logger.error(`Extraction Failed: ${diagnostics.formatDiagnostics('')}`); - return { success: false }; - } - else { - context.logger.warn(diagnostics.formatDiagnostics('')); - } - } - // Serialize all extracted messages - const serializer = await createSerializer(localizeToolsModule, normalizedOptions.format, normalizedOptions.i18nOptions.sourceLocale, extractionResult.basePath, extractionResult.useLegacyIds, diagnostics); - const content = serializer.serialize(extractionResult.messages); - // Ensure directory exists - const outputPath = node_path_1.default.dirname(normalizedOptions.outFile); - if (!node_fs_1.default.existsSync(outputPath)) { - node_fs_1.default.mkdirSync(outputPath, { recursive: true }); - } - // Write translation file - node_fs_1.default.writeFileSync(normalizedOptions.outFile, content); - if (normalizedOptions.progress) { - context.logger.info(`Extraction Complete. (Messages: ${extractionResult.messages.length})`); - } - return { success: true, outputPath: normalizedOptions.outFile }; -} -async function createSerializer(localizeToolsModule, format, sourceLocale, basePath, useLegacyIds, diagnostics) { - const { XmbTranslationSerializer, LegacyMessageIdMigrationSerializer, ArbTranslationSerializer, Xliff1TranslationSerializer, Xliff2TranslationSerializer, SimpleJsonTranslationSerializer, } = localizeToolsModule; - switch (format) { - case schema_1.Format.Xmb: - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new XmbTranslationSerializer(basePath, useLegacyIds); - case schema_1.Format.Xlf: - case schema_1.Format.Xlif: - case schema_1.Format.Xliff: - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new Xliff1TranslationSerializer(sourceLocale, basePath, useLegacyIds, {}); - case schema_1.Format.Xlf2: - case schema_1.Format.Xliff2: - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return new Xliff2TranslationSerializer(sourceLocale, basePath, useLegacyIds, {}); - case schema_1.Format.Json: - return new SimpleJsonTranslationSerializer(sourceLocale); - case schema_1.Format.LegacyMigrate: - return new LegacyMessageIdMigrationSerializer(diagnostics); - case schema_1.Format.Arb: - return new ArbTranslationSerializer(sourceLocale, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - basePath, { - relative(from, to) { - return node_path_1.default.relative(from, to); - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }); - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/index.d.ts deleted file mode 100755 index b8eb54b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { Builder } from '@angular-devkit/architect'; -import { execute } from './builder'; -import type { Schema as ExtractI18nBuilderOptions } from './schema'; -export { ExtractI18nBuilderOptions, execute }; -declare const builder: Builder; -export default builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/index.js deleted file mode 100755 index f204f9f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.execute = void 0; -const architect_1 = require("@angular-devkit/architect"); -const builder_1 = require("./builder"); -Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return builder_1.execute; } }); -const builder = (0, architect_1.createBuilder)(builder_1.execute); -exports.default = builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/options.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/options.d.ts deleted file mode 100755 index c2c4ace..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/options.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { type DiagnosticHandlingStrategy } from '@angular/localize/tools'; -import { BuilderContext } from '@angular-devkit/architect'; -import { type I18nOptions } from '../../utils/i18n-options'; -import { Schema as ExtractI18nOptions, Format } from './schema'; -export type NormalizedExtractI18nOptions = Awaited>; -/** - * Normalize the user provided options by creating full paths for all path based options - * and converting multi-form options into a single form that can be directly used - * by the build process. - * - * @param context The context for current builder execution. - * @param projectName The name of the project for the current execution. - * @param options An object containing the options to use for the build. - * @returns An object containing normalized options required to perform the build. - */ -export declare function normalizeOptions(context: BuilderContext, projectName: string, options: ExtractI18nOptions): Promise<{ - workspaceRoot: string; - projectRoot: string; - buildTarget: import("@angular-devkit/architect").Target; - i18nOptions: I18nOptions & { - duplicateTranslationBehavior: DiagnosticHandlingStrategy; - }; - format: Format.Arb | Format.Json | Format.LegacyMigrate | Format.Xliff | Format.Xliff2 | Format.Xmb; - outFile: string; - progress: boolean; -}>; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/options.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/options.js deleted file mode 100755 index d7b5fe5..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/options.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.normalizeOptions = normalizeOptions; -const architect_1 = require("@angular-devkit/architect"); -const node_assert_1 = require("node:assert"); -const node_path_1 = __importDefault(require("node:path")); -const i18n_options_1 = require("../../utils/i18n-options"); -const schema_1 = require("./schema"); -/** - * Normalize the user provided options by creating full paths for all path based options - * and converting multi-form options into a single form that can be directly used - * by the build process. - * - * @param context The context for current builder execution. - * @param projectName The name of the project for the current execution. - * @param options An object containing the options to use for the build. - * @returns An object containing normalized options required to perform the build. - */ -async function normalizeOptions(context, projectName, options) { - const workspaceRoot = context.workspaceRoot; - const projectMetadata = await context.getProjectMetadata(projectName); - const projectRoot = node_path_1.default.join(workspaceRoot, projectMetadata.root ?? ''); - // Target specifier defaults to the current project's build target with no specified configuration - const buildTargetSpecifier = options.buildTarget ?? ':'; - const buildTarget = (0, architect_1.targetFromTargetString)(buildTargetSpecifier, projectName, 'build'); - const i18nOptions = { - ...(0, i18n_options_1.createI18nOptions)(projectMetadata, /** inline */ false, context.logger), - duplicateTranslationBehavior: options.i18nDuplicateTranslation || 'warning', - }; - // Normalize xliff format extensions - let format = options.format; - switch (format) { - // Default format is xliff1 - case undefined: - case schema_1.Format.Xlf: - case schema_1.Format.Xlif: - case schema_1.Format.Xliff: - format = schema_1.Format.Xliff; - break; - case schema_1.Format.Xlf2: - case schema_1.Format.Xliff2: - format = schema_1.Format.Xliff2; - break; - } - let outFile = options.outFile || getDefaultOutFile(format); - if (options.outputPath) { - outFile = node_path_1.default.join(options.outputPath, outFile); - } - outFile = node_path_1.default.resolve(context.workspaceRoot, outFile); - return { - workspaceRoot, - projectRoot, - buildTarget, - i18nOptions, - format, - outFile, - progress: options.progress ?? true, - }; -} -function getDefaultOutFile(format) { - switch (format) { - case schema_1.Format.Xmb: - return 'messages.xmb'; - case schema_1.Format.Xliff: - case schema_1.Format.Xliff2: - return 'messages.xlf'; - case schema_1.Format.Json: - case schema_1.Format.LegacyMigrate: - return 'messages.json'; - case schema_1.Format.Arb: - return 'messages.arb'; - default: - (0, node_assert_1.fail)(`Invalid Format enum value: ${format}`); - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.d.ts deleted file mode 100755 index b591120..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Extract i18n target options for Build Facade. - */ -export type Schema = { - /** - * A builder target to extract i18n messages in the format of - * `project:target[:configuration]`. You can also pass in more than one configuration name - * as a comma-separated list. Example: `project:target:production,staging`. - */ - buildTarget?: string; - /** - * Output format for the generated file. - */ - format?: Format; - /** - * How to handle duplicate translations. - */ - i18nDuplicateTranslation?: I18NDuplicateTranslation; - /** - * Name of the file to output. - */ - outFile?: string; - /** - * Path where output will be placed. - */ - outputPath?: string; - /** - * Log progress to the console. - */ - progress?: boolean; -}; -/** - * Output format for the generated file. - */ -export declare enum Format { - Arb = "arb", - Json = "json", - LegacyMigrate = "legacy-migrate", - Xlf = "xlf", - Xlf2 = "xlf2", - Xlif = "xlif", - Xliff = "xliff", - Xliff2 = "xliff2", - Xmb = "xmb" -} -/** - * How to handle duplicate translations. - */ -export declare enum I18NDuplicateTranslation { - Error = "error", - Ignore = "ignore", - Warning = "warning" -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.js deleted file mode 100755 index 3904eb6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE -// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). -Object.defineProperty(exports, "__esModule", { value: true }); -exports.I18NDuplicateTranslation = exports.Format = void 0; -/** - * Output format for the generated file. - */ -var Format; -(function (Format) { - Format["Arb"] = "arb"; - Format["Json"] = "json"; - Format["LegacyMigrate"] = "legacy-migrate"; - Format["Xlf"] = "xlf"; - Format["Xlf2"] = "xlf2"; - Format["Xlif"] = "xlif"; - Format["Xliff"] = "xliff"; - Format["Xliff2"] = "xliff2"; - Format["Xmb"] = "xmb"; -})(Format || (exports.Format = Format = {})); -/** - * How to handle duplicate translations. - */ -var I18NDuplicateTranslation; -(function (I18NDuplicateTranslation) { - I18NDuplicateTranslation["Error"] = "error"; - I18NDuplicateTranslation["Ignore"] = "ignore"; - I18NDuplicateTranslation["Warning"] = "warning"; -})(I18NDuplicateTranslation || (exports.I18NDuplicateTranslation = I18NDuplicateTranslation = {})); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.json b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.json deleted file mode 100755 index 08a118a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/extract-i18n/schema.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "title": "Extract i18n Target", - "description": "Extract i18n target options for Build Facade.", - "type": "object", - "properties": { - "buildTarget": { - "type": "string", - "description": "A builder target to extract i18n messages in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.", - "pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$" - }, - "format": { - "type": "string", - "description": "Output format for the generated file.", - "default": "xlf", - "enum": ["xmb", "xlf", "xlif", "xliff", "xlf2", "xliff2", "json", "arb", "legacy-migrate"] - }, - "progress": { - "type": "boolean", - "description": "Log progress to the console.", - "default": true - }, - "outputPath": { - "type": "string", - "description": "Path where output will be placed." - }, - "outFile": { - "type": "string", - "description": "Name of the file to output." - }, - "i18nDuplicateTranslation": { - "type": "string", - "description": "How to handle duplicate translations.", - "enum": ["error", "warning", "ignore"] - } - }, - "additionalProperties": false -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/application_builder.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/application_builder.d.ts deleted file mode 100755 index ad9695f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/application_builder.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; -import { ResultFile } from '../application/results'; -import { Schema as KarmaBuilderOptions } from './schema'; -import type { KarmaBuilderTransformsOptions } from './index'; -export declare function execute(options: KarmaBuilderOptions, context: BuilderContext, transforms?: KarmaBuilderTransformsOptions): AsyncIterable; -export declare function writeTestFiles(files: Record, testDir: string): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/application_builder.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/application_builder.js deleted file mode 100755 index e123447..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/application_builder.js +++ /dev/null @@ -1,632 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.execute = execute; -exports.writeTestFiles = writeTestFiles; -const node_crypto_1 = require("node:crypto"); -const node_fs_1 = require("node:fs"); -const fs = __importStar(require("node:fs/promises")); -const node_module_1 = require("node:module"); -const node_path_1 = __importDefault(require("node:path")); -const tinyglobby_1 = require("tinyglobby"); -const bundler_context_1 = require("../../tools/esbuild/bundler-context"); -const utils_1 = require("../../tools/esbuild/utils"); -const virtual_module_plugin_1 = require("../../tools/esbuild/virtual-module-plugin"); -const project_metadata_1 = require("../../utils/project-metadata"); -const index_1 = require("../application/index"); -const results_1 = require("../application/results"); -const schema_1 = require("../application/schema"); -const find_tests_1 = require("./find-tests"); -const options_1 = require("./options"); -const localResolve = (0, node_module_1.createRequire)(__filename).resolve; -const isWindows = process.platform === 'win32'; -class ApplicationBuildError extends Error { - constructor(message) { - super(message); - this.name = 'ApplicationBuildError'; - } -} -const LATEST_BUILD_FILES_TOKEN = 'angularLatestBuildFiles'; -class AngularAssetsMiddleware { - serveFile; - latestBuildFiles; - static $inject = ['serveFile', LATEST_BUILD_FILES_TOKEN]; - static NAME = 'angular-test-assets'; - constructor(serveFile, latestBuildFiles) { - this.serveFile = serveFile; - this.latestBuildFiles = latestBuildFiles; - } - handle(req, res, next) { - const url = new URL(`http://${req.headers['host']}${req.url}`); - // Remove the leading slash from the URL path and convert to platform specific. - // The latest build files will use the platform path separator. - let pathname = url.pathname.slice(1); - if (isWindows) { - pathname = pathname.replaceAll(node_path_1.default.posix.sep, node_path_1.default.win32.sep); - } - const file = this.latestBuildFiles.files[pathname]; - if (!file) { - next(); - return; - } - // Implementation of serverFile can be found here: - // https://github.com/karma-runner/karma/blob/84f85e7016efc2266fa6b3465f494a3fa151c85c/lib/middleware/common.js#L10 - switch (file.origin) { - case 'disk': - this.serveFile(file.inputPath, undefined, res, undefined, undefined, /* doNotCache */ true); - break; - case 'memory': - // Include pathname to help with Content-Type headers. - this.serveFile(`/unused/${url.pathname}`, undefined, res, undefined, file.contents, - /* doNotCache */ false); - break; - } - } - static createPlugin(initialFiles) { - return { - [LATEST_BUILD_FILES_TOKEN]: ['value', { files: { ...initialFiles.files } }], - [`middleware:${AngularAssetsMiddleware.NAME}`]: [ - 'factory', - Object.assign((...args) => { - const inst = new AngularAssetsMiddleware(...args); - return inst.handle.bind(inst); - }, AngularAssetsMiddleware), - ], - }; - } -} -class AngularPolyfillsPlugin { - static $inject = ['config.files']; - static NAME = 'angular-polyfills'; - static createPlugin(polyfillsFile, jasmineCleanupFiles, scriptsFiles) { - return { - // This has to be a "reporter" because reporters run _after_ frameworks - // and karma-jasmine-html-reporter injects additional scripts that may - // depend on Jasmine but aren't modules - which means that they would run - // _before_ all module code (including jasmine). - [`reporter:${AngularPolyfillsPlugin.NAME}`]: [ - 'factory', - Object.assign((files) => { - // The correct order is zone.js -> jasmine -> zone.js/testing. - // Jasmine has to see the patched version of the global `setTimeout` - // function so it doesn't cache the unpatched version. And /testing - // needs to see the global `jasmine` object so it can patch it. - const polyfillsIndex = 0; - files.splice(polyfillsIndex, 0, polyfillsFile); - // Insert just before test_main.js. - const zoneTestingIndex = files.findIndex((f) => { - if (typeof f === 'string') { - return false; - } - return f.pattern.endsWith('/test_main.js'); - }); - if (zoneTestingIndex === -1) { - throw new Error('Could not find test entrypoint file.'); - } - files.splice(zoneTestingIndex, 0, jasmineCleanupFiles); - // We need to ensure that all files are served as modules, otherwise - // the order in the files list gets really confusing: Karma doesn't - // set defer on scripts, so all scripts with type=js will run first, - // even if type=module files appeared earlier in `files`. - for (const f of files) { - if (typeof f === 'string') { - throw new Error(`Unexpected string-based file: "${f}"`); - } - if (f.included === false) { - // Don't worry about files that aren't included on the initial - // page load. `type` won't affect them. - continue; - } - if (f.pattern.endsWith('.js') && 'js' === (f.type ?? 'js')) { - f.type = 'module'; - } - } - // Add "scripts" option files as classic scripts - files.unshift(...scriptsFiles); - // Add browser sourcemap support as a classic script - files.unshift({ - pattern: localResolve('source-map-support/browser-source-map-support.js'), - included: true, - watched: false, - }); - // Karma needs a return value for a factory and Karma's multi-reporter expects an `adapters` array - return { adapters: [] }; - }, AngularPolyfillsPlugin), - ], - }; - } -} -function injectKarmaReporter(buildOptions, buildIterator, karmaConfig, controller) { - const reporterName = 'angular-progress-notifier'; - class ProgressNotifierReporter { - emitter; - latestBuildFiles; - static $inject = ['emitter', LATEST_BUILD_FILES_TOKEN]; - // Needed for the karma reporter interface, see https://github.com/angular/angular-cli/issues/31629 - adapters = []; - constructor(emitter, latestBuildFiles) { - this.emitter = emitter; - this.latestBuildFiles = latestBuildFiles; - this.startWatchingBuild(); - } - startWatchingBuild() { - void (async () => { - // This is effectively "for await of but skip what's already consumed". - let isDone = false; // to mark the loop condition as "not constant". - while (!isDone) { - const { done, value: buildOutput } = await buildIterator.next(); - if (done) { - isDone = true; - break; - } - if (buildOutput.kind === results_1.ResultKind.Failure) { - controller.enqueue({ success: false, message: 'Build failed' }); - } - else if (buildOutput.kind === results_1.ResultKind.Incremental || - buildOutput.kind === results_1.ResultKind.Full) { - if (buildOutput.kind === results_1.ResultKind.Full) { - this.latestBuildFiles.files = buildOutput.files; - } - else { - this.latestBuildFiles.files = { - ...this.latestBuildFiles.files, - ...buildOutput.files, - }; - } - await writeTestFiles(buildOutput.files, buildOptions.outputPath); - this.emitter.refreshFiles(); - } - } - })(); - } - onRunComplete = function (_browsers, results) { - if (results.exitCode === 0) { - controller.enqueue({ success: true }); - } - else { - controller.enqueue({ success: false }); - } - }; - } - karmaConfig.reporters ??= []; - karmaConfig.reporters.push(reporterName); - karmaConfig.plugins ??= []; - karmaConfig.plugins.push({ - [`reporter:${reporterName}`]: [ - 'factory', - Object.assign((...args) => new ProgressNotifierReporter(...args), ProgressNotifierReporter), - ], - }); -} -function execute(options, context, transforms) { - const normalizedOptions = (0, options_1.normalizeOptions)(context, options); - const karmaOptions = getBaseKarmaOptions(normalizedOptions, context); - let karmaServer; - return new ReadableStream({ - async start(controller) { - let init; - try { - init = await initializeApplication(normalizedOptions, context, karmaOptions, transforms); - } - catch (err) { - if (err instanceof ApplicationBuildError) { - controller.enqueue({ success: false, message: err.message }); - controller.close(); - return; - } - throw err; - } - const [karma, karmaConfig, buildOptions, buildIterator] = init; - // If `--watch` is explicitly enabled or if we are keeping the Karma - // process running, we should hook Karma into the build. - if (buildIterator) { - injectKarmaReporter(buildOptions, buildIterator, karmaConfig, controller); - } - // Close the stream once the Karma server returns. - karmaServer = new karma.Server(karmaConfig, (exitCode) => { - controller.enqueue({ success: exitCode === 0 }); - controller.close(); - }); - await karmaServer.start(); - }, - async cancel() { - await karmaServer?.stop(); - }, - }); -} -async function getProjectSourceRoot(context) { - // We have already validated that the project name is set before calling this function. - const projectName = context.target?.project; - if (!projectName) { - return context.workspaceRoot; - } - const projectMetadata = await context.getProjectMetadata(projectName); - const { projectSourceRoot } = (0, project_metadata_1.getProjectRootPaths)(context.workspaceRoot, projectMetadata); - return projectSourceRoot; -} -function normalizePolyfills(polyfills = []) { - const jasmineGlobalEntryPoint = localResolve('./polyfills/jasmine_global.js'); - const jasmineGlobalCleanupEntrypoint = localResolve('./polyfills/jasmine_global_cleanup.js'); - const sourcemapEntrypoint = localResolve('./polyfills/init_sourcemaps.js'); - const zoneTestingEntryPoint = 'zone.js/testing'; - const polyfillsExludingZoneTesting = polyfills.filter((p) => p !== zoneTestingEntryPoint); - return [ - polyfillsExludingZoneTesting.concat([jasmineGlobalEntryPoint, sourcemapEntrypoint]), - polyfillsExludingZoneTesting.length === polyfills.length - ? [jasmineGlobalCleanupEntrypoint] - : [jasmineGlobalCleanupEntrypoint, zoneTestingEntryPoint], - ]; -} -async function collectEntrypoints(options, context, projectSourceRoot) { - // Glob for files to test. - const testFiles = await (0, find_tests_1.findTests)(options.include, options.exclude, context.workspaceRoot, projectSourceRoot); - return (0, find_tests_1.getTestEntrypoints)(testFiles, { projectSourceRoot, workspaceRoot: context.workspaceRoot }); -} -// eslint-disable-next-line max-lines-per-function -async function initializeApplication(options, context, karmaOptions, transforms) { - const outputPath = node_path_1.default.join(context.workspaceRoot, 'dist/test-out', (0, node_crypto_1.randomUUID)()); - const projectSourceRoot = await getProjectSourceRoot(context); - // Setup exit cleanup for temporary directory - const handleProcessExit = () => (0, node_fs_1.rmSync)(outputPath, { recursive: true, force: true }); - process.once('exit', handleProcessExit); - process.once('SIGINT', handleProcessExit); - process.once('uncaughtException', handleProcessExit); - const [karma, entryPoints] = await Promise.all([ - Promise.resolve().then(() => __importStar(require('karma'))), - collectEntrypoints(options, context, projectSourceRoot), - fs.rm(outputPath, { recursive: true, force: true }), - ]); - const mainName = 'test_main'; - if (options.main) { - entryPoints.set(mainName, options.main); - } - else { - entryPoints.set(mainName, 'angular:test-bed-init'); - } - const instrumentForCoverage = options.codeCoverage - ? createInstrumentationFilter(projectSourceRoot, getInstrumentationExcludedPaths(context.workspaceRoot, options.codeCoverageExclude ?? [])) - : undefined; - const [polyfills, jasmineCleanup] = normalizePolyfills(options.polyfills); - for (let idx = 0; idx < jasmineCleanup.length; ++idx) { - entryPoints.set(`jasmine-cleanup-${idx}`, jasmineCleanup[idx]); - } - const buildOptions = { - assets: options.assets, - entryPoints, - tsConfig: options.tsConfig, - outputPath, - preserveSymlinks: options.preserveSymlinks, - aot: options.aot, - index: false, - outputHashing: schema_1.OutputHashing.None, - optimization: false, - sourceMap: options.sourceMap, - instrumentForCoverage, - styles: options.styles, - scripts: options.scripts, - polyfills, - webWorkerTsConfig: options.webWorkerTsConfig, - watch: options.watch, - stylePreprocessorOptions: options.stylePreprocessorOptions, - inlineStyleLanguage: options.inlineStyleLanguage, - fileReplacements: options.fileReplacements, - define: options.define, - loader: options.loader, - externalDependencies: options.externalDependencies, - }; - const virtualTestBedInit = (0, virtual_module_plugin_1.createVirtualModulePlugin)({ - namespace: 'angular:test-bed-init', - loadContent: async () => { - const contents = [ - // Initialize the Angular testing environment - `import { getTestBed } from '@angular/core/testing';`, - `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';`, - `getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {`, - ` errorOnUnknownElements: true,`, - ` errorOnUnknownProperties: true,`, - '});', - ]; - return { - contents: contents.join('\n'), - loader: 'js', - resolveDir: projectSourceRoot, - }; - }, - }); - // Build tests with `application` builder, using test files as entry points. - const [buildOutput, buildIterator] = await first((0, index_1.buildApplicationInternal)(buildOptions, context, { codePlugins: [virtualTestBedInit] }), { cancel: !buildOptions.watch }); - if (buildOutput.kind === results_1.ResultKind.Failure) { - throw new ApplicationBuildError('Build failed'); - } - else if (buildOutput.kind !== results_1.ResultKind.Full) { - throw new ApplicationBuildError('A full build result is required from the application builder.'); - } - // Write test files - await writeTestFiles(buildOutput.files, buildOptions.outputPath); - // We need to add this to the beginning *after* the testing framework has - // prepended its files. The output path is required for each since they are - // added later in the test process via a plugin. - const polyfillsFile = { - pattern: `${outputPath}/polyfills.js`, - included: true, - served: true, - type: 'module', - watched: false, - }; - const jasmineCleanupFiles = { - pattern: `${outputPath}/jasmine-cleanup-*.js`, - included: true, - served: true, - type: 'module', - watched: false, - }; - karmaOptions.basePath = outputPath; - const scriptsFiles = []; - if (options.scripts?.length) { - const outputScripts = new Set(); - for (const scriptEntry of options.scripts) { - const outputName = typeof scriptEntry === 'string' - ? 'scripts.js' - : `${scriptEntry.bundleName ?? 'scripts'}.js`; - if (outputScripts.has(outputName)) { - continue; - } - outputScripts.add(outputName); - scriptsFiles.push({ - pattern: `${outputPath}/${outputName}`, - watched: false, - included: typeof scriptEntry === 'string' ? true : scriptEntry.inject !== false, - type: 'js', - }); - } - } - karmaOptions.files ??= []; - karmaOptions.files.push( - // Serve global setup script. - { pattern: `${mainName}.js`, type: 'module', watched: false }, - // Serve all source maps. - { pattern: `*.map`, included: false, watched: false }, - // These are the test entrypoints. - { pattern: `spec-*.js`, type: 'module', watched: false }); - if (hasChunkOrWorkerFiles(buildOutput.files)) { - karmaOptions.files.push( - // Allow loading of chunk-* files but don't include them all on load. - { - pattern: `{chunk,worker}-*.js`, - type: 'module', - included: false, - watched: false, - }); - } - if (options.styles?.length) { - // Serve CSS outputs on page load, these are the global styles. - karmaOptions.files.push({ pattern: `*.css`, type: 'css', watched: false }); - } - const parsedKarmaConfig = await karma.config.parseConfig(options.karmaConfig, transforms?.karmaOptions ? await transforms.karmaOptions(karmaOptions) : karmaOptions, { promiseConfig: true, throwErrors: true }); - // Check for jsdom which does not support executing ESM scripts. - // If present, remove jsdom and issue a warning. - const updatedBrowsers = parsedKarmaConfig.browsers?.filter((browser) => browser !== 'jsdom'); - if (parsedKarmaConfig.browsers?.length !== updatedBrowsers?.length) { - parsedKarmaConfig.browsers = updatedBrowsers; - context.logger.warn(`'jsdom' does not support ESM code execution and cannot be used for karma testing.` + - ` The 'jsdom' entry has been removed from the 'browsers' option.`); - } - // Remove the webpack plugin/framework: - // Alternative would be to make the Karma plugin "smart" but that's a tall order - // with managing unneeded imports etc.. - parsedKarmaConfig.plugins ??= []; - const pluginLengthBefore = parsedKarmaConfig.plugins.length; - parsedKarmaConfig.plugins = parsedKarmaConfig.plugins.filter((plugin) => { - if (typeof plugin === 'string') { - return plugin !== 'framework:@angular-devkit/build-angular'; - } - return !plugin['framework:@angular-devkit/build-angular']; - }); - parsedKarmaConfig.frameworks ??= []; - parsedKarmaConfig.frameworks = parsedKarmaConfig.frameworks.filter((framework) => framework !== '@angular-devkit/build-angular'); - const pluginLengthAfter = parsedKarmaConfig.plugins.length; - if (pluginLengthBefore !== pluginLengthAfter) { - context.logger.warn(`Ignoring framework "@angular-devkit/build-angular" from karma config file because it's not compatible with the application builder.`); - } - parsedKarmaConfig.plugins.push(AngularAssetsMiddleware.createPlugin(buildOutput)); - parsedKarmaConfig.middleware ??= []; - parsedKarmaConfig.middleware.push(AngularAssetsMiddleware.NAME); - parsedKarmaConfig.plugins.push(AngularPolyfillsPlugin.createPlugin(polyfillsFile, jasmineCleanupFiles, scriptsFiles)); - parsedKarmaConfig.reporters ??= []; - parsedKarmaConfig.reporters.push(AngularPolyfillsPlugin.NAME); - // Adjust karma junit reporter outDir location to maintain previous (devkit) behavior - // The base path for the reporter was previously the workspace root. - // To keep the files in the same location, the reporter's output directory is adjusted - // to be relative to the workspace root when using junit. - if (parsedKarmaConfig.reporters?.some((reporter) => reporter === 'junit')) { - if ('junitReporter' in parsedKarmaConfig) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const junitReporterOptions = parsedKarmaConfig['junitReporter']; - if (junitReporterOptions.outputDir == undefined) { - junitReporterOptions.outputDir = context.workspaceRoot; - } - else if (typeof junitReporterOptions.outputDir === 'string' && - !node_path_1.default.isAbsolute(junitReporterOptions.outputDir)) { - junitReporterOptions.outputDir = node_path_1.default.join(context.workspaceRoot, junitReporterOptions.outputDir); - } - } - else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - parsedKarmaConfig['junitReporter'] = { - outputDir: context.workspaceRoot, - }; - } - } - // When using code-coverage, auto-add karma-coverage. - // This was done as part of the karma plugin for webpack. - if (options.codeCoverage && - !parsedKarmaConfig.reporters?.some((r) => r === 'coverage' || r === 'coverage-istanbul')) { - parsedKarmaConfig.reporters = (parsedKarmaConfig.reporters ?? []).concat(['coverage']); - } - return [karma, parsedKarmaConfig, buildOptions, buildIterator]; -} -function hasChunkOrWorkerFiles(files) { - return Object.keys(files).some((filename) => { - return /(?:^|\/)(?:worker|chunk)[^/]+\.js$/.test(filename); - }); -} -async function writeTestFiles(files, testDir) { - const directoryExists = new Set(); - // Writes the test related output files to disk and ensures the containing directories are present - await (0, utils_1.emitFilesToDisk)(Object.entries(files), async ([filePath, file]) => { - if (file.type !== bundler_context_1.BuildOutputFileType.Browser && file.type !== bundler_context_1.BuildOutputFileType.Media) { - return; - } - const fullFilePath = node_path_1.default.join(testDir, filePath); - // Ensure output subdirectories exist - const fileBasePath = node_path_1.default.dirname(fullFilePath); - if (fileBasePath && !directoryExists.has(fileBasePath)) { - await fs.mkdir(fileBasePath, { recursive: true }); - directoryExists.add(fileBasePath); - } - if (file.origin === 'memory') { - // Write file contents - await fs.writeFile(fullFilePath, file.contents); - } - else { - // Copy file contents - await fs.copyFile(file.inputPath, fullFilePath, fs.constants.COPYFILE_FICLONE); - } - }); -} -/** Returns the first item yielded by the given generator and cancels the execution. */ -async function first(generator, { cancel }) { - if (!cancel) { - const iterator = generator[Symbol.asyncIterator](); - const firstValue = await iterator.next(); - if (firstValue.done) { - throw new Error('Expected generator to emit at least once.'); - } - return [firstValue.value, iterator]; - } - for await (const value of generator) { - return [value, null]; - } - throw new Error('Expected generator to emit at least once.'); -} -function createInstrumentationFilter(includedBasePath, excludedPaths) { - return (request) => { - return (!excludedPaths.has(request) && - !/\.(e2e|spec)\.tsx?$|[\\/]node_modules[\\/]/.test(request) && - request.startsWith(includedBasePath)); - }; -} -function getInstrumentationExcludedPaths(root, excludedPaths) { - const excluded = new Set(); - for (const excludeGlob of excludedPaths) { - const excludePath = excludeGlob[0] === '/' ? excludeGlob.slice(1) : excludeGlob; - (0, tinyglobby_1.globSync)(excludePath, { cwd: root }).forEach((p) => excluded.add(node_path_1.default.join(root, p))); - } - return excluded; -} -function getBaseKarmaOptions(options, context) { - // Determine project name from builder context target - const projectName = context.target?.project; - if (!projectName) { - throw new Error(`The 'karma' builder requires a target to be specified.`); - } - const karmaOptions = options.karmaConfig - ? {} - : getBuiltInKarmaConfig(context.workspaceRoot, projectName); - const singleRun = !options.watch; - karmaOptions.singleRun = singleRun; - // Workaround https://github.com/angular/angular-cli/issues/28271, by clearing context by default - // for single run executions. Not clearing context for multi-run (watched) builds allows the - // Jasmine Spec Runner to be visible in the browser after test execution. - karmaOptions.client ??= {}; - karmaOptions.client.clearContext ??= singleRun; - // Convert browsers from a string to an array - if (options.browsers) { - karmaOptions.browsers = options.browsers; - } - if (options.reporters) { - karmaOptions.reporters = options.reporters; - } - return karmaOptions; -} -function getBuiltInKarmaConfig(workspaceRoot, projectName) { - let coverageFolderName = projectName.charAt(0) === '@' ? projectName.slice(1) : projectName; - coverageFolderName = coverageFolderName.toLowerCase(); - const workspaceRootRequire = (0, node_module_1.createRequire)(workspaceRoot + '/'); - // Any changes to the config here need to be synced to: packages/schematics/angular/config/files/karma.conf.js.template - return { - basePath: '', - frameworks: ['jasmine'], - plugins: [ - 'karma-jasmine', - 'karma-chrome-launcher', - 'karma-jasmine-html-reporter', - 'karma-coverage', - ].map((p) => workspaceRootRequire(p)), - jasmineHtmlReporter: { - suppressAll: true, // removes the duplicated traces - }, - coverageReporter: { - dir: node_path_1.default.join(workspaceRoot, 'coverage', coverageFolderName), - subdir: '.', - reporters: [{ type: 'html' }, { type: 'text-summary' }], - }, - reporters: ['progress', 'kjhtml'], - browsers: ['Chrome'], - customLaunchers: { - // Chrome configured to run in a bazel sandbox. - // Disable the use of the gpu and `/dev/shm` because it causes Chrome to - // crash on some environments. - // See: - // https://github.com/puppeteer/puppeteer/blob/v1.0.0/docs/troubleshooting.md#tips - // https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t - ChromeHeadlessNoSandbox: { - base: 'ChromeHeadless', - flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage'], - }, - }, - restartOnFileChange: true, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/find-tests.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/find-tests.d.ts deleted file mode 100755 index 776febd..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/find-tests.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare function findTests(include: string[], exclude: string[], workspaceRoot: string, projectSourceRoot: string): Promise; -interface TestEntrypointsOptions { - projectSourceRoot: string; - workspaceRoot: string; -} -/** Generate unique bundle names for a set of test files. */ -export declare function getTestEntrypoints(testFiles: string[], { projectSourceRoot, workspaceRoot }: TestEntrypointsOptions): Map; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/find-tests.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/find-tests.js deleted file mode 100755 index 27e3bbe..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/find-tests.js +++ /dev/null @@ -1,111 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.findTests = findTests; -exports.getTestEntrypoints = getTestEntrypoints; -const node_fs_1 = require("node:fs"); -const node_path_1 = require("node:path"); -const tinyglobby_1 = require("tinyglobby"); -const path_1 = require("../../utils/path"); -/* Go through all patterns and find unique list of files */ -async function findTests(include, exclude, workspaceRoot, projectSourceRoot) { - const matchingTestsPromises = include.map((pattern) => findMatchingTests(pattern, exclude, workspaceRoot, projectSourceRoot)); - const files = await Promise.all(matchingTestsPromises); - // Unique file names - return [...new Set(files.flat())]; -} -/** Generate unique bundle names for a set of test files. */ -function getTestEntrypoints(testFiles, { projectSourceRoot, workspaceRoot }) { - const seen = new Set(); - return new Map(Array.from(testFiles, (testFile) => { - const relativePath = removeRoots(testFile, [projectSourceRoot, workspaceRoot]) - // Strip leading dots and path separators. - .replace(/^[./\\]+/, '') - // Replace any path separators with dashes. - .replace(/[/\\]/g, '-'); - const baseName = `spec-${(0, node_path_1.basename)(relativePath, (0, node_path_1.extname)(relativePath))}`; - let uniqueName = baseName; - let suffix = 2; - while (seen.has(uniqueName)) { - uniqueName = `${baseName}-${suffix}`.replace(/([^\w](?:spec|test))-([\d]+)$/, '-$2$1'); - ++suffix; - } - seen.add(uniqueName); - return [uniqueName, testFile]; - })); -} -const removeLeadingSlash = (pattern) => { - if (pattern.charAt(0) === '/') { - return pattern.substring(1); - } - return pattern; -}; -const removeRelativeRoot = (path, root) => { - if (path.startsWith(root)) { - return path.substring(root.length); - } - return path; -}; -function removeRoots(path, roots) { - for (const root of roots) { - if (path.startsWith(root)) { - return path.substring(root.length); - } - } - return (0, node_path_1.basename)(path); -} -async function findMatchingTests(pattern, ignore, workspaceRoot, projectSourceRoot) { - // normalize pattern, glob lib only accepts forward slashes - let normalizedPattern = (0, path_1.toPosixPath)(pattern); - normalizedPattern = removeLeadingSlash(normalizedPattern); - const relativeProjectRoot = (0, path_1.toPosixPath)((0, node_path_1.relative)(workspaceRoot, projectSourceRoot) + '/'); - // remove relativeProjectRoot to support relative paths from root - // such paths are easy to get when running scripts via IDEs - normalizedPattern = removeRelativeRoot(normalizedPattern, relativeProjectRoot); - // special logic when pattern does not look like a glob - if (!(0, tinyglobby_1.isDynamicPattern)(normalizedPattern)) { - if (await isDirectory((0, node_path_1.join)(projectSourceRoot, normalizedPattern))) { - normalizedPattern = `${normalizedPattern}/**/*.spec.@(ts|tsx)`; - } - else { - // see if matching spec file exists - const fileExt = (0, node_path_1.extname)(normalizedPattern); - // Replace extension to `.spec.ext`. Example: `src/app/app.component.ts`-> `src/app/app.component.spec.ts` - const potentialSpec = (0, node_path_1.join)(projectSourceRoot, (0, node_path_1.dirname)(normalizedPattern), `${(0, node_path_1.basename)(normalizedPattern, fileExt)}.spec${fileExt}`); - if (await exists(potentialSpec)) { - return [potentialSpec]; - } - } - } - // normalize the patterns in the ignore list - const normalizedIgnorePatternList = ignore.map((pattern) => removeRelativeRoot(removeLeadingSlash((0, path_1.toPosixPath)(pattern)), relativeProjectRoot)); - return (0, tinyglobby_1.glob)(normalizedPattern, { - cwd: projectSourceRoot, - absolute: true, - ignore: ['**/node_modules/**', ...normalizedIgnorePatternList], - }); -} -async function isDirectory(path) { - try { - const stats = await node_fs_1.promises.stat(path); - return stats.isDirectory(); - } - catch { - return false; - } -} -async function exists(path) { - try { - await node_fs_1.promises.access(path, node_fs_1.constants.F_OK); - return true; - } - catch { - return false; - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/index.d.ts deleted file mode 100755 index 698091c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { type Builder, type BuilderContext, type BuilderOutput } from '@angular-devkit/architect'; -import type { ConfigOptions } from 'karma'; -import type { Schema as KarmaBuilderOptions } from './schema'; -export interface KarmaBuilderTransformsOptions { - karmaOptions?: (options: ConfigOptions) => ConfigOptions | Promise; -} -/** - * @experimental Direct usage of this function is considered experimental. - */ -export declare function execute(options: KarmaBuilderOptions, context: BuilderContext, transforms?: KarmaBuilderTransformsOptions): AsyncIterable; -export type { KarmaBuilderOptions }; -declare const builder: Builder; -export default builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/index.js deleted file mode 100755 index e057203..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/index.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.execute = execute; -const architect_1 = require("@angular-devkit/architect"); -/** - * @experimental Direct usage of this function is considered experimental. - */ -async function* execute(options, context, transforms) { - const { execute } = await Promise.resolve().then(() => __importStar(require('./application_builder'))); - yield* execute(options, context, transforms); -} -const builder = (0, architect_1.createBuilder)(execute); -exports.default = builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/options.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/options.d.ts deleted file mode 100755 index 8b99b5b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/options.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuilderContext } from '@angular-devkit/architect'; -import { Schema as KarmaBuilderOptions } from './schema'; -export type NormalizedKarmaBuilderOptions = ReturnType; -export declare function normalizeOptions(context: BuilderContext, options: KarmaBuilderOptions): { - sourceMap: import("./schema").SourceMapUnion | undefined; - karmaConfig: string | undefined; - reporters: string[] | undefined; - browsers: string[] | undefined; - watch: boolean; - include: string[]; - exclude: string[]; - aot?: boolean; - assets?: import("./schema").AssetPattern[]; - codeCoverage?: boolean; - codeCoverageExclude?: string[]; - define?: { - [key: string]: string; - }; - externalDependencies?: string[]; - fileReplacements?: import("./schema").FileReplacement[]; - inlineStyleLanguage?: import("./schema").InlineStyleLanguage; - loader?: { - [key: string]: any; - }; - main?: string; - poll?: number; - polyfills?: string[]; - preserveSymlinks?: boolean; - progress?: boolean; - scripts?: import("./schema").ScriptElement[]; - stylePreprocessorOptions?: import("./schema").StylePreprocessorOptions; - styles?: import("./schema").StyleElement[]; - tsConfig: string; - webWorkerTsConfig?: string; -}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/options.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/options.js deleted file mode 100755 index fbea91b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/options.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.normalizeOptions = normalizeOptions; -const node_path_1 = require("node:path"); -function normalizeOptions(context, options) { - const { sourceMap, karmaConfig, browsers, watch = true, include = [], exclude = [], reporters = [], ...rest } = options; - let normalizedBrowsers; - if (typeof options.browsers === 'string' && options.browsers) { - normalizedBrowsers = options.browsers.split(',').map((browser) => browser.trim()); - } - else if (options.browsers === false) { - normalizedBrowsers = []; - } - // Split along commas to make it more natural, and remove empty strings. - const normalizedReporters = reporters - .reduce((acc, curr) => acc.concat(curr.split(',')), []) - .filter((x) => !!x); - // Sourcemaps are always needed when code coverage is enabled. - const normalizedSourceMap = options.codeCoverage - ? { - scripts: true, - styles: true, - vendor: true, - } - : sourceMap; - return { - ...rest, - sourceMap: normalizedSourceMap, - karmaConfig: karmaConfig ? (0, node_path_1.resolve)(context.workspaceRoot, karmaConfig) : undefined, - reporters: normalizedReporters.length ? normalizedReporters : undefined, - browsers: normalizedBrowsers, - watch, - include, - exclude, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/init_sourcemaps.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/init_sourcemaps.js deleted file mode 100755 index 2f8934c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/init_sourcemaps.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -// eslint-disable-next-line no-undef -globalThis.sourceMapSupport?.install(); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/jasmine_global.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/jasmine_global.js deleted file mode 100755 index 7f45cf5..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/jasmine_global.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -// See: https://github.com/jasmine/jasmine/issues/2015 -(function () { - 'use strict'; - - // jasmine will ignore `window` unless it returns this specific (but uncommon) - // value from toString(). - window.toString = function () { - return '[object GjsGlobal]'; - }; -})(); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/jasmine_global_cleanup.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/jasmine_global_cleanup.js deleted file mode 100755 index d703f8e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/polyfills/jasmine_global_cleanup.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -// See: https://github.com/jasmine/jasmine/issues/2015 -(function () { - 'use strict'; - - delete window.toString; -})(); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.d.ts deleted file mode 100755 index 430e699..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.d.ts +++ /dev/null @@ -1,250 +0,0 @@ -/** - * Karma target options for Build Facade. - */ -export type Schema = { - /** - * Run tests using Ahead of Time compilation. - */ - aot?: boolean; - /** - * List of static application assets. - */ - assets?: AssetPattern[]; - /** - * Override which browsers tests are run against. Set to `false` to not use any browser. - */ - browsers?: Browsers; - /** - * Output a code coverage report. - */ - codeCoverage?: boolean; - /** - * Globs to exclude from code coverage. - */ - codeCoverageExclude?: string[]; - /** - * Defines global identifiers that will be replaced with a specified constant value when - * found in any JavaScript or TypeScript code including libraries. The value will be used - * directly. String values must be put in quotes. Identifiers within Angular metadata such - * as Component Decorators will not be replaced. - */ - define?: { - [key: string]: string; - }; - /** - * Globs of files to exclude, relative to the project root. - */ - exclude?: string[]; - /** - * Exclude the listed external dependencies from being bundled into the bundle. Instead, the - * created bundle relies on these dependencies to be available during runtime. - */ - externalDependencies?: string[]; - /** - * Replace compilation source files with other compilation source files in the build. - */ - fileReplacements?: FileReplacement[]; - /** - * Globs of files to include, relative to project root. - * There are 2 special cases: - * - when a path to directory is provided, all spec files ending ".spec.@(ts|tsx)" will be - * included - * - when a path to a file is provided, and a matching spec file exists it will be included - * instead. - */ - include?: string[]; - /** - * The stylesheet language to use for the application's inline component styles. - */ - inlineStyleLanguage?: InlineStyleLanguage; - /** - * The name of the Karma configuration file. - */ - karmaConfig?: string; - /** - * Defines the type of loader to use with a specified file extension when used with a - * JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content - * as a Uint8Array; `file` emits the file and provides the runtime location of the file; - * `dataurl` inlines the content as a data URL with best guess of MIME type; `base64` - * inlines the content as a Base64-encoded string; `empty` considers the content to be empty - * and not include it in bundles. - */ - loader?: { - [key: string]: any; - }; - /** - * The name of the main entry-point file. - */ - main?: string; - /** - * Enable and define the file watching poll time period in milliseconds. - */ - poll?: number; - /** - * A list of polyfills to include in the build. Can be a full path for a file, relative to - * the current workspace or module specifier. Example: 'zone.js'. - */ - polyfills?: string[]; - /** - * Do not use the real path when resolving modules. If unset then will default to `true` if - * NodeJS option --preserve-symlinks is set. - */ - preserveSymlinks?: boolean; - /** - * Log progress to the console while building. - */ - progress?: boolean; - /** - * Karma reporters to use. Directly passed to the karma runner. - */ - reporters?: string[]; - /** - * Global scripts to be included in the build. - */ - scripts?: ScriptElement[]; - /** - * Output source maps for scripts and styles. For more information, see - * https://angular.dev/reference/configs/workspace-config#source-map-configuration. - */ - sourceMap?: SourceMapUnion; - /** - * Options to pass to style preprocessors. - */ - stylePreprocessorOptions?: StylePreprocessorOptions; - /** - * Global styles to be included in the build. - */ - styles?: StyleElement[]; - /** - * The name of the TypeScript configuration file. - */ - tsConfig: string; - /** - * Re-run tests when source files change. - */ - watch?: boolean; - /** - * TypeScript configuration for Web Worker modules. - */ - webWorkerTsConfig?: string; -}; -export type AssetPattern = AssetPatternClass | string; -export type AssetPatternClass = { - /** - * The pattern to match. - */ - glob: string; - /** - * An array of globs to ignore. - */ - ignore?: string[]; - /** - * The input directory path in which to apply 'glob'. Defaults to the project root. - */ - input: string; - /** - * Absolute path within the output. - */ - output?: string; -}; -/** - * Override which browsers tests are run against. Set to `false` to not use any browser. - */ -export type Browsers = boolean | string; -export type FileReplacement = { - replace: string; - with: string; -}; -/** - * The stylesheet language to use for the application's inline component styles. - */ -export declare enum InlineStyleLanguage { - Css = "css", - Less = "less", - Sass = "sass", - Scss = "scss" -} -export type ScriptElement = ScriptClass | string; -export type ScriptClass = { - /** - * The bundle name for this extra entry point. - */ - bundleName?: string; - /** - * If the bundle will be referenced in the HTML file. - */ - inject?: boolean; - /** - * The file to include. - */ - input: string; -}; -/** - * Output source maps for scripts and styles. For more information, see - * https://angular.dev/reference/configs/workspace-config#source-map-configuration. - */ -export type SourceMapUnion = boolean | SourceMapClass; -export type SourceMapClass = { - /** - * Output source maps for all scripts. - */ - scripts?: boolean; - /** - * Output source maps for all styles. - */ - styles?: boolean; - /** - * Resolve vendor packages source maps. - */ - vendor?: boolean; -}; -/** - * Options to pass to style preprocessors. - */ -export type StylePreprocessorOptions = { - /** - * Paths to include. Paths will be resolved to workspace root. - */ - includePaths?: string[]; - /** - * Options to pass to the sass preprocessor. - */ - sass?: Sass; -}; -/** - * Options to pass to the sass preprocessor. - */ -export type Sass = { - /** - * A set of deprecations to treat as fatal. If a deprecation warning of any provided type is - * encountered during compilation, the compiler will error instead. If a Version is - * provided, then all deprecations that were active in that compiler version will be treated - * as fatal. - */ - fatalDeprecations?: string[]; - /** - * A set of future deprecations to opt into early. Future deprecations passed here will be - * treated as active by the compiler, emitting warnings as necessary. - */ - futureDeprecations?: string[]; - /** - * A set of active deprecations to ignore. If a deprecation warning of any provided type is - * encountered during compilation, the compiler will ignore it instead. - */ - silenceDeprecations?: string[]; -}; -export type StyleElement = StyleClass | string; -export type StyleClass = { - /** - * The bundle name for this extra entry point. - */ - bundleName?: string; - /** - * If the bundle will be referenced in the HTML file. - */ - inject?: boolean; - /** - * The file to include. - */ - input: string; -}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.js deleted file mode 100755 index 08e82f7..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE -// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). -Object.defineProperty(exports, "__esModule", { value: true }); -exports.InlineStyleLanguage = void 0; -/** - * The stylesheet language to use for the application's inline component styles. - */ -var InlineStyleLanguage; -(function (InlineStyleLanguage) { - InlineStyleLanguage["Css"] = "css"; - InlineStyleLanguage["Less"] = "less"; - InlineStyleLanguage["Sass"] = "sass"; - InlineStyleLanguage["Scss"] = "scss"; -})(InlineStyleLanguage || (exports.InlineStyleLanguage = InlineStyleLanguage = {})); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.json b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.json deleted file mode 100755 index 325f429..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/karma/schema.json +++ /dev/null @@ -1,348 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "title": "Karma Target", - "description": "Karma target options for Build Facade.", - "type": "object", - "properties": { - "main": { - "type": "string", - "description": "The name of the main entry-point file." - }, - "tsConfig": { - "type": "string", - "description": "The name of the TypeScript configuration file." - }, - "karmaConfig": { - "type": "string", - "description": "The name of the Karma configuration file." - }, - "polyfills": { - "description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.", - "type": "array", - "items": { - "type": "string", - "uniqueItems": true - }, - "default": [] - }, - "assets": { - "type": "array", - "description": "List of static application assets.", - "default": [], - "items": { - "$ref": "#/definitions/assetPattern" - } - }, - "scripts": { - "description": "Global scripts to be included in the build.", - "type": "array", - "default": [], - "items": { - "oneOf": [ - { - "type": "object", - "properties": { - "input": { - "type": "string", - "description": "The file to include.", - "pattern": "\\.[cm]?jsx?$" - }, - "bundleName": { - "type": "string", - "pattern": "^[\\w\\-.]*$", - "description": "The bundle name for this extra entry point." - }, - "inject": { - "type": "boolean", - "description": "If the bundle will be referenced in the HTML file.", - "default": true - } - }, - "additionalProperties": false, - "required": ["input"] - }, - { - "type": "string", - "description": "The file to include.", - "pattern": "\\.[cm]?jsx?$" - } - ] - } - }, - "styles": { - "description": "Global styles to be included in the build.", - "type": "array", - "default": [], - "items": { - "oneOf": [ - { - "type": "object", - "properties": { - "input": { - "type": "string", - "description": "The file to include.", - "pattern": "\\.(?:css|scss|sass|less)$" - }, - "bundleName": { - "type": "string", - "pattern": "^[\\w\\-.]*$", - "description": "The bundle name for this extra entry point." - }, - "inject": { - "type": "boolean", - "description": "If the bundle will be referenced in the HTML file.", - "default": true - } - }, - "additionalProperties": false, - "required": ["input"] - }, - { - "type": "string", - "description": "The file to include.", - "pattern": "\\.(?:css|scss|sass|less)$" - } - ] - } - }, - "inlineStyleLanguage": { - "description": "The stylesheet language to use for the application's inline component styles.", - "type": "string", - "default": "css", - "enum": ["css", "less", "sass", "scss"] - }, - "stylePreprocessorOptions": { - "description": "Options to pass to style preprocessors.", - "type": "object", - "properties": { - "includePaths": { - "description": "Paths to include. Paths will be resolved to workspace root.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "sass": { - "description": "Options to pass to the sass preprocessor.", - "type": "object", - "properties": { - "fatalDeprecations": { - "description": "A set of deprecations to treat as fatal. If a deprecation warning of any provided type is encountered during compilation, the compiler will error instead. If a Version is provided, then all deprecations that were active in that compiler version will be treated as fatal.", - "type": "array", - "items": { - "type": "string" - } - }, - "silenceDeprecations": { - "description": " A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead.", - "type": "array", - "items": { - "type": "string" - } - }, - "futureDeprecations": { - "description": "A set of future deprecations to opt into early. Future deprecations passed here will be treated as active by the compiler, emitting warnings as necessary.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "externalDependencies": { - "description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "loader": { - "description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `dataurl` inlines the content as a data URL with best guess of MIME type; `base64` inlines the content as a Base64-encoded string; `empty` considers the content to be empty and not include it in bundles.", - "type": "object", - "patternProperties": { - "^\\.\\S+$": { "enum": ["text", "binary", "file", "dataurl", "base64", "empty"] } - } - }, - "define": { - "description": "Defines global identifiers that will be replaced with a specified constant value when found in any JavaScript or TypeScript code including libraries. The value will be used directly. String values must be put in quotes. Identifiers within Angular metadata such as Component Decorators will not be replaced.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "include": { - "type": "array", - "items": { - "type": "string" - }, - "default": ["**/*.spec.ts"], - "description": "Globs of files to include, relative to project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead." - }, - "exclude": { - "type": "array", - "items": { - "type": "string" - }, - "default": [], - "description": "Globs of files to exclude, relative to the project root." - }, - "sourceMap": { - "description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.", - "default": true, - "oneOf": [ - { - "type": "object", - "properties": { - "scripts": { - "type": "boolean", - "description": "Output source maps for all scripts.", - "default": true - }, - "styles": { - "type": "boolean", - "description": "Output source maps for all styles.", - "default": true - }, - "vendor": { - "type": "boolean", - "description": "Resolve vendor packages source maps.", - "default": false - } - }, - "additionalProperties": false - }, - { - "type": "boolean" - } - ] - }, - "progress": { - "type": "boolean", - "description": "Log progress to the console while building.", - "default": true - }, - "watch": { - "type": "boolean", - "description": "Re-run tests when source files change.", - "default": true - }, - "poll": { - "type": "number", - "description": "Enable and define the file watching poll time period in milliseconds." - }, - "preserveSymlinks": { - "type": "boolean", - "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set." - }, - "browsers": { - "description": "Override which browsers tests are run against. Set to `false` to not use any browser.", - "oneOf": [ - { - "type": "string", - "description": "A comma seperate list of browsers to run tests against." - }, - { - "const": false, - "type": "boolean", - "description": "Does use run tests against a browser." - } - ] - }, - "codeCoverage": { - "type": "boolean", - "description": "Output a code coverage report.", - "default": false - }, - "codeCoverageExclude": { - "type": "array", - "description": "Globs to exclude from code coverage.", - "items": { - "type": "string" - }, - "default": [] - }, - "fileReplacements": { - "description": "Replace compilation source files with other compilation source files in the build.", - "type": "array", - "items": { - "$ref": "#/definitions/fileReplacement" - }, - "default": [] - }, - "reporters": { - "type": "array", - "description": "Karma reporters to use. Directly passed to the karma runner.", - "items": { - "type": "string" - } - }, - "webWorkerTsConfig": { - "type": "string", - "description": "TypeScript configuration for Web Worker modules." - }, - "aot": { - "type": "boolean", - "description": "Run tests using Ahead of Time compilation.", - "default": false - } - }, - "additionalProperties": false, - "required": ["tsConfig"], - "definitions": { - "assetPattern": { - "oneOf": [ - { - "type": "object", - "properties": { - "glob": { - "type": "string", - "description": "The pattern to match." - }, - "input": { - "type": "string", - "description": "The input directory path in which to apply 'glob'. Defaults to the project root." - }, - "output": { - "type": "string", - "default": "", - "description": "Absolute path within the output." - }, - "ignore": { - "description": "An array of globs to ignore.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "required": ["glob", "input"] - }, - { - "type": "string" - } - ] - }, - "fileReplacement": { - "type": "object", - "properties": { - "replace": { - "type": "string", - "pattern": "\\.(([cm]?[jt])sx?|json)$" - }, - "with": { - "type": "string", - "pattern": "\\.(([cm]?[jt])sx?|json)$" - } - }, - "additionalProperties": false, - "required": ["replace", "with"] - } - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/builder.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/builder.d.ts deleted file mode 100755 index 185462a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/builder.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; -import type { Schema as NgPackagrBuilderOptions } from './schema'; -/** - * A Builder that executes the `ng-packagr` tool to build an Angular library. - * - * @param options The builder options as defined by the JSON schema. - * @param context A BuilderContext instance. - * @returns A BuilderOutput object. - * - * @experimental Direct usage of this function is considered experimental. - */ -export declare function execute(options: NgPackagrBuilderOptions, context: BuilderContext): AsyncIterableIterator; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/builder.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/builder.js deleted file mode 100755 index 2688902..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/builder.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.execute = execute; -const node_path_1 = require("node:path"); -const error_1 = require("../../utils/error"); -const normalize_cache_1 = require("../../utils/normalize-cache"); -const purge_cache_1 = require("../../utils/purge-cache"); -/** - * A Builder that executes the `ng-packagr` tool to build an Angular library. - * - * @param options The builder options as defined by the JSON schema. - * @param context A BuilderContext instance. - * @returns A BuilderOutput object. - * - * @experimental Direct usage of this function is considered experimental. - */ -async function* execute(options, context) { - // Purge old build disk cache. - await (0, purge_cache_1.purgeStaleBuildCache)(context); - const workspaceRoot = context.workspaceRoot; - let packager; - try { - packager = (await Promise.resolve().then(() => __importStar(require('ng-packagr')))).ngPackagr(); - } - catch (error) { - (0, error_1.assertIsError)(error); - if (error.code === 'MODULE_NOT_FOUND') { - return { - success: false, - error: 'The "ng-packagr" package was not found. To correct this error, ensure this package is installed in the project.', - }; - } - throw error; - } - const projectName = context.target?.project; - if (!projectName) { - throw new Error('The builder requires a target.'); - } - const metadata = await context.getProjectMetadata(projectName); - const ngPackagrConfig = options.project - ? (0, node_path_1.join)(workspaceRoot, options.project) - : (0, node_path_1.join)(workspaceRoot, metadata.root ?? '', 'ng-package.json'); - packager.forProject(ngPackagrConfig); - if (options.tsConfig) { - packager.withTsConfig((0, node_path_1.resolve)(workspaceRoot, options.tsConfig)); - } - const { enabled: cacheEnabled, path: cacheDirectory } = (0, normalize_cache_1.normalizeCacheOptions)(metadata, context.workspaceRoot); - const ngPackagrOptions = { - cacheEnabled, - poll: options.poll, - cacheDirectory: (0, node_path_1.join)(cacheDirectory, 'ng-packagr'), - }; - try { - if (options.watch) { - await packager.watch(ngPackagrOptions).toPromise(); - } - else { - await packager.build(ngPackagrOptions); - } - yield { success: true }; - } - catch (error) { - (0, error_1.assertIsError)(error); - yield { success: false, error: error.message }; - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/index.d.ts deleted file mode 100755 index d089067..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { Builder } from '@angular-devkit/architect'; -import { execute } from './builder'; -import type { Schema as NgPackagrBuilderOptions } from './schema'; -export { type NgPackagrBuilderOptions, execute }; -declare const builder: Builder; -export default builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/index.js deleted file mode 100755 index f204f9f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.execute = void 0; -const architect_1 = require("@angular-devkit/architect"); -const builder_1 = require("./builder"); -Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return builder_1.execute; } }); -const builder = (0, architect_1.createBuilder)(builder_1.execute); -exports.default = builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.d.ts deleted file mode 100755 index b4b9b26..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * ng-packagr target options for Build Architect. Use to build library projects. - */ -export type Schema = { - /** - * Enable and define the file watching poll time period in milliseconds. - */ - poll?: number; - /** - * The file path for the ng-packagr configuration file, relative to the current workspace. - */ - project?: string; - /** - * The full path for the TypeScript configuration file, relative to the current workspace. - */ - tsConfig?: string; - /** - * Run build when files change. - */ - watch?: boolean; -}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.js deleted file mode 100755 index 4fb6d3d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE -// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.json b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.json deleted file mode 100755 index 0aa80ed..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/ng-packagr/schema.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "title": "ng-packagr Target", - "description": "ng-packagr target options for Build Architect. Use to build library projects.", - "type": "object", - "properties": { - "project": { - "type": "string", - "description": "The file path for the ng-packagr configuration file, relative to the current workspace." - }, - "tsConfig": { - "type": "string", - "description": "The full path for the TypeScript configuration file, relative to the current workspace." - }, - "watch": { - "type": "boolean", - "description": "Run build when files change.", - "default": false - }, - "poll": { - "type": "number", - "description": "Enable and define the file watching poll time period in milliseconds." - } - }, - "additionalProperties": false -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/builder.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/builder.d.ts deleted file mode 100755 index fda3005..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/builder.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; -import type { ApplicationBuilderExtensions } from '../application/options'; -import type { Schema as UnitTestBuilderOptions } from './schema'; -export type { UnitTestBuilderOptions }; -/** - * @experimental Direct usage of this function is considered experimental. - */ -export declare function execute(options: UnitTestBuilderOptions, context: BuilderContext, extensions?: ApplicationBuilderExtensions): AsyncIterable; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/builder.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/builder.js deleted file mode 100755 index 225bb46..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/builder.js +++ /dev/null @@ -1,335 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.execute = execute; -const node_assert_1 = __importDefault(require("node:assert")); -const node_crypto_1 = require("node:crypto"); -const node_module_1 = require("node:module"); -const node_path_1 = __importDefault(require("node:path")); -const virtual_module_plugin_1 = require("../../tools/esbuild/virtual-module-plugin"); -const error_1 = require("../../utils/error"); -const load_esm_1 = require("../../utils/load-esm"); -const path_1 = require("../../utils/path"); -const application_1 = require("../application"); -const results_1 = require("../application/results"); -const schema_1 = require("../application/schema"); -const application_builder_1 = require("../karma/application_builder"); -const find_tests_1 = require("../karma/find-tests"); -const karma_bridge_1 = require("./karma-bridge"); -const options_1 = require("./options"); -function adjustOutputHashing(hashing) { - switch (hashing) { - case schema_1.OutputHashing.All: - case schema_1.OutputHashing.Media: - // Ensure media is continued to be hashed to avoid overwriting of output media files - return schema_1.OutputHashing.Media; - default: - return schema_1.OutputHashing.None; - } -} -/** - * @experimental Direct usage of this function is considered experimental. - */ -// eslint-disable-next-line max-lines-per-function -async function* execute(options, context, extensions = {}) { - // Determine project name from builder context target - const projectName = context.target?.project; - if (!projectName) { - context.logger.error(`The "${context.builder.builderName}" builder requires a target to be specified.`); - return; - } - context.logger.warn(`NOTE: The "${context.builder.builderName}" builder is currently EXPERIMENTAL and not ready for production use.`); - const normalizedOptions = await (0, options_1.normalizeOptions)(context, projectName, options); - const { projectSourceRoot, workspaceRoot, runnerName } = normalizedOptions; - // Translate options and use karma builder directly if specified - if (runnerName === 'karma') { - const karmaBridge = await (0, karma_bridge_1.useKarmaBuilder)(context, normalizedOptions); - yield* karmaBridge; - return; - } - if (runnerName !== 'vitest') { - context.logger.error('Unknown test runner: ' + runnerName); - return; - } - // Find test files - const testFiles = await (0, find_tests_1.findTests)(normalizedOptions.include, normalizedOptions.exclude, workspaceRoot, projectSourceRoot); - if (testFiles.length === 0) { - context.logger.error('No tests found.'); - return { success: false }; - } - const entryPoints = (0, find_tests_1.getTestEntrypoints)(testFiles, { projectSourceRoot, workspaceRoot }); - entryPoints.set('init-testbed', 'angular:test-bed-init'); - let vitestNodeModule; - try { - vitestNodeModule = await (0, load_esm_1.loadEsmModule)('vitest/node'); - } - catch (error) { - (0, error_1.assertIsError)(error); - if (error.code !== 'ERR_MODULE_NOT_FOUND') { - throw error; - } - context.logger.error('The `vitest` package was not found. Please install the package and rerun the test command.'); - return; - } - const { startVitest } = vitestNodeModule; - // Setup test file build options based on application build target options - const buildTargetOptions = (await context.validateOptions(await context.getTargetOptions(normalizedOptions.buildTarget), await context.getBuilderNameForTarget(normalizedOptions.buildTarget))); - buildTargetOptions.polyfills = (0, options_1.injectTestingPolyfills)(buildTargetOptions.polyfills); - const outputPath = (0, path_1.toPosixPath)(node_path_1.default.join(context.workspaceRoot, generateOutputPath())); - const buildOptions = { - ...buildTargetOptions, - watch: normalizedOptions.watch, - incrementalResults: normalizedOptions.watch, - outputPath, - index: false, - browser: undefined, - server: undefined, - outputMode: undefined, - localize: false, - budgets: [], - serviceWorker: false, - appShell: false, - ssr: false, - prerender: false, - sourceMap: { scripts: true, vendor: false, styles: false }, - outputHashing: adjustOutputHashing(buildTargetOptions.outputHashing), - optimization: false, - tsConfig: normalizedOptions.tsConfig, - entryPoints, - externalDependencies: [ - 'vitest', - '@vitest/browser/context', - ...(buildTargetOptions.externalDependencies ?? []), - ], - }; - extensions ??= {}; - extensions.codePlugins ??= []; - const virtualTestBedInit = (0, virtual_module_plugin_1.createVirtualModulePlugin)({ - namespace: 'angular:test-bed-init', - loadContent: async () => { - const contents = [ - // Initialize the Angular testing environment - `import { NgModule } from '@angular/core';`, - `import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';`, - `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';`, - '', - normalizedOptions.providersFile - ? `import providers from './${(0, path_1.toPosixPath)(node_path_1.default - .relative(projectSourceRoot, normalizedOptions.providersFile) - .replace(/.[mc]?ts$/, ''))}'` - : 'const providers = [];', - '', - // Same as https://github.com/angular/angular/blob/05a03d3f975771bb59c7eefd37c01fa127ee2229/packages/core/testing/src/test_hooks.ts#L21-L29 - `beforeEach(getCleanupHook(false));`, - `afterEach(getCleanupHook(true));`, - '', - `@NgModule({`, - ` providers,`, - `})`, - `export class TestModule {}`, - '', - `getTestBed().initTestEnvironment([BrowserTestingModule, TestModule], platformBrowserTesting(), {`, - ` errorOnUnknownElements: true,`, - ` errorOnUnknownProperties: true,`, - '});', - ]; - return { - contents: contents.join('\n'), - loader: 'js', - resolveDir: projectSourceRoot, - }; - }, - }); - extensions.codePlugins.unshift(virtualTestBedInit); - let instance; - // Setup vitest browser options if configured - const { browser, errors } = setupBrowserConfiguration(normalizedOptions.browsers, normalizedOptions.debug, projectSourceRoot); - if (errors?.length) { - errors.forEach((error) => context.logger.error(error)); - return { success: false }; - } - // Add setup file entries for TestBed initialization and project polyfills - const setupFiles = ['init-testbed.js', ...normalizedOptions.setupFiles]; - if (buildTargetOptions?.polyfills?.length) { - // Placed first as polyfills may be required by the Testbed initialization - // or other project provided setup files (e.g., zone.js, ECMAScript polyfills). - setupFiles.unshift('polyfills.js'); - } - const debugOptions = normalizedOptions.debug - ? { - inspectBrk: true, - isolate: false, - fileParallelism: false, - } - : {}; - try { - for await (const result of (0, application_1.buildApplicationInternal)(buildOptions, context, extensions)) { - if (result.kind === results_1.ResultKind.Failure) { - continue; - } - else if (result.kind !== results_1.ResultKind.Full && result.kind !== results_1.ResultKind.Incremental) { - node_assert_1.default.fail('A full and/or incremental build result is required from the application builder.'); - } - (0, node_assert_1.default)(result.files, 'Builder did not provide result files.'); - await (0, application_builder_1.writeTestFiles)(result.files, outputPath); - instance ??= await startVitest('test', undefined /* cliFilters */, { - // Disable configuration file resolution/loading - config: false, - root: workspaceRoot, - project: ['base', projectName], - name: 'base', - include: [], - reporters: normalizedOptions.reporters ?? ['default'], - watch: normalizedOptions.watch, - coverage: generateCoverageOption(normalizedOptions.codeCoverage, workspaceRoot, outputPath), - ...debugOptions, - }, { - plugins: [ - { - name: 'angular:project-init', - async configureVitest(context) { - // Create a subproject that can be configured with plugins for browser mode. - // Plugins defined directly in the vite overrides will not be present in the - // browser specific Vite instance. - const [project] = await context.injectTestProjects({ - test: { - name: projectName, - root: outputPath, - globals: true, - setupFiles, - // Use `jsdom` if no browsers are explicitly configured. - // `node` is effectively no "environment" and the default. - environment: browser ? 'node' : 'jsdom', - browser, - }, - plugins: [ - { - name: 'angular:html-index', - transformIndexHtml() { - // Add all global stylesheets - return (Object.entries(result.files) - // TODO: Expand this to all configured global stylesheets - .filter(([file]) => file === 'styles.css') - .map(([styleUrl]) => ({ - tag: 'link', - attrs: { - 'href': styleUrl, - 'rel': 'stylesheet', - }, - injectTo: 'head', - }))); - }, - }, - ], - }); - // Adjust coverage excludes to not include the otherwise automatically inserted included unit tests. - // Vite does this as a convenience but is problematic for the bundling strategy employed by the - // builder's test setup. To workaround this, the excludes are adjusted here to only automaticallyAdd commentMore actions - // exclude the TypeScript source test files. - project.config.coverage.exclude = [ - ...(normalizedOptions.codeCoverage?.exclude ?? []), - '**/*.{test,spec}.?(c|m)ts', - ]; - }, - }, - ], - }); - // Check if all the tests pass to calculate the result - const testModules = instance.state.getTestModules(); - yield { success: testModules.every((testModule) => testModule.ok()) }; - } - } - finally { - if (normalizedOptions.watch) { - // Vitest will automatically close if not using watch mode - await instance?.close(); - } - } -} -function findBrowserProvider(projectResolver) { - // One of these must be installed in the project to use browser testing - const vitestBuiltinProviders = ['playwright', 'webdriverio']; - for (const providerName of vitestBuiltinProviders) { - try { - projectResolver(providerName); - return providerName; - } - catch { } - } -} -function normalizeBrowserName(browserName) { - // Normalize browser names to match Vitest's expectations for headless but also supports karma's names - // e.g., 'ChromeHeadless' -> 'chrome', 'FirefoxHeadless' - // and 'Chrome' -> 'chrome', 'Firefox' -> 'firefox'. - const normalized = browserName.toLowerCase(); - return normalized.replace(/headless$/, ''); -} -function setupBrowserConfiguration(browsers, debug, projectSourceRoot) { - if (browsers === undefined) { - return {}; - } - const projectResolver = (0, node_module_1.createRequire)(projectSourceRoot + '/').resolve; - let errors; - try { - projectResolver('@vitest/browser'); - } - catch { - errors ??= []; - errors.push('The "browsers" option requires the "@vitest/browser" package to be installed within the project.' + - ' Please install this package and rerun the test command.'); - } - const provider = findBrowserProvider(projectResolver); - if (!provider) { - errors ??= []; - errors.push('The "browsers" option requires either "playwright" or "webdriverio" to be installed within the project.' + - ' Please install one of these packages and rerun the test command.'); - } - // Vitest current requires the playwright browser provider to use the inspect-brk option used by "debug" - if (debug && provider !== 'playwright') { - errors ??= []; - errors.push('Debugging browser mode tests currently requires the use of "playwright".' + - ' Please install this package and rerun the test command.'); - } - if (errors) { - return { errors }; - } - const browser = { - enabled: true, - provider, - headless: browsers.some((name) => name.toLowerCase().includes('headless')), - instances: browsers.map((browserName) => ({ - browser: normalizeBrowserName(browserName), - })), - }; - return { browser }; -} -function generateOutputPath() { - const datePrefix = new Date().toISOString().replaceAll(/[-:.]/g, ''); - const uuidSuffix = (0, node_crypto_1.randomUUID)().slice(0, 8); - return node_path_1.default.join('dist', 'test-out', `${datePrefix}-${uuidSuffix}`); -} -function generateCoverageOption(codeCoverage, workspaceRoot, outputPath) { - if (!codeCoverage) { - return { - enabled: false, - }; - } - return { - enabled: true, - excludeAfterRemap: true, - include: [`${(0, path_1.toPosixPath)(node_path_1.default.relative(workspaceRoot, outputPath))}/**`], - // Special handling for `reporter` due to an undefined value causing upstream failures - ...(codeCoverage.reporters - ? { reporter: codeCoverage.reporters } - : {}), - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/index.d.ts deleted file mode 100755 index 394bdae..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { type Builder } from '@angular-devkit/architect'; -import { type UnitTestBuilderOptions, execute } from './builder'; -export { type UnitTestBuilderOptions, execute }; -declare const builder: Builder; -export default builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/index.js deleted file mode 100755 index f204f9f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.execute = void 0; -const architect_1 = require("@angular-devkit/architect"); -const builder_1 = require("./builder"); -Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return builder_1.execute; } }); -const builder = (0, architect_1.createBuilder)(builder_1.execute); -exports.default = builder; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/karma-bridge.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/karma-bridge.d.ts deleted file mode 100755 index 3f5db3e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/karma-bridge.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; -import { type NormalizedUnitTestBuilderOptions } from './options'; -export declare function useKarmaBuilder(context: BuilderContext, unitTestOptions: NormalizedUnitTestBuilderOptions): Promise>; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/karma-bridge.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/karma-bridge.js deleted file mode 100755 index 93363b5..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/karma-bridge.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.useKarmaBuilder = useKarmaBuilder; -const options_1 = require("./options"); -async function useKarmaBuilder(context, unitTestOptions) { - if (unitTestOptions.debug) { - context.logger.warn('The "karma" test runner does not support the "debug" option. The option will be ignored.'); - } - if (unitTestOptions.setupFiles.length) { - context.logger.warn('The "karma" test runner does not support the "setupFiles" option. The option will be ignored.'); - } - const buildTargetOptions = (await context.validateOptions(await context.getTargetOptions(unitTestOptions.buildTarget), await context.getBuilderNameForTarget(unitTestOptions.buildTarget))); - buildTargetOptions.polyfills = (0, options_1.injectTestingPolyfills)(buildTargetOptions.polyfills); - const options = { - tsConfig: unitTestOptions.tsConfig, - polyfills: buildTargetOptions.polyfills, - assets: buildTargetOptions.assets, - scripts: buildTargetOptions.scripts, - styles: buildTargetOptions.styles, - inlineStyleLanguage: buildTargetOptions.inlineStyleLanguage, - stylePreprocessorOptions: buildTargetOptions.stylePreprocessorOptions, - externalDependencies: buildTargetOptions.externalDependencies, - loader: buildTargetOptions.loader, - define: buildTargetOptions.define, - include: unitTestOptions.include, - exclude: unitTestOptions.exclude, - sourceMap: buildTargetOptions.sourceMap, - progress: buildTargetOptions.progress, - watch: unitTestOptions.watch, - poll: buildTargetOptions.poll, - preserveSymlinks: buildTargetOptions.preserveSymlinks, - browsers: unitTestOptions.browsers?.join(','), - codeCoverage: !!unitTestOptions.codeCoverage, - codeCoverageExclude: unitTestOptions.codeCoverage?.exclude, - fileReplacements: buildTargetOptions.fileReplacements, - reporters: unitTestOptions.reporters, - webWorkerTsConfig: buildTargetOptions.webWorkerTsConfig, - aot: buildTargetOptions.aot, - }; - const { execute } = await Promise.resolve().then(() => __importStar(require('../karma'))); - return execute(options, context); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/options.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/options.d.ts deleted file mode 100755 index e05c400..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/options.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { type BuilderContext } from '@angular-devkit/architect'; -import type { Schema as UnitTestBuilderOptions } from './schema'; -export type NormalizedUnitTestBuilderOptions = Awaited>; -export declare function normalizeOptions(context: BuilderContext, projectName: string, options: UnitTestBuilderOptions): Promise<{ - workspaceRoot: string; - projectRoot: string; - projectSourceRoot: string; - cacheOptions: import("../../utils/normalize-cache").NormalizedCachedOptions; - buildTarget: import("@angular-devkit/architect").Target; - include: string[]; - exclude: string[]; - runnerName: import("./schema").Runner; - codeCoverage: { - exclude: string[] | undefined; - reporters: [string, Record][] | undefined; - } | undefined; - tsConfig: string; - reporters: string[] | undefined; - browsers: string[] | undefined; - watch: boolean; - debug: boolean; - providersFile: string | undefined; - setupFiles: string[]; -}>; -export declare function injectTestingPolyfills(polyfills?: string[]): string[]; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/options.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/options.js deleted file mode 100755 index 6a899f8..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/options.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.normalizeOptions = normalizeOptions; -exports.injectTestingPolyfills = injectTestingPolyfills; -const architect_1 = require("@angular-devkit/architect"); -const node_path_1 = __importDefault(require("node:path")); -const normalize_cache_1 = require("../../utils/normalize-cache"); -const project_metadata_1 = require("../../utils/project-metadata"); -const tty_1 = require("../../utils/tty"); -async function normalizeOptions(context, projectName, options) { - // Setup base paths based on workspace root and project information - const workspaceRoot = context.workspaceRoot; - const projectMetadata = await context.getProjectMetadata(projectName); - const { projectRoot, projectSourceRoot } = (0, project_metadata_1.getProjectRootPaths)(workspaceRoot, projectMetadata); - // Gather persistent caching option and provide a project specific cache location - const cacheOptions = (0, normalize_cache_1.normalizeCacheOptions)(projectMetadata, workspaceRoot); - cacheOptions.path = node_path_1.default.join(cacheOptions.path, projectName); - // Target specifier defaults to the current project's build target using a development configuration - const buildTargetSpecifier = options.buildTarget ?? `::development`; - const buildTarget = (0, architect_1.targetFromTargetString)(buildTargetSpecifier, projectName, 'build'); - const { tsConfig, runner, reporters, browsers } = options; - return { - // Project/workspace information - workspaceRoot, - projectRoot, - projectSourceRoot, - cacheOptions, - // Target/configuration specified options - buildTarget, - include: options.include ?? ['**/*.spec.ts'], - exclude: options.exclude ?? [], - runnerName: runner, - codeCoverage: options.codeCoverage - ? { - exclude: options.codeCoverageExclude, - reporters: options.codeCoverageReporters?.map((entry) => typeof entry === 'string' - ? [entry, {}] - : entry), - } - : undefined, - tsConfig, - reporters, - browsers, - watch: options.watch ?? (0, tty_1.isTTY)(), - debug: options.debug ?? false, - providersFile: options.providersFile && node_path_1.default.join(workspaceRoot, options.providersFile), - setupFiles: options.setupFiles - ? options.setupFiles.map((setupFile) => node_path_1.default.join(workspaceRoot, setupFile)) - : [], - }; -} -function injectTestingPolyfills(polyfills = []) { - return polyfills.includes('zone.js') ? [...polyfills, 'zone.js/testing'] : polyfills; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.d.ts deleted file mode 100755 index 589d25f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Unit testing options for Angular applications. - */ -export type Schema = { - /** - * A list of browsers to use for test execution. If undefined, jsdom on Node.js will be used - * instead of a browser. For Vitest and Karma, browser names ending with 'Headless' (e.g., - * 'ChromeHeadless') will enable headless mode for that browser. - */ - browsers?: string[]; - /** - * A build builder target to serve in the format of `project:target[:configuration]`. You - * can also pass in more than one configuration name as a comma-separated list. Example: - * `project:target:production,staging`. - */ - buildTarget: string; - /** - * Output a code coverage report. - */ - codeCoverage?: boolean; - /** - * Globs to exclude from code coverage. - */ - codeCoverageExclude?: string[]; - /** - * Reporters to use for code coverage results. - */ - codeCoverageReporters?: SchemaCodeCoverageReporter[]; - /** - * Initialize the test runner to support using the Node Inspector for test debugging. - */ - debug?: boolean; - /** - * Globs of files to exclude, relative to the project root. - */ - exclude?: string[]; - /** - * Globs of files to include, relative to project root. - * There are 2 special cases: - * - when a path to directory is provided, all spec files ending ".spec.@(ts|tsx)" will be - * included - * - when a path to a file is provided, and a matching spec file exists it will be included - * instead. - */ - include?: string[]; - /** - * TypeScript file that exports an array of Angular providers to use during test execution. - * The array must be a default export. - */ - providersFile?: string; - /** - * Test runner reporters to use. Directly passed to the test runner. - */ - reporters?: string[]; - /** - * The name of the test runner to use for test execution. - */ - runner: Runner; - /** - * A list of global setup and configuration files that are included before the test files. - * The application's polyfills are always included before these files. The Angular Testbed - * is also initialized prior to the execution of these files. - */ - setupFiles?: string[]; - /** - * The name of the TypeScript configuration file. - */ - tsConfig: string; - /** - * Re-run tests when source files change. Defaults to `true` in TTY environments and `false` - * otherwise. - */ - watch?: boolean; -}; -export type SchemaCodeCoverageReporter = CodeCoverageReporterCodeCoverageReporter[] | CoverageReporters; -export type CodeCoverageReporterCodeCoverageReporter = CoverageReporters | { - [key: string]: any; -}; -export declare enum CoverageReporters { - Cobertura = "cobertura", - Html = "html", - Json = "json", - JsonSummary = "json-summary", - Lcov = "lcov", - Lcovonly = "lcovonly", - Text = "text", - TextSummary = "text-summary" -} -/** - * The name of the test runner to use for test execution. - */ -export declare enum Runner { - Karma = "karma", - Vitest = "vitest" -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.js deleted file mode 100755 index 38ce0fc..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE -// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Runner = exports.CoverageReporters = void 0; -var CoverageReporters; -(function (CoverageReporters) { - CoverageReporters["Cobertura"] = "cobertura"; - CoverageReporters["Html"] = "html"; - CoverageReporters["Json"] = "json"; - CoverageReporters["JsonSummary"] = "json-summary"; - CoverageReporters["Lcov"] = "lcov"; - CoverageReporters["Lcovonly"] = "lcovonly"; - CoverageReporters["Text"] = "text"; - CoverageReporters["TextSummary"] = "text-summary"; -})(CoverageReporters || (exports.CoverageReporters = CoverageReporters = {})); -/** - * The name of the test runner to use for test execution. - */ -var Runner; -(function (Runner) { - Runner["Karma"] = "karma"; - Runner["Vitest"] = "vitest"; -})(Runner || (exports.Runner = Runner = {})); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.json b/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.json deleted file mode 100755 index 8628bb9..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/builders/unit-test/schema.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "title": "Unit testing", - "description": "Unit testing options for Angular applications.", - "type": "object", - "properties": { - "buildTarget": { - "type": "string", - "description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.", - "pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$" - }, - "tsConfig": { - "type": "string", - "description": "The name of the TypeScript configuration file." - }, - "runner": { - "type": "string", - "description": "The name of the test runner to use for test execution.", - "enum": ["karma", "vitest"] - }, - "browsers": { - "description": "A list of browsers to use for test execution. If undefined, jsdom on Node.js will be used instead of a browser. For Vitest and Karma, browser names ending with 'Headless' (e.g., 'ChromeHeadless') will enable headless mode for that browser.", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - }, - "include": { - "type": "array", - "items": { - "type": "string" - }, - "default": ["**/*.spec.ts"], - "description": "Globs of files to include, relative to project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead." - }, - "exclude": { - "type": "array", - "items": { - "type": "string" - }, - "default": [], - "description": "Globs of files to exclude, relative to the project root." - }, - "watch": { - "type": "boolean", - "description": "Re-run tests when source files change. Defaults to `true` in TTY environments and `false` otherwise." - }, - "debug": { - "type": "boolean", - "description": "Initialize the test runner to support using the Node Inspector for test debugging.", - "default": false - }, - "codeCoverage": { - "type": "boolean", - "description": "Output a code coverage report.", - "default": false - }, - "codeCoverageExclude": { - "type": "array", - "description": "Globs to exclude from code coverage.", - "items": { - "type": "string" - }, - "default": [] - }, - "codeCoverageReporters": { - "type": "array", - "description": "Reporters to use for code coverage results.", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/coverage-reporters" - }, - { - "type": "array", - "minItems": 1, - "maxItems": 2, - "items": [ - { - "$ref": "#/definitions/coverage-reporters" - }, - { - "type": "object" - } - ] - } - ] - } - }, - "reporters": { - "type": "array", - "description": "Test runner reporters to use. Directly passed to the test runner.", - "items": { - "type": "string" - } - }, - "providersFile": { - "type": "string", - "description": "TypeScript file that exports an array of Angular providers to use during test execution. The array must be a default export.", - "minLength": 1 - }, - "setupFiles": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of global setup and configuration files that are included before the test files. The application's polyfills are always included before these files. The Angular Testbed is also initialized prior to the execution of these files." - } - }, - "additionalProperties": false, - "required": ["buildTarget", "tsConfig", "runner"], - "definitions": { - "coverage-reporters": { - "enum": [ - "html", - "lcov", - "lcovonly", - "text", - "text-summary", - "cobertura", - "json", - "json-summary" - ] - } - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/index.d.ts deleted file mode 100755 index a870c60..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export { buildApplication, type ApplicationBuilderOptions } from './builders/application'; -export type { ApplicationBuilderExtensions } from './builders/application/options'; -export { type BuildOutputFile, BuildOutputFileType } from './tools/esbuild/bundler-context'; -export type { BuildOutputAsset } from './tools/esbuild/bundler-execution-result'; -export { executeDevServerBuilder, type DevServerBuilderOptions, type DevServerBuilderOutput, } from './builders/dev-server'; -export { execute as executeExtractI18nBuilder, type ExtractI18nBuilderOptions, } from './builders/extract-i18n'; -export { execute as executeNgPackagrBuilder, type NgPackagrBuilderOptions, } from './builders/ng-packagr'; -export { execute as executeUnitTestBuilder, type UnitTestBuilderOptions, } from './builders/unit-test'; -export { execute as executeKarmaBuilder, type KarmaBuilderOptions } from './builders/karma'; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/index.js deleted file mode 100755 index 9ce38f8..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/index.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.executeKarmaBuilder = exports.executeUnitTestBuilder = exports.executeNgPackagrBuilder = exports.executeExtractI18nBuilder = exports.executeDevServerBuilder = exports.BuildOutputFileType = exports.buildApplication = void 0; -var application_1 = require("./builders/application"); -Object.defineProperty(exports, "buildApplication", { enumerable: true, get: function () { return application_1.buildApplication; } }); -var bundler_context_1 = require("./tools/esbuild/bundler-context"); -Object.defineProperty(exports, "BuildOutputFileType", { enumerable: true, get: function () { return bundler_context_1.BuildOutputFileType; } }); -var dev_server_1 = require("./builders/dev-server"); -Object.defineProperty(exports, "executeDevServerBuilder", { enumerable: true, get: function () { return dev_server_1.executeDevServerBuilder; } }); -var extract_i18n_1 = require("./builders/extract-i18n"); -Object.defineProperty(exports, "executeExtractI18nBuilder", { enumerable: true, get: function () { return extract_i18n_1.execute; } }); -var ng_packagr_1 = require("./builders/ng-packagr"); -Object.defineProperty(exports, "executeNgPackagrBuilder", { enumerable: true, get: function () { return ng_packagr_1.execute; } }); -var unit_test_1 = require("./builders/unit-test"); -Object.defineProperty(exports, "executeUnitTestBuilder", { enumerable: true, get: function () { return unit_test_1.execute; } }); -var karma_1 = require("./builders/karma"); -Object.defineProperty(exports, "executeKarmaBuilder", { enumerable: true, get: function () { return karma_1.execute; } }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/private.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/private.d.ts deleted file mode 100755 index c58594e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/private.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -/** - * @fileoverview - * Private exports intended only for use with the @angular-devkit/build-angular package. - * All exports are not supported for external use, do not provide SemVer guarantees, and - * their existence may change in any future version. - */ -import { createAngularCompilation } from './tools/angular/compilation'; -import { CompilerPluginOptions } from './tools/esbuild/angular/compiler-plugin'; -import { BundleStylesheetOptions } from './tools/esbuild/stylesheets/bundle-options'; -export { buildApplicationInternal } from './builders/application'; -export type { ApplicationBuilderInternalOptions } from './builders/application/options'; -export { type Result, type ResultFile, ResultKind } from './builders/application/results'; -export { serveWithVite } from './builders/dev-server/vite-server'; -export * from './tools/babel/plugins'; -export type { ExternalResultMetadata } from './tools/esbuild/bundler-execution-result'; -export { emitFilesToDisk } from './tools/esbuild/utils'; -export { transformSupportedBrowsersToTargets } from './tools/esbuild/utils'; -export { SassWorkerImplementation } from './tools/sass/sass-service'; -export { SourceFileCache } from './tools/esbuild/angular/source-file-cache'; -export { createJitResourceTransformer } from './tools/angular/transformers/jit-resource-transformer'; -export { JavaScriptTransformer } from './tools/esbuild/javascript-transformer'; -export declare function createCompilerPlugin(pluginOptions: CompilerPluginOptions & { - browserOnlyBuild?: boolean; - noopTypeScriptCompilation?: boolean; -}, styleOptions: BundleStylesheetOptions & { - inlineStyleLanguage: string; -}): import('esbuild').Plugin; -export type { AngularCompilation } from './tools/angular/compilation'; -export { createAngularCompilation }; -export { ComponentStylesheetBundler } from './tools/esbuild/angular/component-stylesheets'; -export * from './utils/bundle-calculator'; -export { checkPort } from './utils/check-port'; -export { deleteOutputDir } from './utils/delete-output-dir'; -export { type I18nOptions, createI18nOptions, loadTranslations } from './utils/i18n-options'; -export { IndexHtmlGenerator, type IndexHtmlGeneratorOptions, type IndexHtmlGeneratorProcessOptions, type IndexHtmlTransform, } from './utils/index-file/index-html-generator'; -export type { FileInfo } from './utils/index-file/augment-index-html'; -export { type InlineCriticalCssProcessOptions, InlineCriticalCssProcessor, type InlineCriticalCssProcessorOptions, } from './utils/index-file/inline-critical-css'; -export { loadProxyConfiguration } from './utils/load-proxy-config'; -export { type TranslationLoader, createTranslationLoader } from './utils/load-translations'; -export { purgeStaleBuildCache } from './utils/purge-cache'; -export { augmentAppWithServiceWorker } from './utils/service-worker'; -export { type BundleStats, generateBuildStatsTable } from './utils/stats-table'; -export { getSupportedBrowsers } from './utils/supported-browsers'; -export { assertCompatibleAngularVersion } from './utils/version'; -export { findTests, getTestEntrypoints } from './builders/karma/find-tests'; -export { findTailwindConfiguration, generateSearchDirectories, loadPostcssConfiguration, } from './utils/postcss-configuration'; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/private.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/private.js deleted file mode 100755 index 4126633..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/private.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.loadPostcssConfiguration = exports.generateSearchDirectories = exports.findTailwindConfiguration = exports.getTestEntrypoints = exports.findTests = exports.assertCompatibleAngularVersion = exports.getSupportedBrowsers = exports.generateBuildStatsTable = exports.augmentAppWithServiceWorker = exports.purgeStaleBuildCache = exports.createTranslationLoader = exports.loadProxyConfiguration = exports.InlineCriticalCssProcessor = exports.IndexHtmlGenerator = exports.loadTranslations = exports.createI18nOptions = exports.deleteOutputDir = exports.checkPort = exports.ComponentStylesheetBundler = exports.createAngularCompilation = exports.JavaScriptTransformer = exports.createJitResourceTransformer = exports.SourceFileCache = exports.SassWorkerImplementation = exports.transformSupportedBrowsersToTargets = exports.emitFilesToDisk = exports.serveWithVite = exports.ResultKind = exports.buildApplicationInternal = void 0; -exports.createCompilerPlugin = createCompilerPlugin; -/** - * @fileoverview - * Private exports intended only for use with the @angular-devkit/build-angular package. - * All exports are not supported for external use, do not provide SemVer guarantees, and - * their existence may change in any future version. - */ -const compilation_1 = require("./tools/angular/compilation"); -Object.defineProperty(exports, "createAngularCompilation", { enumerable: true, get: function () { return compilation_1.createAngularCompilation; } }); -const compiler_plugin_1 = require("./tools/esbuild/angular/compiler-plugin"); -const component_stylesheets_1 = require("./tools/esbuild/angular/component-stylesheets"); -// Builders -var application_1 = require("./builders/application"); -Object.defineProperty(exports, "buildApplicationInternal", { enumerable: true, get: function () { return application_1.buildApplicationInternal; } }); -var results_1 = require("./builders/application/results"); -Object.defineProperty(exports, "ResultKind", { enumerable: true, get: function () { return results_1.ResultKind; } }); -var vite_server_1 = require("./builders/dev-server/vite-server"); -Object.defineProperty(exports, "serveWithVite", { enumerable: true, get: function () { return vite_server_1.serveWithVite; } }); -// Tools -__exportStar(require("./tools/babel/plugins"), exports); -var utils_1 = require("./tools/esbuild/utils"); -Object.defineProperty(exports, "emitFilesToDisk", { enumerable: true, get: function () { return utils_1.emitFilesToDisk; } }); -var utils_2 = require("./tools/esbuild/utils"); -Object.defineProperty(exports, "transformSupportedBrowsersToTargets", { enumerable: true, get: function () { return utils_2.transformSupportedBrowsersToTargets; } }); -var sass_service_1 = require("./tools/sass/sass-service"); -Object.defineProperty(exports, "SassWorkerImplementation", { enumerable: true, get: function () { return sass_service_1.SassWorkerImplementation; } }); -var source_file_cache_1 = require("./tools/esbuild/angular/source-file-cache"); -Object.defineProperty(exports, "SourceFileCache", { enumerable: true, get: function () { return source_file_cache_1.SourceFileCache; } }); -var jit_resource_transformer_1 = require("./tools/angular/transformers/jit-resource-transformer"); -Object.defineProperty(exports, "createJitResourceTransformer", { enumerable: true, get: function () { return jit_resource_transformer_1.createJitResourceTransformer; } }); -var javascript_transformer_1 = require("./tools/esbuild/javascript-transformer"); -Object.defineProperty(exports, "JavaScriptTransformer", { enumerable: true, get: function () { return javascript_transformer_1.JavaScriptTransformer; } }); -function createCompilerPlugin(pluginOptions, styleOptions) { - return (0, compiler_plugin_1.createCompilerPlugin)(pluginOptions, pluginOptions.noopTypeScriptCompilation - ? new compilation_1.NoopCompilation() - : () => (0, compilation_1.createAngularCompilation)(!!pluginOptions.jit, !!pluginOptions.browserOnlyBuild), new component_stylesheets_1.ComponentStylesheetBundler(styleOptions, styleOptions.inlineStyleLanguage, pluginOptions.incremental)); -} -var component_stylesheets_2 = require("./tools/esbuild/angular/component-stylesheets"); -Object.defineProperty(exports, "ComponentStylesheetBundler", { enumerable: true, get: function () { return component_stylesheets_2.ComponentStylesheetBundler; } }); -// Utilities -__exportStar(require("./utils/bundle-calculator"), exports); -var check_port_1 = require("./utils/check-port"); -Object.defineProperty(exports, "checkPort", { enumerable: true, get: function () { return check_port_1.checkPort; } }); -var delete_output_dir_1 = require("./utils/delete-output-dir"); -Object.defineProperty(exports, "deleteOutputDir", { enumerable: true, get: function () { return delete_output_dir_1.deleteOutputDir; } }); -var i18n_options_1 = require("./utils/i18n-options"); -Object.defineProperty(exports, "createI18nOptions", { enumerable: true, get: function () { return i18n_options_1.createI18nOptions; } }); -Object.defineProperty(exports, "loadTranslations", { enumerable: true, get: function () { return i18n_options_1.loadTranslations; } }); -var index_html_generator_1 = require("./utils/index-file/index-html-generator"); -Object.defineProperty(exports, "IndexHtmlGenerator", { enumerable: true, get: function () { return index_html_generator_1.IndexHtmlGenerator; } }); -var inline_critical_css_1 = require("./utils/index-file/inline-critical-css"); -Object.defineProperty(exports, "InlineCriticalCssProcessor", { enumerable: true, get: function () { return inline_critical_css_1.InlineCriticalCssProcessor; } }); -var load_proxy_config_1 = require("./utils/load-proxy-config"); -Object.defineProperty(exports, "loadProxyConfiguration", { enumerable: true, get: function () { return load_proxy_config_1.loadProxyConfiguration; } }); -var load_translations_1 = require("./utils/load-translations"); -Object.defineProperty(exports, "createTranslationLoader", { enumerable: true, get: function () { return load_translations_1.createTranslationLoader; } }); -var purge_cache_1 = require("./utils/purge-cache"); -Object.defineProperty(exports, "purgeStaleBuildCache", { enumerable: true, get: function () { return purge_cache_1.purgeStaleBuildCache; } }); -var service_worker_1 = require("./utils/service-worker"); -Object.defineProperty(exports, "augmentAppWithServiceWorker", { enumerable: true, get: function () { return service_worker_1.augmentAppWithServiceWorker; } }); -var stats_table_1 = require("./utils/stats-table"); -Object.defineProperty(exports, "generateBuildStatsTable", { enumerable: true, get: function () { return stats_table_1.generateBuildStatsTable; } }); -var supported_browsers_1 = require("./utils/supported-browsers"); -Object.defineProperty(exports, "getSupportedBrowsers", { enumerable: true, get: function () { return supported_browsers_1.getSupportedBrowsers; } }); -var version_1 = require("./utils/version"); -Object.defineProperty(exports, "assertCompatibleAngularVersion", { enumerable: true, get: function () { return version_1.assertCompatibleAngularVersion; } }); -var find_tests_1 = require("./builders/karma/find-tests"); -Object.defineProperty(exports, "findTests", { enumerable: true, get: function () { return find_tests_1.findTests; } }); -Object.defineProperty(exports, "getTestEntrypoints", { enumerable: true, get: function () { return find_tests_1.getTestEntrypoints; } }); -var postcss_configuration_1 = require("./utils/postcss-configuration"); -Object.defineProperty(exports, "findTailwindConfiguration", { enumerable: true, get: function () { return postcss_configuration_1.findTailwindConfiguration; } }); -Object.defineProperty(exports, "generateSearchDirectories", { enumerable: true, get: function () { return postcss_configuration_1.generateSearchDirectories; } }); -Object.defineProperty(exports, "loadPostcssConfiguration", { enumerable: true, get: function () { return postcss_configuration_1.loadPostcssConfiguration; } }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/angular-host.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/angular-host.d.ts deleted file mode 100755 index cd2b588..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/angular-host.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type ng from '@angular/compiler-cli'; -import type ts from 'typescript'; -export type AngularCompilerOptions = ng.CompilerOptions; -export type AngularCompilerHost = ng.CompilerHost; -export interface AngularHostOptions { - fileReplacements?: Record; - sourceFileCache?: Map; - modifiedFiles?: Set; - externalStylesheets?: Map; - transformStylesheet(data: string, containingFile: string, stylesheetFile?: string, order?: number, className?: string): Promise; - processWebWorker(workerFile: string, containingFile: string): string; -} -/** - * Patches in-place the `getSourceFiles` function on an instance of a TypeScript - * `Program` to ensure that all returned SourceFile instances have a `version` - * field. The `version` field is required when used with a TypeScript BuilderProgram. - * @param program The TypeScript Program instance to patch. - */ -export declare function ensureSourceFileVersions(program: ts.Program): void; -export declare function createAngularCompilerHost(typescript: typeof ts, compilerOptions: AngularCompilerOptions, hostOptions: AngularHostOptions, packageJsonCache: ts.PackageJsonInfoCache | undefined): AngularCompilerHost; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/angular-host.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/angular-host.js deleted file mode 100755 index 4a47a9c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/angular-host.js +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ensureSourceFileVersions = ensureSourceFileVersions; -exports.createAngularCompilerHost = createAngularCompilerHost; -const node_assert_1 = __importDefault(require("node:assert")); -const node_crypto_1 = require("node:crypto"); -const node_path_1 = __importDefault(require("node:path")); -/** - * Patches in-place the `getSourceFiles` function on an instance of a TypeScript - * `Program` to ensure that all returned SourceFile instances have a `version` - * field. The `version` field is required when used with a TypeScript BuilderProgram. - * @param program The TypeScript Program instance to patch. - */ -function ensureSourceFileVersions(program) { - const baseGetSourceFiles = program.getSourceFiles; - // TODO: Update Angular compiler to add versions to all internal files and remove this - program.getSourceFiles = function (...parameters) { - const files = baseGetSourceFiles(...parameters); - for (const file of files) { - if (file.version === undefined) { - file.version = (0, node_crypto_1.createHash)('sha256').update(file.text).digest('hex'); - } - } - return files; - }; -} -function augmentHostWithCaching(host, cache) { - const baseGetSourceFile = host.getSourceFile; - host.getSourceFile = function (fileName, languageVersion, onError, shouldCreateNewSourceFile, ...parameters) { - if (!shouldCreateNewSourceFile && cache.has(fileName)) { - return cache.get(fileName); - } - const file = baseGetSourceFile.call(host, fileName, languageVersion, onError, true, ...parameters); - if (file) { - cache.set(fileName, file); - } - return file; - }; -} -function augmentResolveModuleNames(typescript, host, resolvedModuleModifier, moduleResolutionCache) { - if (host.resolveModuleNames) { - const baseResolveModuleNames = host.resolveModuleNames; - host.resolveModuleNames = function (moduleNames, ...parameters) { - return moduleNames.map((name) => { - const result = baseResolveModuleNames.call(host, [name], ...parameters); - return resolvedModuleModifier(result[0], name); - }); - }; - } - else { - host.resolveModuleNames = function (moduleNames, containingFile, _reusedNames, redirectedReference, options) { - return moduleNames.map((name) => { - const result = typescript.resolveModuleName(name, containingFile, options, host, moduleResolutionCache, redirectedReference).resolvedModule; - return resolvedModuleModifier(result, name); - }); - }; - } -} -function normalizePath(path) { - return node_path_1.default.win32.normalize(path).replace(/\\/g, node_path_1.default.posix.sep); -} -function augmentHostWithReplacements(typescript, host, replacements, moduleResolutionCache) { - if (Object.keys(replacements).length === 0) { - return; - } - const normalizedReplacements = {}; - for (const [key, value] of Object.entries(replacements)) { - normalizedReplacements[normalizePath(key)] = normalizePath(value); - } - const tryReplace = (resolvedModule) => { - const replacement = resolvedModule && normalizedReplacements[resolvedModule.resolvedFileName]; - if (replacement) { - return { - resolvedFileName: replacement, - isExternalLibraryImport: /[/\\]node_modules[/\\]/.test(replacement), - }; - } - else { - return resolvedModule; - } - }; - augmentResolveModuleNames(typescript, host, tryReplace, moduleResolutionCache); -} -function createAngularCompilerHost(typescript, compilerOptions, hostOptions, packageJsonCache) { - // Create TypeScript compiler host - const host = typescript.createIncrementalCompilerHost(compilerOptions); - // Set the parsing mode to the same as TS 5.3+ default for tsc. This provides a parse - // performance improvement by skipping non-type related JSDoc parsing. - host.jsDocParsingMode = typescript.JSDocParsingMode.ParseForTypeErrors; - // The AOT compiler currently requires this hook to allow for a transformResource hook. - // Once the AOT compiler allows only a transformResource hook, this can be reevaluated. - host.readResource = async function (filename) { - return this.readFile(filename) ?? ''; - }; - // Add an AOT compiler resource transform hook - host.transformResource = async function (data, context) { - // Only style resources are transformed currently - if (context.type !== 'style') { - return null; - } - (0, node_assert_1.default)(!context.resourceFile || !hostOptions.externalStylesheets?.has(context.resourceFile), 'External runtime stylesheets should not be transformed: ' + context.resourceFile); - // No transformation required if the resource is empty - if (data.trim().length === 0) { - return { content: '' }; - } - const result = await hostOptions.transformStylesheet(data, context.containingFile, context.resourceFile ?? undefined, context.order, context.className); - return typeof result === 'string' ? { content: result } : null; - }; - host.resourceNameToFileName = function (resourceName, containingFile) { - const resolvedPath = node_path_1.default.join(node_path_1.default.dirname(containingFile), resourceName); - if (!this.fileExists(resolvedPath)) { - return null; - } - // All resource names that have template file extensions are assumed to be templates - // TODO: Update compiler to provide the resource type to avoid extension matching here. - if (!hostOptions.externalStylesheets || hasTemplateExtension(resolvedPath)) { - return resolvedPath; - } - // For external stylesheets, create a unique identifier and store the mapping - let externalId = hostOptions.externalStylesheets.get(resolvedPath); - if (externalId === undefined) { - externalId = (0, node_crypto_1.createHash)('sha256').update(resolvedPath).digest('hex'); - hostOptions.externalStylesheets.set(resolvedPath, externalId); - } - return externalId + '.css'; - }; - // Allow the AOT compiler to request the set of changed templates and styles - host.getModifiedResourceFiles = function () { - return hostOptions.modifiedFiles; - }; - // Provide a resolution cache to ensure package.json lookups are cached - const resolutionCache = typescript.createModuleResolutionCache(host.getCurrentDirectory(), host.getCanonicalFileName.bind(host), compilerOptions, packageJsonCache); - host.getModuleResolutionCache = () => resolutionCache; - // Augment TypeScript Host for file replacements option - if (hostOptions.fileReplacements) { - augmentHostWithReplacements(typescript, host, hostOptions.fileReplacements, resolutionCache); - } - // Augment TypeScript Host with source file caching if provided - if (hostOptions.sourceFileCache) { - augmentHostWithCaching(host, hostOptions.sourceFileCache); - } - return host; -} -function hasTemplateExtension(file) { - const extension = node_path_1.default.extname(file).toLowerCase(); - switch (extension) { - case '.htm': - case '.html': - case '.svg': - return true; - } - return false; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/angular-compilation.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/angular-compilation.d.ts deleted file mode 100755 index c1f4e20..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/angular-compilation.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type ng from '@angular/compiler-cli'; -import type { PartialMessage } from 'esbuild'; -import type ts from 'typescript'; -import type { AngularHostOptions } from '../angular-host'; -export interface EmitFileResult { - filename: string; - contents: string; - dependencies?: readonly string[]; -} -export declare enum DiagnosticModes { - None = 0, - Option = 1, - Syntactic = 2, - Semantic = 4, - All = 7 -} -export declare abstract class AngularCompilation { - #private; - static loadCompilerCli(): Promise; - static loadTypescript(): Promise; - protected loadConfiguration(tsconfig: string): Promise; - abstract initialize(tsconfig: string, hostOptions: AngularHostOptions, compilerOptionsTransformer?: (compilerOptions: ng.CompilerOptions) => ng.CompilerOptions): Promise<{ - affectedFiles: ReadonlySet; - compilerOptions: ng.CompilerOptions; - referencedFiles: readonly string[]; - externalStylesheets?: ReadonlyMap; - templateUpdates?: ReadonlyMap; - }>; - abstract emitAffectedFiles(): Iterable | Promise>; - protected abstract collectDiagnostics(modes: DiagnosticModes): Iterable | Promise>; - diagnoseFiles(modes?: DiagnosticModes): Promise<{ - errors?: PartialMessage[]; - warnings?: PartialMessage[]; - }>; - update?(files: Set): Promise; - close?(): Promise; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/angular-compilation.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/angular-compilation.js deleted file mode 100755 index 53168ea..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/angular-compilation.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AngularCompilation = exports.DiagnosticModes = void 0; -const load_esm_1 = require("../../../utils/load-esm"); -const diagnostics_1 = require("../../esbuild/angular/diagnostics"); -const profiling_1 = require("../../esbuild/profiling"); -var DiagnosticModes; -(function (DiagnosticModes) { - DiagnosticModes[DiagnosticModes["None"] = 0] = "None"; - DiagnosticModes[DiagnosticModes["Option"] = 1] = "Option"; - DiagnosticModes[DiagnosticModes["Syntactic"] = 2] = "Syntactic"; - DiagnosticModes[DiagnosticModes["Semantic"] = 4] = "Semantic"; - DiagnosticModes[DiagnosticModes["All"] = 7] = "All"; -})(DiagnosticModes || (exports.DiagnosticModes = DiagnosticModes = {})); -class AngularCompilation { - static #angularCompilerCliModule; - static #typescriptModule; - static async loadCompilerCli() { - // This uses a wrapped dynamic import to load `@angular/compiler-cli` which is ESM. - // Once TypeScript provides support for retaining dynamic imports this workaround can be dropped. - AngularCompilation.#angularCompilerCliModule ??= - await (0, load_esm_1.loadEsmModule)('@angular/compiler-cli'); - return AngularCompilation.#angularCompilerCliModule; - } - static async loadTypescript() { - AngularCompilation.#typescriptModule ??= await Promise.resolve().then(() => __importStar(require('typescript'))); - return AngularCompilation.#typescriptModule; - } - async loadConfiguration(tsconfig) { - const { readConfiguration } = await AngularCompilation.loadCompilerCli(); - return (0, profiling_1.profileSync)('NG_READ_CONFIG', () => readConfiguration(tsconfig, { - // Angular specific configuration defaults and overrides to ensure a functioning compilation. - suppressOutputPathCheck: true, - outDir: undefined, - sourceMap: false, - declaration: false, - declarationMap: false, - allowEmptyCodegenFiles: false, - annotationsAs: 'decorators', - enableResourceInlining: false, - supportTestBed: false, - supportJitMode: false, - // Disable removing of comments as TS is quite aggressive with these and can - // remove important annotations, such as /* @__PURE__ */ and comments like /* vite-ignore */. - removeComments: false, - })); - } - async diagnoseFiles(modes = DiagnosticModes.All) { - const result = {}; - // Avoid loading typescript until actually needed. - // This allows for avoiding the load of typescript in the main thread when using the parallel compilation. - const typescript = await AngularCompilation.loadTypescript(); - await (0, profiling_1.profileAsync)('NG_DIAGNOSTICS_TOTAL', async () => { - for (const diagnostic of await this.collectDiagnostics(modes)) { - const message = (0, diagnostics_1.convertTypeScriptDiagnostic)(typescript, diagnostic); - if (diagnostic.category === typescript.DiagnosticCategory.Error) { - (result.errors ??= []).push(message); - } - else { - (result.warnings ??= []).push(message); - } - } - }); - return result; - } -} -exports.AngularCompilation = AngularCompilation; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/aot-compilation.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/aot-compilation.d.ts deleted file mode 100755 index 0e8a622..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/aot-compilation.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type ng from '@angular/compiler-cli'; -import ts from 'typescript'; -import { AngularHostOptions } from '../angular-host'; -import { AngularCompilation, DiagnosticModes, EmitFileResult } from './angular-compilation'; -export declare class AotCompilation extends AngularCompilation { - #private; - private readonly browserOnlyBuild; - constructor(browserOnlyBuild: boolean); - initialize(tsconfig: string, hostOptions: AngularHostOptions, compilerOptionsTransformer?: (compilerOptions: ng.CompilerOptions) => ng.CompilerOptions): Promise<{ - affectedFiles: ReadonlySet; - compilerOptions: ng.CompilerOptions; - referencedFiles: readonly string[]; - externalStylesheets?: ReadonlyMap; - templateUpdates?: ReadonlyMap; - }>; - collectDiagnostics(modes: DiagnosticModes): Iterable; - emitAffectedFiles(): Iterable; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/aot-compilation.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/aot-compilation.js deleted file mode 100755 index 5d491a9..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/aot-compilation.js +++ /dev/null @@ -1,337 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AotCompilation = void 0; -const node_assert_1 = __importDefault(require("node:assert")); -const node_path_1 = require("node:path"); -const typescript_1 = __importDefault(require("typescript")); -const profiling_1 = require("../../esbuild/profiling"); -const angular_host_1 = require("../angular-host"); -const jit_bootstrap_transformer_1 = require("../transformers/jit-bootstrap-transformer"); -const lazy_routes_transformer_1 = require("../transformers/lazy-routes-transformer"); -const web_worker_transformer_1 = require("../transformers/web-worker-transformer"); -const angular_compilation_1 = require("./angular-compilation"); -const hmr_candidates_1 = require("./hmr-candidates"); -/** - * The modified files count limit for performing component HMR analysis. - * Performing content analysis for a large amount of files can result in longer rebuild times - * than a full rebuild would entail. - */ -const HMR_MODIFIED_FILE_LIMIT = 32; -class AngularCompilationState { - angularProgram; - compilerHost; - typeScriptProgram; - affectedFiles; - templateDiagnosticsOptimization; - webWorkerTransform; - diagnosticCache; - constructor(angularProgram, compilerHost, typeScriptProgram, affectedFiles, templateDiagnosticsOptimization, webWorkerTransform, diagnosticCache = new WeakMap()) { - this.angularProgram = angularProgram; - this.compilerHost = compilerHost; - this.typeScriptProgram = typeScriptProgram; - this.affectedFiles = affectedFiles; - this.templateDiagnosticsOptimization = templateDiagnosticsOptimization; - this.webWorkerTransform = webWorkerTransform; - this.diagnosticCache = diagnosticCache; - } - get angularCompiler() { - return this.angularProgram.compiler; - } -} -class AotCompilation extends angular_compilation_1.AngularCompilation { - browserOnlyBuild; - #state; - constructor(browserOnlyBuild) { - super(); - this.browserOnlyBuild = browserOnlyBuild; - } - async initialize(tsconfig, hostOptions, compilerOptionsTransformer) { - // Dynamically load the Angular compiler CLI package - const { NgtscProgram, OptimizeFor } = await angular_compilation_1.AngularCompilation.loadCompilerCli(); - // Load the compiler configuration and transform as needed - const { options: originalCompilerOptions, rootNames, errors: configurationDiagnostics, } = await this.loadConfiguration(tsconfig); - const compilerOptions = compilerOptionsTransformer?.(originalCompilerOptions) ?? originalCompilerOptions; - if (compilerOptions.externalRuntimeStyles) { - hostOptions.externalStylesheets ??= new Map(); - } - // Reuse the package.json cache from the previous compilation - const packageJsonCache = this.#state?.compilerHost - .getModuleResolutionCache?.() - ?.getPackageJsonInfoCache(); - const useHmr = compilerOptions['_enableHmr'] && - hostOptions.modifiedFiles && - hostOptions.modifiedFiles.size <= HMR_MODIFIED_FILE_LIMIT; - let staleSourceFiles; - let clearPackageJsonCache = false; - if (hostOptions.modifiedFiles && this.#state) { - for (const modifiedFile of hostOptions.modifiedFiles) { - // Clear package.json cache if a node modules file was modified - if (!clearPackageJsonCache && modifiedFile.includes('node_modules')) { - clearPackageJsonCache = true; - packageJsonCache?.clear(); - } - // Collect stale source files for HMR analysis of inline component resources - if (useHmr) { - const sourceFile = this.#state.typeScriptProgram.getSourceFile(modifiedFile); - if (sourceFile) { - staleSourceFiles ??= new Map(); - staleSourceFiles.set(modifiedFile, sourceFile); - } - } - } - } - // Create Angular compiler host - const host = (0, angular_host_1.createAngularCompilerHost)(typescript_1.default, compilerOptions, hostOptions, packageJsonCache); - // Create the Angular specific program that contains the Angular compiler - const angularProgram = (0, profiling_1.profileSync)('NG_CREATE_PROGRAM', () => new NgtscProgram(rootNames, compilerOptions, host, this.#state?.angularProgram)); - const angularCompiler = angularProgram.compiler; - const angularTypeScriptProgram = angularProgram.getTsProgram(); - (0, angular_host_1.ensureSourceFileVersions)(angularTypeScriptProgram); - let oldProgram = this.#state?.typeScriptProgram; - let usingBuildInfo = false; - if (!oldProgram) { - oldProgram = typescript_1.default.readBuilderProgram(compilerOptions, host); - usingBuildInfo = !!oldProgram; - } - const typeScriptProgram = typescript_1.default.createEmitAndSemanticDiagnosticsBuilderProgram(angularTypeScriptProgram, host, oldProgram, configurationDiagnostics); - await (0, profiling_1.profileAsync)('NG_ANALYZE_PROGRAM', () => angularCompiler.analyzeAsync()); - let templateUpdates; - if (useHmr && hostOptions.modifiedFiles && this.#state) { - const componentNodes = (0, hmr_candidates_1.collectHmrCandidates)(hostOptions.modifiedFiles, angularProgram, staleSourceFiles); - for (const node of componentNodes) { - if (!typescript_1.default.isClassDeclaration(node)) { - continue; - } - const componentFilename = node.getSourceFile().fileName; - let relativePath = (0, node_path_1.relative)(host.getCurrentDirectory(), componentFilename); - if (relativePath.startsWith('..')) { - relativePath = componentFilename; - } - relativePath = relativePath.replaceAll('\\', '/'); - const updateId = encodeURIComponent(`${host.getCanonicalFileName(relativePath)}@${node.name?.text}`); - const updateText = angularCompiler.emitHmrUpdateModule(node); - // If compiler cannot generate an update for the component, prevent template updates. - if (updateText === null) { - // Build is needed if a template cannot be updated - templateUpdates = undefined; - break; - } - templateUpdates ??= new Map(); - templateUpdates.set(updateId, updateText); - } - } - const affectedFiles = (0, profiling_1.profileSync)('NG_FIND_AFFECTED', () => findAffectedFiles(typeScriptProgram, angularCompiler, usingBuildInfo)); - // Get all files referenced in the TypeScript/Angular program including component resources - const referencedFiles = typeScriptProgram - .getSourceFiles() - .filter((sourceFile) => !angularCompiler.ignoreForEmit.has(sourceFile)) - .flatMap((sourceFile) => { - const resourceDependencies = angularCompiler.getResourceDependencies(sourceFile); - // Also invalidate Angular diagnostics for a source file if component resources are modified - if (this.#state && hostOptions.modifiedFiles?.size) { - for (const resourceDependency of resourceDependencies) { - if (hostOptions.modifiedFiles.has(resourceDependency)) { - this.#state.diagnosticCache.delete(sourceFile); - // Also mark as affected in case changed template affects diagnostics - affectedFiles.add(sourceFile); - } - } - } - return [sourceFile.fileName, ...resourceDependencies]; - }); - this.#state = new AngularCompilationState(angularProgram, host, typeScriptProgram, affectedFiles, affectedFiles.size === 1 ? OptimizeFor.SingleFile : OptimizeFor.WholeProgram, (0, web_worker_transformer_1.createWorkerTransformer)(hostOptions.processWebWorker.bind(hostOptions)), this.#state?.diagnosticCache); - return { - affectedFiles, - compilerOptions, - referencedFiles, - externalStylesheets: hostOptions.externalStylesheets, - templateUpdates, - }; - } - *collectDiagnostics(modes) { - (0, node_assert_1.default)(this.#state, 'Angular compilation must be initialized prior to collecting diagnostics.'); - const { affectedFiles, angularCompiler, diagnosticCache, templateDiagnosticsOptimization, typeScriptProgram, } = this.#state; - const syntactic = modes & angular_compilation_1.DiagnosticModes.Syntactic; - const semantic = modes & angular_compilation_1.DiagnosticModes.Semantic; - // Collect program level diagnostics - if (modes & angular_compilation_1.DiagnosticModes.Option) { - yield* typeScriptProgram.getConfigFileParsingDiagnostics(); - yield* angularCompiler.getOptionDiagnostics(); - yield* typeScriptProgram.getOptionsDiagnostics(); - } - if (syntactic) { - yield* typeScriptProgram.getGlobalDiagnostics(); - } - // Collect source file specific diagnostics - for (const sourceFile of typeScriptProgram.getSourceFiles()) { - if (angularCompiler.ignoreForDiagnostics.has(sourceFile)) { - continue; - } - if (syntactic) { - // TypeScript will use cached diagnostics for files that have not been - // changed or affected for this build when using incremental building. - yield* (0, profiling_1.profileSync)('NG_DIAGNOSTICS_SYNTACTIC', () => typeScriptProgram.getSyntacticDiagnostics(sourceFile), true); - } - if (!semantic) { - continue; - } - yield* (0, profiling_1.profileSync)('NG_DIAGNOSTICS_SEMANTIC', () => typeScriptProgram.getSemanticDiagnostics(sourceFile), true); - // Declaration files cannot have template diagnostics - if (sourceFile.isDeclarationFile) { - continue; - } - // Only request Angular template diagnostics for affected files to avoid - // overhead of template diagnostics for unchanged files. - if (affectedFiles.has(sourceFile)) { - const angularDiagnostics = (0, profiling_1.profileSync)('NG_DIAGNOSTICS_TEMPLATE', () => angularCompiler.getDiagnosticsForFile(sourceFile, templateDiagnosticsOptimization), true); - diagnosticCache.set(sourceFile, angularDiagnostics); - yield* angularDiagnostics; - } - else { - const angularDiagnostics = diagnosticCache.get(sourceFile); - if (angularDiagnostics) { - yield* angularDiagnostics; - } - } - } - } - emitAffectedFiles() { - (0, node_assert_1.default)(this.#state, 'Angular compilation must be initialized prior to emitting files.'); - const { affectedFiles, angularCompiler, compilerHost, typeScriptProgram, webWorkerTransform } = this.#state; - const compilerOptions = typeScriptProgram.getCompilerOptions(); - const buildInfoFilename = compilerOptions.tsBuildInfoFile ?? '.tsbuildinfo'; - const useTypeScriptTranspilation = !compilerOptions.isolatedModules || - !!compilerOptions.sourceMap || - !!compilerOptions.inlineSourceMap; - const emittedFiles = new Map(); - const writeFileCallback = (filename, contents, _a, _b, sourceFiles) => { - if (!sourceFiles?.length && filename.endsWith(buildInfoFilename)) { - // Save builder info contents to specified location - compilerHost.writeFile(filename, contents, false); - return; - } - (0, node_assert_1.default)(sourceFiles?.length === 1, 'Invalid TypeScript program emit for ' + filename); - const sourceFile = typescript_1.default.getOriginalNode(sourceFiles[0], typescript_1.default.isSourceFile); - if (angularCompiler.ignoreForEmit.has(sourceFile)) { - return; - } - angularCompiler.incrementalCompilation.recordSuccessfulEmit(sourceFile); - emittedFiles.set(sourceFile, { filename: sourceFile.fileName, contents }); - }; - const transformers = angularCompiler.prepareEmit().transformers; - transformers.before ??= []; - transformers.before.push((0, jit_bootstrap_transformer_1.replaceBootstrap)(() => typeScriptProgram.getProgram().getTypeChecker()), webWorkerTransform); - if (!this.browserOnlyBuild) { - transformers.before.push((0, lazy_routes_transformer_1.lazyRoutesTransformer)(compilerOptions, compilerHost)); - } - // Emit is handled in write file callback when using TypeScript - if (useTypeScriptTranspilation) { - // TypeScript will loop until there are no more affected files in the program - while (typeScriptProgram.emitNextAffectedFile(writeFileCallback, undefined, undefined, transformers)) { - /* empty */ - } - } - else if (compilerOptions.tsBuildInfoFile) { - // Manually get the builder state for the persistent cache - // The TypeScript API currently embeds this behavior inside the program emit - // via emitNextAffectedFile but that also applies all internal transforms. - const programWithGetState = typeScriptProgram.getProgram(); - (0, node_assert_1.default)(typeof programWithGetState.emitBuildInfo === 'function', 'TypeScript program emitBuildInfo is missing.'); - programWithGetState.emitBuildInfo(); - } - // Angular may have files that must be emitted but TypeScript does not consider affected - for (const sourceFile of typeScriptProgram.getSourceFiles()) { - if (emittedFiles.has(sourceFile) || angularCompiler.ignoreForEmit.has(sourceFile)) { - continue; - } - if (sourceFile.isDeclarationFile) { - continue; - } - if (angularCompiler.incrementalCompilation.safeToSkipEmit(sourceFile) && - !affectedFiles.has(sourceFile)) { - continue; - } - if (useTypeScriptTranspilation) { - typeScriptProgram.emit(sourceFile, writeFileCallback, undefined, undefined, transformers); - continue; - } - // When not using TypeScript transpilation, directly apply only Angular specific transformations - const transformResult = typescript_1.default.transform(sourceFile, [ - ...(transformers.before ?? []), - ...(transformers.after ?? []), - ], compilerOptions); - (0, node_assert_1.default)(transformResult.transformed.length === 1, 'TypeScript transforms should not produce multiple outputs for ' + sourceFile.fileName); - let contents; - if (sourceFile === transformResult.transformed[0]) { - // Use original content if no changes were made - contents = sourceFile.text; - } - else { - // Otherwise, print the transformed source file - const printer = typescript_1.default.createPrinter(compilerOptions, transformResult); - contents = printer.printFile(transformResult.transformed[0]); - } - angularCompiler.incrementalCompilation.recordSuccessfulEmit(sourceFile); - emittedFiles.set(sourceFile, { filename: sourceFile.fileName, contents }); - } - return emittedFiles.values(); - } -} -exports.AotCompilation = AotCompilation; -function findAffectedFiles(builder, { ignoreForDiagnostics }, includeTTC) { - const affectedFiles = new Set(); - // eslint-disable-next-line no-constant-condition - while (true) { - const result = builder.getSemanticDiagnosticsOfNextAffectedFile(undefined, (sourceFile) => { - // If the affected file is a TTC shim, add the shim's original source file. - // This ensures that changes that affect TTC are typechecked even when the changes - // are otherwise unrelated from a TS perspective and do not result in Ivy codegen changes. - // For example, changing @Input property types of a directive used in another component's - // template. - // A TTC shim is a file that has been ignored for diagnostics and has a filename ending in `.ngtypecheck.ts`. - if (ignoreForDiagnostics.has(sourceFile) && sourceFile.fileName.endsWith('.ngtypecheck.ts')) { - // This file name conversion relies on internal compiler logic and should be converted - // to an official method when available. 15 is length of `.ngtypecheck.ts` - const originalFilename = sourceFile.fileName.slice(0, -15) + '.ts'; - const originalSourceFile = builder.getSourceFile(originalFilename); - if (originalSourceFile) { - affectedFiles.add(originalSourceFile); - } - return true; - } - return false; - }); - if (!result) { - break; - } - affectedFiles.add(result.affected); - } - // Add all files with associated template type checking files. - // Stored TS build info does not have knowledge of the AOT compiler or the typechecking state of the templates. - // To ensure that errors are reported correctly, all AOT component diagnostics need to be analyzed even if build - // info is present. - if (includeTTC) { - for (const sourceFile of builder.getSourceFiles()) { - if (ignoreForDiagnostics.has(sourceFile) && sourceFile.fileName.endsWith('.ngtypecheck.ts')) { - // This file name conversion relies on internal compiler logic and should be converted - // to an official method when available. 15 is length of `.ngtypecheck.ts` - const originalFilename = sourceFile.fileName.slice(0, -15) + '.ts'; - const originalSourceFile = builder.getSourceFile(originalFilename); - if (originalSourceFile) { - affectedFiles.add(originalSourceFile); - } - } - } - } - return affectedFiles; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/factory.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/factory.d.ts deleted file mode 100755 index 788897d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/factory.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { AngularCompilation } from './angular-compilation'; -/** - * Creates an Angular compilation object that can be used to perform Angular application - * compilation either for AOT or JIT mode. By default a parallel compilation is created - * that uses a Node.js worker thread. - * @param jit True, for Angular JIT compilation; False, for Angular AOT compilation. - * @param browserOnlyBuild True, for browser only builds; False, for browser and server builds. - * @returns An instance of an Angular compilation object. - */ -export declare function createAngularCompilation(jit: boolean, browserOnlyBuild: boolean, parallel?: boolean): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/factory.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/factory.js deleted file mode 100755 index 05647ef..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/factory.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularCompilation = createAngularCompilation; -const environment_options_1 = require("../../../utils/environment-options"); -/** - * Creates an Angular compilation object that can be used to perform Angular application - * compilation either for AOT or JIT mode. By default a parallel compilation is created - * that uses a Node.js worker thread. - * @param jit True, for Angular JIT compilation; False, for Angular AOT compilation. - * @param browserOnlyBuild True, for browser only builds; False, for browser and server builds. - * @returns An instance of an Angular compilation object. - */ -async function createAngularCompilation(jit, browserOnlyBuild, parallel = environment_options_1.useParallelTs) { - if (parallel) { - const { ParallelCompilation } = await Promise.resolve().then(() => __importStar(require('./parallel-compilation'))); - return new ParallelCompilation(jit, browserOnlyBuild); - } - if (jit) { - const { JitCompilation } = await Promise.resolve().then(() => __importStar(require('./jit-compilation'))); - return new JitCompilation(browserOnlyBuild); - } - else { - const { AotCompilation } = await Promise.resolve().then(() => __importStar(require('./aot-compilation'))); - return new AotCompilation(browserOnlyBuild); - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/hmr-candidates.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/hmr-candidates.d.ts deleted file mode 100755 index d986c6b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/hmr-candidates.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type ng from '@angular/compiler-cli'; -import ts from 'typescript'; -/** - * Analyzes one or more modified files for changes to determine if any - * class declarations for Angular components are candidates for hot - * module replacement (HMR). If any source files are also modified but - * are not candidates then all candidates become invalid. This invalidation - * ensures that a full rebuild occurs and the running application stays - * synchronized with the code. - * @param modifiedFiles A set of modified files to analyze. - * @param param1 An Angular compiler instance - * @param staleSourceFiles A map of paths to previous source file instances. - * @returns A set of HMR candidate component class declarations. - */ -export declare function collectHmrCandidates(modifiedFiles: Set, { compiler }: ng.NgtscProgram, staleSourceFiles: Map | undefined): Set; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/hmr-candidates.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/hmr-candidates.js deleted file mode 100755 index c38546b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/hmr-candidates.js +++ /dev/null @@ -1,269 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.collectHmrCandidates = collectHmrCandidates; -const node_assert_1 = __importDefault(require("node:assert")); -const typescript_1 = __importDefault(require("typescript")); -/** - * Analyzes one or more modified files for changes to determine if any - * class declarations for Angular components are candidates for hot - * module replacement (HMR). If any source files are also modified but - * are not candidates then all candidates become invalid. This invalidation - * ensures that a full rebuild occurs and the running application stays - * synchronized with the code. - * @param modifiedFiles A set of modified files to analyze. - * @param param1 An Angular compiler instance - * @param staleSourceFiles A map of paths to previous source file instances. - * @returns A set of HMR candidate component class declarations. - */ -function collectHmrCandidates(modifiedFiles, { compiler }, staleSourceFiles) { - const candidates = new Set(); - for (const file of modifiedFiles) { - // If the file is a template for component(s), add component classes as candidates - const templateFileNodes = compiler.getComponentsWithTemplateFile(file); - if (templateFileNodes.size) { - templateFileNodes.forEach((node) => candidates.add(node)); - continue; - } - // If the file is a style for component(s), add component classes as candidates - const styleFileNodes = compiler.getComponentsWithStyleFile(file); - if (styleFileNodes.size) { - styleFileNodes.forEach((node) => candidates.add(node)); - continue; - } - const staleSource = staleSourceFiles?.get(file); - if (staleSource === undefined) { - // Unknown file requires a rebuild so clear out the candidates and stop collecting - candidates.clear(); - break; - } - const updatedSource = compiler.getCurrentProgram().getSourceFile(file); - if (updatedSource === undefined) { - // No longer existing program file requires a rebuild so clear out the candidates and stop collecting - candidates.clear(); - break; - } - // Analyze the stale and updated file for changes - const fileCandidates = analyzeFileUpdates(staleSource, updatedSource, compiler); - if (fileCandidates) { - fileCandidates.forEach((node) => candidates.add(node)); - } - else { - // Unsupported HMR changes present - // Only template and style literal changes are allowed. - candidates.clear(); - break; - } - } - return candidates; -} -/** - * Analyzes the updates of a source file for potential HMR component class candidates. - * A source file can contain candidates if only the Angular component metadata of a class - * has been changed and the metadata changes are only of supported fields. - * @param stale The stale (previous) source file instance. - * @param updated The updated source file instance. - * @param compiler An Angular compiler instance. - * @returns An array of candidate class declarations; or `null` if unsupported changes are present. - */ -function analyzeFileUpdates(stale, updated, compiler) { - if (stale.statements.length !== updated.statements.length) { - return null; - } - const candidates = []; - for (let i = 0; i < updated.statements.length; ++i) { - const updatedNode = updated.statements[i]; - const staleNode = stale.statements[i]; - if (typescript_1.default.isClassDeclaration(updatedNode)) { - if (!typescript_1.default.isClassDeclaration(staleNode)) { - return null; - } - // Check class declaration differences (name/heritage/modifiers) - if (updatedNode.name?.text !== staleNode.name?.text) { - return null; - } - if (!equalRangeText(updatedNode.heritageClauses, updated, staleNode.heritageClauses, stale)) { - return null; - } - const updatedModifiers = typescript_1.default.getModifiers(updatedNode); - const staleModifiers = typescript_1.default.getModifiers(staleNode); - if (updatedModifiers?.length !== staleModifiers?.length || - !updatedModifiers?.every((updatedModifier) => staleModifiers?.some((staleModifier) => updatedModifier.kind === staleModifier.kind))) { - return null; - } - // Check for component class nodes - const meta = compiler.getMeta(updatedNode); - if (meta?.decorator && meta.isComponent === true) { - const updatedDecorators = typescript_1.default.getDecorators(updatedNode); - const staleDecorators = typescript_1.default.getDecorators(staleNode); - if (!staleDecorators || staleDecorators.length !== updatedDecorators?.length) { - return null; - } - // TODO: Check other decorators instead of assuming all multi-decorator components are unsupported - if (staleDecorators.length > 1) { - return null; - } - // Find index of component metadata decorator - const metaDecoratorIndex = updatedDecorators?.indexOf(meta.decorator); - (0, node_assert_1.default)(metaDecoratorIndex !== undefined, 'Component metadata decorator should always be present on component class.'); - const updatedDecoratorExpression = meta.decorator.expression; - (0, node_assert_1.default)(typescript_1.default.isCallExpression(updatedDecoratorExpression) && - updatedDecoratorExpression.arguments.length === 1, 'Component metadata decorator should contain a call expression with a single argument.'); - // Check the matching stale index for the component decorator - const staleDecoratorExpression = staleDecorators[metaDecoratorIndex]?.expression; - if (!staleDecoratorExpression || - !typescript_1.default.isCallExpression(staleDecoratorExpression) || - staleDecoratorExpression.arguments.length !== 1) { - return null; - } - // Check decorator name/expression - // NOTE: This would typically be `Component` but can also be a property expression or some other alias. - // To avoid complex checks, this ensures the textual representation does not change. This has a low chance - // of a false positive if the expression is changed to still reference the `Component` type but has different - // text. However, it is rare for `Component` to not be used directly and additionally unlikely that it would - // be changed between edits. A false positive would also only lead to a difference of a full page reload versus - // an HMR update. - if (!equalRangeText(updatedDecoratorExpression.expression, updated, staleDecoratorExpression.expression, stale)) { - return null; - } - // Compare component meta decorator object literals - const analysis = analyzeMetaUpdates(staleDecoratorExpression, stale, updatedDecoratorExpression, updated); - if (analysis === MetaUpdateAnalysis.Unsupported) { - return null; - } - // Compare text of the member nodes to determine if any changes have occurred - if (!equalRangeText(updatedNode.members, updated, staleNode.members, stale)) { - // A change to a member outside a component's metadata is unsupported - return null; - } - // If all previous class checks passed, this class is supported for HMR updates - if (analysis === MetaUpdateAnalysis.Supported) { - candidates.push(updatedNode); - } - continue; - } - } - // Compare text of the statement nodes to determine if any changes have occurred - // TODO: Consider expanding this to check semantic updates for each node kind - if (!equalRangeText(updatedNode, updated, staleNode, stale)) { - // A change to a statement outside a component's metadata is unsupported - return null; - } - } - return candidates; -} -/** - * The set of Angular component metadata fields that are supported by HMR updates. - */ -const SUPPORTED_FIELD_NAMES = new Set([ - 'template', - 'templateUrl', - 'styles', - 'styleUrl', - 'stylesUrl', -]); -var MetaUpdateAnalysis; -(function (MetaUpdateAnalysis) { - MetaUpdateAnalysis[MetaUpdateAnalysis["Supported"] = 0] = "Supported"; - MetaUpdateAnalysis[MetaUpdateAnalysis["Unsupported"] = 1] = "Unsupported"; - MetaUpdateAnalysis[MetaUpdateAnalysis["None"] = 2] = "None"; -})(MetaUpdateAnalysis || (MetaUpdateAnalysis = {})); -/** - * Analyzes the metadata fields of a decorator call expression for unsupported HMR updates. - * Only updates to supported fields can be present for HMR to be viable. - * @param staleCall A call expression instance. - * @param staleSource The source file instance containing the stale call instance. - * @param updatedCall A call expression instance. - * @param updatedSource The source file instance containing the updated call instance. - * @returns A MetaUpdateAnalysis enum value. - */ -function analyzeMetaUpdates(staleCall, staleSource, updatedCall, updatedSource) { - const staleObject = staleCall.arguments[0]; - const updatedObject = updatedCall.arguments[0]; - let hasSupportedUpdate = false; - if (!typescript_1.default.isObjectLiteralExpression(staleObject) || !typescript_1.default.isObjectLiteralExpression(updatedObject)) { - return MetaUpdateAnalysis.Unsupported; - } - const supportedFields = new Map(); - const unsupportedFields = []; - for (const property of staleObject.properties) { - if (!typescript_1.default.isPropertyAssignment(property) || typescript_1.default.isComputedPropertyName(property.name)) { - // Unsupported object literal property - return MetaUpdateAnalysis.Unsupported; - } - const name = property.name.text; - if (SUPPORTED_FIELD_NAMES.has(name)) { - supportedFields.set(name, property.initializer); - continue; - } - unsupportedFields.push(property.initializer); - } - let i = 0; - for (const property of updatedObject.properties) { - if (!typescript_1.default.isPropertyAssignment(property) || typescript_1.default.isComputedPropertyName(property.name)) { - // Unsupported object literal property - return MetaUpdateAnalysis.Unsupported; - } - const name = property.name.text; - if (SUPPORTED_FIELD_NAMES.has(name)) { - const staleInitializer = supportedFields.get(name); - // If the supported field was added or has its content changed, there has been a supported update - if (!staleInitializer || - !equalRangeText(property.initializer, updatedSource, staleInitializer, staleSource)) { - hasSupportedUpdate = true; - } - // Remove the field entry to allow tracking removed fields - supportedFields.delete(name); - continue; - } - // Compare in order - if (!equalRangeText(property.initializer, updatedSource, unsupportedFields[i++], staleSource)) { - return MetaUpdateAnalysis.Unsupported; - } - } - if (i !== unsupportedFields.length) { - return MetaUpdateAnalysis.Unsupported; - } - // Any remaining supported field indicates a field removal. This is also considered a supported update. - hasSupportedUpdate ||= supportedFields.size > 0; - return hasSupportedUpdate ? MetaUpdateAnalysis.Supported : MetaUpdateAnalysis.None; -} -/** - * Compares the text from a provided range in a source file to the text of a range in a second source file. - * The comparison avoids making any intermediate string copies. - * @param firstRange A text range within the first source file. - * @param firstSource A source file instance. - * @param secondRange A text range within the second source file. - * @param secondSource A source file instance. - * @returns true, if the text from both ranges is equal; false, otherwise. - */ -function equalRangeText(firstRange, firstSource, secondRange, secondSource) { - // Check matching undefined values - if (!firstRange || !secondRange) { - return firstRange === secondRange; - } - // Ensure lengths are equal - const firstLength = firstRange.end - firstRange.pos; - const secondLength = secondRange.end - secondRange.pos; - if (firstLength !== secondLength) { - return false; - } - // Check each character - for (let i = 0; i < firstLength; ++i) { - const firstChar = firstSource.text.charCodeAt(i + firstRange.pos); - const secondChar = secondSource.text.charCodeAt(i + secondRange.pos); - if (firstChar !== secondChar) { - return false; - } - } - return true; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/index.d.ts deleted file mode 100755 index a1d3a98..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export { AngularCompilation, DiagnosticModes } from './angular-compilation'; -export { createAngularCompilation } from './factory'; -export { NoopCompilation } from './noop-compilation'; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/index.js deleted file mode 100755 index 0827c14..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NoopCompilation = exports.createAngularCompilation = exports.DiagnosticModes = exports.AngularCompilation = void 0; -var angular_compilation_1 = require("./angular-compilation"); -Object.defineProperty(exports, "AngularCompilation", { enumerable: true, get: function () { return angular_compilation_1.AngularCompilation; } }); -Object.defineProperty(exports, "DiagnosticModes", { enumerable: true, get: function () { return angular_compilation_1.DiagnosticModes; } }); -var factory_1 = require("./factory"); -Object.defineProperty(exports, "createAngularCompilation", { enumerable: true, get: function () { return factory_1.createAngularCompilation; } }); -var noop_compilation_1 = require("./noop-compilation"); -Object.defineProperty(exports, "NoopCompilation", { enumerable: true, get: function () { return noop_compilation_1.NoopCompilation; } }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/jit-compilation.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/jit-compilation.d.ts deleted file mode 100755 index afdf68d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/jit-compilation.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type ng from '@angular/compiler-cli'; -import ts from 'typescript'; -import { AngularHostOptions } from '../angular-host'; -import { AngularCompilation, DiagnosticModes, EmitFileResult } from './angular-compilation'; -export declare class JitCompilation extends AngularCompilation { - #private; - private readonly browserOnlyBuild; - constructor(browserOnlyBuild: boolean); - initialize(tsconfig: string, hostOptions: AngularHostOptions, compilerOptionsTransformer?: (compilerOptions: ng.CompilerOptions) => ng.CompilerOptions): Promise<{ - affectedFiles: ReadonlySet; - compilerOptions: ng.CompilerOptions; - referencedFiles: readonly string[]; - }>; - collectDiagnostics(modes: DiagnosticModes): Iterable; - emitAffectedFiles(): Iterable; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/jit-compilation.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/jit-compilation.js deleted file mode 100755 index 67ce453..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/jit-compilation.js +++ /dev/null @@ -1,117 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.JitCompilation = void 0; -const node_assert_1 = __importDefault(require("node:assert")); -const typescript_1 = __importDefault(require("typescript")); -const load_esm_1 = require("../../../utils/load-esm"); -const profiling_1 = require("../../esbuild/profiling"); -const angular_host_1 = require("../angular-host"); -const jit_resource_transformer_1 = require("../transformers/jit-resource-transformer"); -const lazy_routes_transformer_1 = require("../transformers/lazy-routes-transformer"); -const web_worker_transformer_1 = require("../transformers/web-worker-transformer"); -const angular_compilation_1 = require("./angular-compilation"); -class JitCompilationState { - compilerHost; - typeScriptProgram; - constructorParametersDownlevelTransform; - replaceResourcesTransform; - webWorkerTransform; - constructor(compilerHost, typeScriptProgram, constructorParametersDownlevelTransform, replaceResourcesTransform, webWorkerTransform) { - this.compilerHost = compilerHost; - this.typeScriptProgram = typeScriptProgram; - this.constructorParametersDownlevelTransform = constructorParametersDownlevelTransform; - this.replaceResourcesTransform = replaceResourcesTransform; - this.webWorkerTransform = webWorkerTransform; - } -} -class JitCompilation extends angular_compilation_1.AngularCompilation { - browserOnlyBuild; - #state; - constructor(browserOnlyBuild) { - super(); - this.browserOnlyBuild = browserOnlyBuild; - } - async initialize(tsconfig, hostOptions, compilerOptionsTransformer) { - // Dynamically load the Angular compiler CLI package - const { constructorParametersDownlevelTransform } = await (0, load_esm_1.loadEsmModule)('@angular/compiler-cli/private/tooling'); - // Load the compiler configuration and transform as needed - const { options: originalCompilerOptions, rootNames, errors: configurationDiagnostics, } = await this.loadConfiguration(tsconfig); - const compilerOptions = compilerOptionsTransformer?.(originalCompilerOptions) ?? originalCompilerOptions; - // Create Angular compiler host - const host = (0, angular_host_1.createAngularCompilerHost)(typescript_1.default, compilerOptions, hostOptions, undefined); - // Create the TypeScript Program - const typeScriptProgram = (0, profiling_1.profileSync)('TS_CREATE_PROGRAM', () => typescript_1.default.createEmitAndSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, this.#state?.typeScriptProgram ?? typescript_1.default.readBuilderProgram(compilerOptions, host), configurationDiagnostics)); - const affectedFiles = (0, profiling_1.profileSync)('TS_FIND_AFFECTED', () => findAffectedFiles(typeScriptProgram)); - this.#state = new JitCompilationState(host, typeScriptProgram, constructorParametersDownlevelTransform(typeScriptProgram.getProgram()), (0, jit_resource_transformer_1.createJitResourceTransformer)(() => typeScriptProgram.getProgram().getTypeChecker()), (0, web_worker_transformer_1.createWorkerTransformer)(hostOptions.processWebWorker.bind(hostOptions))); - const referencedFiles = typeScriptProgram - .getSourceFiles() - .map((sourceFile) => sourceFile.fileName); - return { affectedFiles, compilerOptions, referencedFiles }; - } - *collectDiagnostics(modes) { - (0, node_assert_1.default)(this.#state, 'Compilation must be initialized prior to collecting diagnostics.'); - const { typeScriptProgram } = this.#state; - // Collect program level diagnostics - if (modes & angular_compilation_1.DiagnosticModes.Option) { - yield* typeScriptProgram.getConfigFileParsingDiagnostics(); - yield* typeScriptProgram.getOptionsDiagnostics(); - } - if (modes & angular_compilation_1.DiagnosticModes.Syntactic) { - yield* typeScriptProgram.getGlobalDiagnostics(); - yield* (0, profiling_1.profileSync)('NG_DIAGNOSTICS_SYNTACTIC', () => typeScriptProgram.getSyntacticDiagnostics()); - } - if (modes & angular_compilation_1.DiagnosticModes.Semantic) { - yield* (0, profiling_1.profileSync)('NG_DIAGNOSTICS_SEMANTIC', () => typeScriptProgram.getSemanticDiagnostics()); - } - } - emitAffectedFiles() { - (0, node_assert_1.default)(this.#state, 'Compilation must be initialized prior to emitting files.'); - const { compilerHost, typeScriptProgram, constructorParametersDownlevelTransform, replaceResourcesTransform, webWorkerTransform, } = this.#state; - const compilerOptions = typeScriptProgram.getCompilerOptions(); - const buildInfoFilename = compilerOptions.tsBuildInfoFile ?? '.tsbuildinfo'; - const emittedFiles = []; - const writeFileCallback = (filename, contents, _a, _b, sourceFiles) => { - if (!sourceFiles?.length && filename.endsWith(buildInfoFilename)) { - // Save builder info contents to specified location - compilerHost.writeFile(filename, contents, false); - return; - } - (0, node_assert_1.default)(sourceFiles?.length === 1, 'Invalid TypeScript program emit for ' + filename); - emittedFiles.push({ filename: sourceFiles[0].fileName, contents }); - }; - const transformers = { - before: [ - replaceResourcesTransform, - constructorParametersDownlevelTransform, - webWorkerTransform, - ], - }; - if (!this.browserOnlyBuild) { - transformers.before.push((0, lazy_routes_transformer_1.lazyRoutesTransformer)(compilerOptions, compilerHost)); - } - // TypeScript will loop until there are no more affected files in the program - while (typeScriptProgram.emitNextAffectedFile(writeFileCallback, undefined, undefined, transformers)) { - /* empty */ - } - return emittedFiles; - } -} -exports.JitCompilation = JitCompilation; -function findAffectedFiles(builder) { - const affectedFiles = new Set(); - let result; - while ((result = builder.getSemanticDiagnosticsOfNextAffectedFile())) { - affectedFiles.add(result.affected); - } - return affectedFiles; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/noop-compilation.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/noop-compilation.d.ts deleted file mode 100755 index f6a1f40..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/noop-compilation.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type ng from '@angular/compiler-cli'; -import type ts from 'typescript'; -import { AngularHostOptions } from '../angular-host'; -import { AngularCompilation } from './angular-compilation'; -export declare class NoopCompilation extends AngularCompilation { - initialize(tsconfig: string, hostOptions: AngularHostOptions, compilerOptionsTransformer?: (compilerOptions: ng.CompilerOptions) => ng.CompilerOptions): Promise<{ - affectedFiles: ReadonlySet; - compilerOptions: ng.CompilerOptions; - referencedFiles: readonly string[]; - }>; - collectDiagnostics(): never; - emitAffectedFiles(): never; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/noop-compilation.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/noop-compilation.js deleted file mode 100755 index f08e410..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/noop-compilation.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NoopCompilation = void 0; -const angular_compilation_1 = require("./angular-compilation"); -class NoopCompilation extends angular_compilation_1.AngularCompilation { - async initialize(tsconfig, hostOptions, compilerOptionsTransformer) { - // Load the compiler configuration and transform as needed - const { options: originalCompilerOptions } = await this.loadConfiguration(tsconfig); - const compilerOptions = compilerOptionsTransformer?.(originalCompilerOptions) ?? originalCompilerOptions; - return { affectedFiles: new Set(), compilerOptions, referencedFiles: [] }; - } - collectDiagnostics() { - throw new Error('Not available when using noop compilation.'); - } - emitAffectedFiles() { - throw new Error('Not available when using noop compilation.'); - } -} -exports.NoopCompilation = NoopCompilation; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-compilation.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-compilation.d.ts deleted file mode 100755 index ab4f3b7..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-compilation.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { CompilerOptions } from '@angular/compiler-cli'; -import type { PartialMessage } from 'esbuild'; -import type { SourceFile } from 'typescript'; -import type { AngularHostOptions } from '../angular-host'; -import { AngularCompilation, DiagnosticModes, EmitFileResult } from './angular-compilation'; -/** - * An Angular compilation which uses a Node.js Worker thread to load and execute - * the TypeScript and Angular compilers. This allows for longer synchronous actions - * such as semantic and template diagnostics to be calculated in parallel to the - * other aspects of the application bundling process. The worker thread also has - * a separate memory pool which significantly reduces the need for adjusting the - * main Node.js CLI process memory settings with large application code sizes. - */ -export declare class ParallelCompilation extends AngularCompilation { - #private; - private readonly jit; - private readonly browserOnlyBuild; - constructor(jit: boolean, browserOnlyBuild: boolean); - initialize(tsconfig: string, hostOptions: AngularHostOptions, compilerOptionsTransformer?: (compilerOptions: CompilerOptions) => CompilerOptions): Promise<{ - affectedFiles: ReadonlySet; - compilerOptions: CompilerOptions; - referencedFiles: readonly string[]; - externalStylesheets?: ReadonlyMap; - }>; - /** - * This is not needed with this compilation type since the worker will already send a response - * with the serializable esbuild compatible diagnostics. - */ - protected collectDiagnostics(): never; - diagnoseFiles(modes?: DiagnosticModes): Promise<{ - errors?: PartialMessage[]; - warnings?: PartialMessage[]; - }>; - emitAffectedFiles(): Promise>; - update(files: Set): Promise; - close(): Promise; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-compilation.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-compilation.js deleted file mode 100755 index 8eef59d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-compilation.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ParallelCompilation = void 0; -const node_module_1 = require("node:module"); -const node_worker_threads_1 = require("node:worker_threads"); -const worker_pool_1 = require("../../../utils/worker-pool"); -const angular_compilation_1 = require("./angular-compilation"); -/** - * An Angular compilation which uses a Node.js Worker thread to load and execute - * the TypeScript and Angular compilers. This allows for longer synchronous actions - * such as semantic and template diagnostics to be calculated in parallel to the - * other aspects of the application bundling process. The worker thread also has - * a separate memory pool which significantly reduces the need for adjusting the - * main Node.js CLI process memory settings with large application code sizes. - */ -class ParallelCompilation extends angular_compilation_1.AngularCompilation { - jit; - browserOnlyBuild; - #worker; - constructor(jit, browserOnlyBuild) { - super(); - this.jit = jit; - this.browserOnlyBuild = browserOnlyBuild; - // TODO: Convert to import.meta usage during ESM transition - const localRequire = (0, node_module_1.createRequire)(__filename); - this.#worker = new worker_pool_1.WorkerPool({ - maxThreads: 1, - idleTimeout: Infinity, - filename: localRequire.resolve('./parallel-worker'), - }); - } - initialize(tsconfig, hostOptions, compilerOptionsTransformer) { - const stylesheetChannel = new node_worker_threads_1.MessageChannel(); - // The request identifier is required because Angular can issue multiple concurrent requests - stylesheetChannel.port1.on('message', ({ requestId, data, containingFile, stylesheetFile, order, className }) => { - hostOptions - .transformStylesheet(data, containingFile, stylesheetFile, order, className) - .then((value) => stylesheetChannel.port1.postMessage({ requestId, value })) - .catch((error) => stylesheetChannel.port1.postMessage({ requestId, error })); - }); - // The web worker processing is a synchronous operation and uses shared memory combined with - // the Atomics API to block execution here until a response is received. - const webWorkerChannel = new node_worker_threads_1.MessageChannel(); - const webWorkerSignal = new Int32Array(new SharedArrayBuffer(4)); - webWorkerChannel.port1.on('message', ({ workerFile, containingFile }) => { - try { - const workerCodeFile = hostOptions.processWebWorker(workerFile, containingFile); - webWorkerChannel.port1.postMessage({ workerCodeFile }); - } - catch (error) { - webWorkerChannel.port1.postMessage({ error }); - } - finally { - Atomics.store(webWorkerSignal, 0, 1); - Atomics.notify(webWorkerSignal, 0); - } - }); - // The compiler options transformation is a synchronous operation and uses shared memory combined - // with the Atomics API to block execution here until a response is received. - const optionsChannel = new node_worker_threads_1.MessageChannel(); - const optionsSignal = new Int32Array(new SharedArrayBuffer(4)); - optionsChannel.port1.on('message', (compilerOptions) => { - try { - const transformedOptions = compilerOptionsTransformer?.(compilerOptions) ?? compilerOptions; - optionsChannel.port1.postMessage({ transformedOptions }); - } - catch (error) { - webWorkerChannel.port1.postMessage({ error }); - } - finally { - Atomics.store(optionsSignal, 0, 1); - Atomics.notify(optionsSignal, 0); - } - }); - // Execute the initialize function in the worker thread - return this.#worker.run({ - fileReplacements: hostOptions.fileReplacements, - tsconfig, - jit: this.jit, - browserOnlyBuild: this.browserOnlyBuild, - stylesheetPort: stylesheetChannel.port2, - optionsPort: optionsChannel.port2, - optionsSignal, - webWorkerPort: webWorkerChannel.port2, - webWorkerSignal, - }, { - name: 'initialize', - transferList: [stylesheetChannel.port2, optionsChannel.port2, webWorkerChannel.port2], - }); - } - /** - * This is not needed with this compilation type since the worker will already send a response - * with the serializable esbuild compatible diagnostics. - */ - collectDiagnostics() { - throw new Error('Not implemented in ParallelCompilation.'); - } - diagnoseFiles(modes = angular_compilation_1.DiagnosticModes.All) { - return this.#worker.run(modes, { name: 'diagnose' }); - } - emitAffectedFiles() { - return this.#worker.run(undefined, { name: 'emit' }); - } - update(files) { - return this.#worker.run(files, { name: 'update' }); - } - close() { - return this.#worker.destroy(); - } -} -exports.ParallelCompilation = ParallelCompilation; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-worker.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-worker.d.ts deleted file mode 100755 index 456d5d4..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-worker.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { PartialMessage } from 'esbuild'; -import { type MessagePort } from 'node:worker_threads'; -import type { DiagnosticModes } from './angular-compilation'; -export interface InitRequest { - jit: boolean; - browserOnlyBuild: boolean; - tsconfig: string; - fileReplacements?: Record; - stylesheetPort: MessagePort; - optionsPort: MessagePort; - optionsSignal: Int32Array; - webWorkerPort: MessagePort; - webWorkerSignal: Int32Array; -} -export declare function initialize(request: InitRequest): Promise<{ - externalStylesheets: ReadonlyMap | undefined; - templateUpdates: ReadonlyMap | undefined; - referencedFiles: readonly string[]; - compilerOptions: { - allowJs: boolean | undefined; - isolatedModules: boolean | undefined; - sourceMap: boolean | undefined; - inlineSourceMap: boolean | undefined; - }; -}>; -export declare function diagnose(modes: DiagnosticModes): Promise<{ - errors?: PartialMessage[]; - warnings?: PartialMessage[]; -}>; -export declare function emit(): Promise; -export declare function update(files: Set): void; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-worker.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-worker.js deleted file mode 100755 index ff7f440..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/compilation/parallel-worker.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.initialize = initialize; -exports.diagnose = diagnose; -exports.emit = emit; -exports.update = update; -const node_assert_1 = __importDefault(require("node:assert")); -const node_crypto_1 = require("node:crypto"); -const node_worker_threads_1 = require("node:worker_threads"); -const source_file_cache_1 = require("../../esbuild/angular/source-file-cache"); -const aot_compilation_1 = require("./aot-compilation"); -const jit_compilation_1 = require("./jit-compilation"); -let compilation; -const sourceFileCache = new source_file_cache_1.SourceFileCache(); -async function initialize(request) { - compilation ??= request.jit - ? new jit_compilation_1.JitCompilation(request.browserOnlyBuild) - : new aot_compilation_1.AotCompilation(request.browserOnlyBuild); - const stylesheetRequests = new Map(); - request.stylesheetPort.on('message', ({ requestId, value, error }) => { - if (error) { - stylesheetRequests.get(requestId)?.[1](error); - } - else { - stylesheetRequests.get(requestId)?.[0](value); - } - }); - const { compilerOptions, referencedFiles, externalStylesheets, templateUpdates } = await compilation.initialize(request.tsconfig, { - fileReplacements: request.fileReplacements, - sourceFileCache, - modifiedFiles: sourceFileCache.modifiedFiles, - transformStylesheet(data, containingFile, stylesheetFile, order, className) { - const requestId = (0, node_crypto_1.randomUUID)(); - const resultPromise = new Promise((resolve, reject) => stylesheetRequests.set(requestId, [resolve, reject])); - request.stylesheetPort.postMessage({ - requestId, - data, - containingFile, - stylesheetFile, - order, - className, - }); - return resultPromise; - }, - processWebWorker(workerFile, containingFile) { - Atomics.store(request.webWorkerSignal, 0, 0); - request.webWorkerPort.postMessage({ workerFile, containingFile }); - Atomics.wait(request.webWorkerSignal, 0, 0); - const result = (0, node_worker_threads_1.receiveMessageOnPort)(request.webWorkerPort)?.message; - if (result?.error) { - throw result.error; - } - return result?.workerCodeFile ?? workerFile; - }, - }, (compilerOptions) => { - Atomics.store(request.optionsSignal, 0, 0); - request.optionsPort.postMessage(compilerOptions); - Atomics.wait(request.optionsSignal, 0, 0); - const result = (0, node_worker_threads_1.receiveMessageOnPort)(request.optionsPort)?.message; - if (result?.error) { - throw result.error; - } - return result?.transformedOptions ?? compilerOptions; - }); - return { - externalStylesheets, - templateUpdates, - referencedFiles, - // TODO: Expand? `allowJs`, `isolatedModules`, `sourceMap`, `inlineSourceMap` are the only fields needed currently. - compilerOptions: { - allowJs: compilerOptions.allowJs, - isolatedModules: compilerOptions.isolatedModules, - sourceMap: compilerOptions.sourceMap, - inlineSourceMap: compilerOptions.inlineSourceMap, - }, - }; -} -async function diagnose(modes) { - (0, node_assert_1.default)(compilation); - const diagnostics = await compilation.diagnoseFiles(modes); - return diagnostics; -} -async function emit() { - (0, node_assert_1.default)(compilation); - const files = await compilation.emitAffectedFiles(); - return [...files]; -} -function update(files) { - sourceFileCache.invalidate(files); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.d.ts deleted file mode 100755 index 7913755..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import ts from 'typescript'; -export declare function replaceBootstrap(getTypeChecker: () => ts.TypeChecker): ts.TransformerFactory; -export declare function elideImports(sourceFile: ts.SourceFile, removedNodes: ts.Node[], getTypeChecker: () => ts.TypeChecker, compilerOptions: ts.CompilerOptions): Set; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.js deleted file mode 100755 index 78baa61..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-bootstrap-transformer.js +++ /dev/null @@ -1,180 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.replaceBootstrap = replaceBootstrap; -exports.elideImports = elideImports; -const typescript_1 = __importDefault(require("typescript")); -/** - * The name of the Angular platform that should be replaced within - * bootstrap call expressions to support AOT. - */ -const PLATFORM_BROWSER_DYNAMIC_NAME = 'platformBrowserDynamic'; -function replaceBootstrap(getTypeChecker) { - return (context) => { - let bootstrapImport; - let bootstrapNamespace; - const replacedNodes = []; - const nodeFactory = context.factory; - const visitNode = (node) => { - if (typescript_1.default.isCallExpression(node) && typescript_1.default.isIdentifier(node.expression)) { - const target = node.expression; - if (target.text === PLATFORM_BROWSER_DYNAMIC_NAME) { - if (!bootstrapNamespace) { - bootstrapNamespace = nodeFactory.createUniqueName('__NgCli_bootstrap_'); - bootstrapImport = nodeFactory.createImportDeclaration(undefined, nodeFactory.createImportClause(false, undefined, nodeFactory.createNamespaceImport(bootstrapNamespace)), nodeFactory.createStringLiteral('@angular/platform-browser')); - } - replacedNodes.push(target); - return nodeFactory.updateCallExpression(node, nodeFactory.createPropertyAccessExpression(bootstrapNamespace, 'platformBrowser'), node.typeArguments, node.arguments); - } - } - return typescript_1.default.visitEachChild(node, visitNode, context); - }; - return (sourceFile) => { - if (!sourceFile.text.includes(PLATFORM_BROWSER_DYNAMIC_NAME)) { - return sourceFile; - } - let updatedSourceFile = typescript_1.default.visitEachChild(sourceFile, visitNode, context); - if (bootstrapImport) { - // Remove any unused platform browser dynamic imports - const removals = elideImports(updatedSourceFile, replacedNodes, getTypeChecker, context.getCompilerOptions()); - if (removals.size > 0) { - updatedSourceFile = typescript_1.default.visitEachChild(updatedSourceFile, (node) => (removals.has(node) ? undefined : node), context); - } - // Add new platform browser import - return nodeFactory.updateSourceFile(updatedSourceFile, typescript_1.default.setTextRange(nodeFactory.createNodeArray([bootstrapImport, ...updatedSourceFile.statements]), sourceFile.statements)); - } - else { - return updatedSourceFile; - } - }; - }; -} -// Remove imports for which all identifiers have been removed. -// Needs type checker, and works even if it's not the first transformer. -// Works by removing imports for symbols whose identifiers have all been removed. -// Doesn't use the `symbol.declarations` because that previous transforms might have removed nodes -// but the type checker doesn't know. -// See https://github.com/Microsoft/TypeScript/issues/17552 for more information. -function elideImports(sourceFile, removedNodes, getTypeChecker, compilerOptions) { - const importNodeRemovals = new Set(); - if (removedNodes.length === 0) { - return importNodeRemovals; - } - const typeChecker = getTypeChecker(); - // Collect all imports and used identifiers - const usedSymbols = new Set(); - const imports = []; - typescript_1.default.forEachChild(sourceFile, function visit(node) { - // Skip removed nodes. - if (removedNodes.includes(node)) { - return; - } - // Consider types for 'implements' as unused. - // A HeritageClause token can also be an 'AbstractKeyword' - // which in that case we should not elide the import. - if (typescript_1.default.isHeritageClause(node) && node.token === typescript_1.default.SyntaxKind.ImplementsKeyword) { - return; - } - // Record import and skip - if (typescript_1.default.isImportDeclaration(node)) { - if (!node.importClause?.isTypeOnly) { - imports.push(node); - } - return; - } - // Type reference imports do not need to be emitted when emitDecoratorMetadata is disabled. - if (typescript_1.default.isTypeReferenceNode(node) && !compilerOptions.emitDecoratorMetadata) { - return; - } - let symbol; - switch (node.kind) { - case typescript_1.default.SyntaxKind.Identifier: - if (node.parent && typescript_1.default.isShorthandPropertyAssignment(node.parent)) { - const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(node.parent); - if (shorthandSymbol) { - symbol = shorthandSymbol; - } - } - else { - symbol = typeChecker.getSymbolAtLocation(node); - } - break; - case typescript_1.default.SyntaxKind.ExportSpecifier: - symbol = typeChecker.getExportSpecifierLocalTargetSymbol(node); - break; - case typescript_1.default.SyntaxKind.ShorthandPropertyAssignment: - symbol = typeChecker.getShorthandAssignmentValueSymbol(node); - break; - } - if (symbol) { - usedSymbols.add(symbol); - } - typescript_1.default.forEachChild(node, visit); - }); - if (imports.length === 0) { - return importNodeRemovals; - } - const isUnused = (node) => { - // Do not remove JSX factory imports - if (node.text === compilerOptions.jsxFactory) { - return false; - } - const symbol = typeChecker.getSymbolAtLocation(node); - return symbol && !usedSymbols.has(symbol); - }; - for (const node of imports) { - if (!node.importClause) { - // "import 'abc';" - continue; - } - const namedBindings = node.importClause.namedBindings; - if (namedBindings && typescript_1.default.isNamespaceImport(namedBindings)) { - // "import * as XYZ from 'abc';" - if (isUnused(namedBindings.name)) { - importNodeRemovals.add(node); - } - } - else { - const specifierNodeRemovals = []; - let clausesCount = 0; - // "import { XYZ, ... } from 'abc';" - if (namedBindings && typescript_1.default.isNamedImports(namedBindings)) { - let removedClausesCount = 0; - clausesCount += namedBindings.elements.length; - for (const specifier of namedBindings.elements) { - if (specifier.isTypeOnly || isUnused(specifier.name)) { - removedClausesCount++; - // in case we don't have any more namedImports we should remove the parent ie the {} - const nodeToRemove = clausesCount === removedClausesCount ? specifier.parent : specifier; - specifierNodeRemovals.push(nodeToRemove); - } - } - } - // "import XYZ from 'abc';" - if (node.importClause.name) { - clausesCount++; - if (node.importClause.isTypeOnly || isUnused(node.importClause.name)) { - specifierNodeRemovals.push(node.importClause.name); - } - } - if (specifierNodeRemovals.length === clausesCount) { - importNodeRemovals.add(node); - } - else { - for (const specifierNodeRemoval of specifierNodeRemovals) { - importNodeRemovals.add(specifierNodeRemoval); - } - } - } - } - return importNodeRemovals; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-resource-transformer.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-resource-transformer.d.ts deleted file mode 100755 index cfb5425..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-resource-transformer.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import ts from 'typescript'; -/** - * Creates a TypeScript Transformer to transform Angular Component resource references into - * static import statements. This transformer is used in Angular's JIT compilation mode to - * support processing of component resources. When in AOT mode, the Angular AOT compiler handles - * this processing and this transformer is not used. - * @param getTypeChecker A function that returns a TypeScript TypeChecker instance for the program. - * @returns A TypeScript transformer factory. - */ -export declare function createJitResourceTransformer(getTypeChecker: () => ts.TypeChecker): ts.TransformerFactory; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-resource-transformer.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-resource-transformer.js deleted file mode 100755 index b57a38a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/jit-resource-transformer.js +++ /dev/null @@ -1,186 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createJitResourceTransformer = createJitResourceTransformer; -const typescript_1 = __importDefault(require("typescript")); -const uri_1 = require("../uri"); -/** - * Creates a TypeScript Transformer to transform Angular Component resource references into - * static import statements. This transformer is used in Angular's JIT compilation mode to - * support processing of component resources. When in AOT mode, the Angular AOT compiler handles - * this processing and this transformer is not used. - * @param getTypeChecker A function that returns a TypeScript TypeChecker instance for the program. - * @returns A TypeScript transformer factory. - */ -function createJitResourceTransformer(getTypeChecker) { - return (context) => { - const typeChecker = getTypeChecker(); - const nodeFactory = context.factory; - const resourceImportDeclarations = []; - const visitNode = (node) => { - if (typescript_1.default.isClassDeclaration(node)) { - const decorators = typescript_1.default.getDecorators(node); - if (!decorators || decorators.length === 0) { - return node; - } - return nodeFactory.updateClassDeclaration(node, [ - ...decorators.map((current) => visitDecorator(nodeFactory, current, typeChecker, resourceImportDeclarations)), - ...(typescript_1.default.getModifiers(node) ?? []), - ], node.name, node.typeParameters, node.heritageClauses, node.members); - } - return typescript_1.default.visitEachChild(node, visitNode, context); - }; - return (sourceFile) => { - const updatedSourceFile = typescript_1.default.visitEachChild(sourceFile, visitNode, context); - if (resourceImportDeclarations.length > 0) { - return nodeFactory.updateSourceFile(updatedSourceFile, typescript_1.default.setTextRange(nodeFactory.createNodeArray([...resourceImportDeclarations, ...updatedSourceFile.statements], updatedSourceFile.statements.hasTrailingComma), updatedSourceFile.statements), updatedSourceFile.isDeclarationFile, updatedSourceFile.referencedFiles, updatedSourceFile.typeReferenceDirectives, updatedSourceFile.hasNoDefaultLib, updatedSourceFile.libReferenceDirectives); - } - else { - return updatedSourceFile; - } - }; - }; -} -function visitDecorator(nodeFactory, node, typeChecker, resourceImportDeclarations) { - const origin = getDecoratorOrigin(node, typeChecker); - if (!origin || origin.module !== '@angular/core' || origin.name !== 'Component') { - return node; - } - if (!typescript_1.default.isCallExpression(node.expression)) { - return node; - } - const decoratorFactory = node.expression; - const args = decoratorFactory.arguments; - if (args.length !== 1 || !typescript_1.default.isObjectLiteralExpression(args[0])) { - // Unsupported component metadata - return node; - } - const objectExpression = args[0]; - const styleReplacements = []; - // visit all properties - let properties = typescript_1.default.visitNodes(objectExpression.properties, (node) => typescript_1.default.isObjectLiteralElementLike(node) - ? visitComponentMetadata(nodeFactory, node, styleReplacements, resourceImportDeclarations) - : node); - // replace properties with updated properties - if (styleReplacements.length > 0) { - const styleProperty = nodeFactory.createPropertyAssignment(nodeFactory.createIdentifier('styles'), nodeFactory.createArrayLiteralExpression(styleReplacements)); - properties = nodeFactory.createNodeArray([...properties, styleProperty]); - } - return nodeFactory.updateDecorator(node, nodeFactory.updateCallExpression(decoratorFactory, decoratorFactory.expression, decoratorFactory.typeArguments, [nodeFactory.updateObjectLiteralExpression(objectExpression, properties)])); -} -function visitComponentMetadata(nodeFactory, node, styleReplacements, resourceImportDeclarations) { - if (!typescript_1.default.isPropertyAssignment(node) || typescript_1.default.isComputedPropertyName(node.name)) { - return node; - } - switch (node.name.text) { - case 'templateUrl': - // Only analyze string literals - if (!typescript_1.default.isStringLiteralLike(node.initializer)) { - return node; - } - return node.initializer.text.length === 0 - ? node - : nodeFactory.updatePropertyAssignment(node, nodeFactory.createIdentifier('template'), createResourceImport(nodeFactory, (0, uri_1.generateJitFileUri)(node.initializer.text, 'template'), resourceImportDeclarations)); - case 'styles': - if (typescript_1.default.isStringLiteralLike(node.initializer)) { - styleReplacements.unshift(createResourceImport(nodeFactory, (0, uri_1.generateJitInlineUri)(node.initializer.text, 'style'), resourceImportDeclarations)); - return undefined; - } - if (typescript_1.default.isArrayLiteralExpression(node.initializer)) { - const inlineStyles = typescript_1.default.visitNodes(node.initializer.elements, (node) => { - if (!typescript_1.default.isStringLiteralLike(node)) { - return node; - } - return node.text.length === 0 - ? undefined // An empty inline style is equivalent to not having a style element - : createResourceImport(nodeFactory, (0, uri_1.generateJitInlineUri)(node.text, 'style'), resourceImportDeclarations); - }); - // Inline styles should be placed first - styleReplacements.unshift(...inlineStyles); - // The inline styles will be added afterwards in combination with any external styles - return undefined; - } - return node; - case 'styleUrl': - if (typescript_1.default.isStringLiteralLike(node.initializer)) { - styleReplacements.push(createResourceImport(nodeFactory, (0, uri_1.generateJitFileUri)(node.initializer.text, 'style'), resourceImportDeclarations)); - return undefined; - } - return node; - case 'styleUrls': { - if (!typescript_1.default.isArrayLiteralExpression(node.initializer)) { - return node; - } - const externalStyles = typescript_1.default.visitNodes(node.initializer.elements, (node) => { - if (!typescript_1.default.isStringLiteralLike(node)) { - return node; - } - return node.text - ? createResourceImport(nodeFactory, (0, uri_1.generateJitFileUri)(node.text, 'style'), resourceImportDeclarations) - : undefined; - }); - // External styles are applied after any inline styles - styleReplacements.push(...externalStyles); - // The external styles will be added afterwards in combination with any inline styles - return undefined; - } - default: - // All other elements are passed through - return node; - } -} -function createResourceImport(nodeFactory, url, resourceImportDeclarations) { - const urlLiteral = nodeFactory.createStringLiteral(url); - const importName = nodeFactory.createIdentifier(`__NG_CLI_RESOURCE__${resourceImportDeclarations.length}`); - resourceImportDeclarations.push(nodeFactory.createImportDeclaration(undefined, nodeFactory.createImportClause(false, importName, undefined), urlLiteral)); - return importName; -} -function getDecoratorOrigin(decorator, typeChecker) { - if (!typescript_1.default.isCallExpression(decorator.expression)) { - return null; - } - let identifier; - let name = ''; - if (typescript_1.default.isPropertyAccessExpression(decorator.expression.expression)) { - identifier = decorator.expression.expression.expression; - name = decorator.expression.expression.name.text; - } - else if (typescript_1.default.isIdentifier(decorator.expression.expression)) { - identifier = decorator.expression.expression; - } - else { - return null; - } - // NOTE: resolver.getReferencedImportDeclaration would work as well but is internal - const symbol = typeChecker.getSymbolAtLocation(identifier); - if (symbol && symbol.declarations && symbol.declarations.length > 0) { - const declaration = symbol.declarations[0]; - let module; - if (typescript_1.default.isImportSpecifier(declaration)) { - name = (declaration.propertyName || declaration.name).text; - module = declaration.parent.parent.parent.moduleSpecifier.text; - } - else if (typescript_1.default.isNamespaceImport(declaration)) { - // Use the name from the decorator namespace property access - module = declaration.parent.parent.moduleSpecifier.text; - } - else if (typescript_1.default.isImportClause(declaration)) { - name = declaration.name.text; - module = declaration.parent.moduleSpecifier.text; - } - else { - return null; - } - return { name, module }; - } - return null; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/lazy-routes-transformer.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/lazy-routes-transformer.d.ts deleted file mode 100755 index d0c991c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/lazy-routes-transformer.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import ts from 'typescript'; -/** - * A transformer factory that adds a property to the lazy-loaded route object. - * This property is used to allow for the retrieval of the module path during SSR. - * - * @param compilerOptions The compiler options. - * @param compilerHost The compiler host. - * @returns A transformer factory. - * - * @example - * **Before:** - * ```ts - * const routes: Routes = [ - * { - * path: 'lazy', - * loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule) - * } - * ]; - * ``` - * - * **After:** - * ```ts - * const routes: Routes = [ - * { - * path: 'lazy', - * loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule), - * ...(typeof ngServerMode !== "undefined" && ngServerMode ? { ɵentryName: "./lazy/lazy.module.ts" }: {}) - * } - * ]; - * ``` - */ -export declare function lazyRoutesTransformer(compilerOptions: ts.CompilerOptions, compilerHost: ts.CompilerHost): ts.TransformerFactory; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/lazy-routes-transformer.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/lazy-routes-transformer.js deleted file mode 100755 index 510779f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/lazy-routes-transformer.js +++ /dev/null @@ -1,163 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.lazyRoutesTransformer = lazyRoutesTransformer; -const node_assert_1 = __importDefault(require("node:assert")); -const posix_1 = require("node:path/posix"); -const typescript_1 = __importDefault(require("typescript")); -/** - * A transformer factory that adds a property to the lazy-loaded route object. - * This property is used to allow for the retrieval of the module path during SSR. - * - * @param compilerOptions The compiler options. - * @param compilerHost The compiler host. - * @returns A transformer factory. - * - * @example - * **Before:** - * ```ts - * const routes: Routes = [ - * { - * path: 'lazy', - * loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule) - * } - * ]; - * ``` - * - * **After:** - * ```ts - * const routes: Routes = [ - * { - * path: 'lazy', - * loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule), - * ...(typeof ngServerMode !== "undefined" && ngServerMode ? { ɵentryName: "./lazy/lazy.module.ts" }: {}) - * } - * ]; - * ``` - */ -function lazyRoutesTransformer(compilerOptions, compilerHost) { - const moduleResolutionCache = compilerHost.getModuleResolutionCache?.(); - (0, node_assert_1.default)(typeof compilerOptions.basePath === 'string', 'compilerOptions.basePath should be a string.'); - const basePath = compilerOptions.basePath; - return (context) => { - const factory = context.factory; - const visitor = (node) => { - if (!typescript_1.default.isObjectLiteralExpression(node)) { - // Not an object literal, so skip it. - return typescript_1.default.visitEachChild(node, visitor, context); - } - const loadFunction = getLoadComponentOrChildrenProperty(node)?.initializer; - // Check if the initializer is an arrow function or a function expression - if (!loadFunction || - (!typescript_1.default.isArrowFunction(loadFunction) && !typescript_1.default.isFunctionExpression(loadFunction))) { - return typescript_1.default.visitEachChild(node, visitor, context); - } - let callExpression; - if (typescript_1.default.isArrowFunction(loadFunction)) { - // Handle arrow functions: body can either be a block or a direct call expression - const body = loadFunction.body; - if (typescript_1.default.isBlock(body)) { - // Arrow function with a block: check the first statement for a return call expression - const firstStatement = body.statements[0]; - if (firstStatement && - typescript_1.default.isReturnStatement(firstStatement) && - firstStatement.expression && - typescript_1.default.isCallExpression(firstStatement.expression)) { - callExpression = firstStatement.expression; - } - } - else if (typescript_1.default.isCallExpression(body)) { - // Arrow function with a direct call expression as its body - callExpression = body; - } - } - else if (typescript_1.default.isFunctionExpression(loadFunction)) { - // Handle function expressions: check for a return statement with a call expression - const returnExpression = loadFunction.body.statements.find(typescript_1.default.isReturnStatement)?.expression; - if (returnExpression && typescript_1.default.isCallExpression(returnExpression)) { - callExpression = returnExpression; - } - } - if (!callExpression) { - return typescript_1.default.visitEachChild(node, visitor, context); - } - // Optionally check for the 'then' property access expression - const expression = callExpression.expression; - if (!typescript_1.default.isCallExpression(expression) && - typescript_1.default.isPropertyAccessExpression(expression) && - expression.name.text !== 'then') { - return typescript_1.default.visitEachChild(node, visitor, context); - } - const importExpression = typescript_1.default.isPropertyAccessExpression(expression) - ? expression.expression // Navigate to the underlying expression for 'then' - : callExpression; - // Ensure the underlying expression is an import call - if (!typescript_1.default.isCallExpression(importExpression) || - importExpression.expression.kind !== typescript_1.default.SyntaxKind.ImportKeyword) { - return typescript_1.default.visitEachChild(node, visitor, context); - } - // Check if the argument to the import call is a string literal - const callExpressionArgument = importExpression.arguments[0]; - if (!typescript_1.default.isStringLiteralLike(callExpressionArgument)) { - // Not a string literal, so skip it. - return typescript_1.default.visitEachChild(node, visitor, context); - } - const resolvedPath = typescript_1.default.resolveModuleName(callExpressionArgument.text, node.getSourceFile().fileName, compilerOptions, compilerHost, moduleResolutionCache)?.resolvedModule?.resolvedFileName; - if (!resolvedPath) { - // Could not resolve the module, so skip it. - return typescript_1.default.visitEachChild(node, visitor, context); - } - const resolvedRelativePath = (0, posix_1.relative)(basePath, resolvedPath); - // Create the new property - // Example: `...(typeof ngServerMode !== "undefined" && ngServerMode ? { ɵentryName: "src/home.ts" }: {})` - const newProperty = factory.createSpreadAssignment(factory.createParenthesizedExpression(factory.createConditionalExpression(factory.createBinaryExpression(factory.createBinaryExpression(factory.createTypeOfExpression(factory.createIdentifier('ngServerMode')), factory.createToken(typescript_1.default.SyntaxKind.ExclamationEqualsEqualsToken), factory.createStringLiteral('undefined')), factory.createToken(typescript_1.default.SyntaxKind.AmpersandAmpersandToken), factory.createIdentifier('ngServerMode')), factory.createToken(typescript_1.default.SyntaxKind.QuestionToken), factory.createObjectLiteralExpression([ - factory.createPropertyAssignment(factory.createIdentifier('ɵentryName'), factory.createStringLiteral(resolvedRelativePath)), - ]), factory.createToken(typescript_1.default.SyntaxKind.ColonToken), factory.createObjectLiteralExpression([])))); - // Add the new property to the object literal. - return factory.updateObjectLiteralExpression(node, [...node.properties, newProperty]); - }; - return (sourceFile) => { - const text = sourceFile.text; - if (!text.includes('loadC')) { - // Fast check for 'loadComponent' and 'loadChildren'. - return sourceFile; - } - return typescript_1.default.visitEachChild(sourceFile, visitor, context); - }; - }; -} -/** - * Retrieves the property assignment for the `loadComponent` or `loadChildren` property of a route object. - * - * @param node The object literal expression to search. - * @returns The property assignment if found, otherwise `undefined`. - */ -function getLoadComponentOrChildrenProperty(node) { - let hasPathProperty = false; - let loadComponentOrChildrenProperty; - for (const prop of node.properties) { - if (!typescript_1.default.isPropertyAssignment(prop) || !typescript_1.default.isIdentifier(prop.name)) { - continue; - } - const propertyNameText = prop.name.text; - if (propertyNameText === 'path') { - hasPathProperty = true; - } - else if (propertyNameText === 'loadComponent' || propertyNameText === 'loadChildren') { - loadComponentOrChildrenProperty = prop; - } - if (hasPathProperty && loadComponentOrChildrenProperty) { - break; - } - } - return loadComponentOrChildrenProperty; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/web-worker-transformer.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/web-worker-transformer.d.ts deleted file mode 100755 index eff9fed..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/web-worker-transformer.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import ts from 'typescript'; -/** - * Creates a TypeScript Transformer to process Worker and SharedWorker entry points and transform - * the URL instances to reference the built and bundled worker code. This uses a callback process - * similar to the component stylesheets to allow the main esbuild plugin to process files as needed. - * Unsupported worker expressions will be left in their origin form. - * @param getTypeChecker A function that returns a TypeScript TypeChecker instance for the program. - * @returns A TypeScript transformer factory. - */ -export declare function createWorkerTransformer(fileProcessor: (file: string, importer: string) => string): ts.TransformerFactory; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/web-worker-transformer.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/web-worker-transformer.js deleted file mode 100755 index 2e86eb1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/transformers/web-worker-transformer.js +++ /dev/null @@ -1,93 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createWorkerTransformer = createWorkerTransformer; -const typescript_1 = __importDefault(require("typescript")); -/** - * Creates a TypeScript Transformer to process Worker and SharedWorker entry points and transform - * the URL instances to reference the built and bundled worker code. This uses a callback process - * similar to the component stylesheets to allow the main esbuild plugin to process files as needed. - * Unsupported worker expressions will be left in their origin form. - * @param getTypeChecker A function that returns a TypeScript TypeChecker instance for the program. - * @returns A TypeScript transformer factory. - */ -function createWorkerTransformer(fileProcessor) { - return (context) => { - const nodeFactory = context.factory; - const visitNode = (node) => { - // Check if the node is a valid new expression for a Worker or SharedWorker - // TODO: Add global scope check - if (!typescript_1.default.isNewExpression(node) || - !typescript_1.default.isIdentifier(node.expression) || - (node.expression.text !== 'Worker' && node.expression.text !== 'SharedWorker')) { - // Visit child nodes of non-Worker expressions - return typescript_1.default.visitEachChild(node, visitNode, context); - } - // Worker should have atleast one argument but not more than two - if (!node.arguments || node.arguments.length < 1 || node.arguments.length > 2) { - return node; - } - // First argument must be a new URL expression - const workerUrlNode = node.arguments[0]; - // TODO: Add global scope check - if (!typescript_1.default.isNewExpression(workerUrlNode) || - !typescript_1.default.isIdentifier(workerUrlNode.expression) || - workerUrlNode.expression.text !== 'URL') { - return node; - } - // URL must have 2 arguments - if (!workerUrlNode.arguments || workerUrlNode.arguments.length !== 2) { - return node; - } - // URL arguments must be a string and then `import.meta.url` - if (!typescript_1.default.isStringLiteralLike(workerUrlNode.arguments[0]) || - !typescript_1.default.isPropertyAccessExpression(workerUrlNode.arguments[1]) || - !typescript_1.default.isMetaProperty(workerUrlNode.arguments[1].expression) || - workerUrlNode.arguments[1].name.text !== 'url') { - return node; - } - const filePath = workerUrlNode.arguments[0].text; - const importer = node.getSourceFile().fileName; - // Process the file - const replacementPath = fileProcessor(filePath, importer); - // Update if the path changed - if (replacementPath !== filePath) { - return nodeFactory.updateNewExpression(node, node.expression, node.typeArguments, - // Update Worker arguments - typescript_1.default.setTextRange(nodeFactory.createNodeArray([ - nodeFactory.updateNewExpression(workerUrlNode, workerUrlNode.expression, workerUrlNode.typeArguments, - // Update URL arguments - typescript_1.default.setTextRange(nodeFactory.createNodeArray([ - nodeFactory.createStringLiteral(replacementPath), - workerUrlNode.arguments[1], - ], workerUrlNode.arguments.hasTrailingComma), workerUrlNode.arguments)), - // Use the second Worker argument (options) if present. - // Otherwise create a default options object for module Workers. - node.arguments[1] ?? - nodeFactory.createObjectLiteralExpression([ - nodeFactory.createPropertyAssignment('type', nodeFactory.createStringLiteral('module')), - ]), - ], node.arguments.hasTrailingComma), node.arguments)); - } - else { - return node; - } - }; - return (sourceFile) => { - // Skip transformer if there are no Workers - if (!sourceFile.text.includes('Worker')) { - return sourceFile; - } - return typescript_1.default.visitEachChild(sourceFile, visitNode, context); - }; - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/uri.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/uri.d.ts deleted file mode 100755 index 6e16912..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/uri.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -/** - * A string value representing the namespace for Angular JIT mode related imports for - * Component styles. This namespace is used for both inline (`styles`) and external - * (`styleUrls`) styles. - */ -export declare const JIT_STYLE_NAMESPACE: "angular:jit:style"; -/** - * A string value representing the namespace for Angular JIT mode related imports for - * Component templates. This namespace is currently only used for external (`templateUrl`) - * templates. - */ -export declare const JIT_TEMPLATE_NAMESPACE: "angular:jit:template"; -/** - * A regular expression that can be used to match a Angular JIT mode namespace URI. - * It contains capture groups for the type (template/style), origin (file/inline), and specifier. - * The {@link parseJitUri} function can be used to parse and return an object representation of a JIT URI. - */ -export declare const JIT_NAMESPACE_REGEXP: RegExp; -/** - * Generates an Angular JIT mode namespace URI for a given file. - * @param file The path of the file to be included. - * @param type The type of the file (`style` or `template`). - * @returns A string containing the full JIT namespace URI. - */ -export declare function generateJitFileUri(file: string, type: 'style' | 'template'): string; -/** - * Generates an Angular JIT mode namespace URI for a given inline style or template. - * The provided content is base64 encoded and included in the URI. - * @param data The content to encode within the URI. - * @param type The type of the content (`style` or `template`). - * @returns A string containing the full JIT namespace URI. - */ -export declare function generateJitInlineUri(data: string | Uint8Array, type: 'style' | 'template'): string; -/** - * Parses a string containing a JIT namespace URI. - * JIT namespace URIs are used to encode the information for an Angular component's stylesheets - * and templates when compiled in JIT mode. - * @param uri The URI to parse into its underlying components. - * @returns An object containing the namespace, type, origin, and specifier of the URI; - * `undefined` if not a JIT namespace URI. - */ -export declare function parseJitUri(uri: string): { - namespace: string; - type: "style" | "template"; - origin: "file" | "inline"; - specifier: string; -} | undefined; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/uri.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/uri.js deleted file mode 100755 index 7fe17c4..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/angular/uri.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.JIT_NAMESPACE_REGEXP = exports.JIT_TEMPLATE_NAMESPACE = exports.JIT_STYLE_NAMESPACE = void 0; -exports.generateJitFileUri = generateJitFileUri; -exports.generateJitInlineUri = generateJitInlineUri; -exports.parseJitUri = parseJitUri; -/** - * A string value representing the base namespace for Angular JIT mode related imports. - */ -const JIT_BASE_NAMESPACE = 'angular:jit'; -/** - * A string value representing the namespace for Angular JIT mode related imports for - * Component styles. This namespace is used for both inline (`styles`) and external - * (`styleUrls`) styles. - */ -exports.JIT_STYLE_NAMESPACE = `${JIT_BASE_NAMESPACE}:style`; -/** - * A string value representing the namespace for Angular JIT mode related imports for - * Component templates. This namespace is currently only used for external (`templateUrl`) - * templates. - */ -exports.JIT_TEMPLATE_NAMESPACE = `${JIT_BASE_NAMESPACE}:template`; -/** - * A regular expression that can be used to match a Angular JIT mode namespace URI. - * It contains capture groups for the type (template/style), origin (file/inline), and specifier. - * The {@link parseJitUri} function can be used to parse and return an object representation of a JIT URI. - */ -exports.JIT_NAMESPACE_REGEXP = new RegExp(`^${JIT_BASE_NAMESPACE}:(template|style):(file|inline);(.*)$`); -/** - * Generates an Angular JIT mode namespace URI for a given file. - * @param file The path of the file to be included. - * @param type The type of the file (`style` or `template`). - * @returns A string containing the full JIT namespace URI. - */ -function generateJitFileUri(file, type) { - return `${JIT_BASE_NAMESPACE}:${type}:file;${file}`; -} -/** - * Generates an Angular JIT mode namespace URI for a given inline style or template. - * The provided content is base64 encoded and included in the URI. - * @param data The content to encode within the URI. - * @param type The type of the content (`style` or `template`). - * @returns A string containing the full JIT namespace URI. - */ -function generateJitInlineUri(data, type) { - // Node.js types do not allow a string even though this is valid. - return `${JIT_BASE_NAMESPACE}:${type}:inline;${Buffer.from(data).toString('base64')}`; -} -/** - * Parses a string containing a JIT namespace URI. - * JIT namespace URIs are used to encode the information for an Angular component's stylesheets - * and templates when compiled in JIT mode. - * @param uri The URI to parse into its underlying components. - * @returns An object containing the namespace, type, origin, and specifier of the URI; - * `undefined` if not a JIT namespace URI. - */ -function parseJitUri(uri) { - const matches = exports.JIT_NAMESPACE_REGEXP.exec(uri); - if (!matches) { - return undefined; - } - return { - namespace: `${JIT_BASE_NAMESPACE}:${matches[1]}`, - type: matches[1], - origin: matches[2], - specifier: matches[3], - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/add-code-coverage.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/add-code-coverage.d.ts deleted file mode 100755 index e91a8e4..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/add-code-coverage.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { PluginObj } from '@babel/core'; -/** - * A babel plugin factory function for adding istanbul instrumentation. - * - * @returns A babel plugin object instance. - */ -export default function (): PluginObj; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/add-code-coverage.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/add-code-coverage.js deleted file mode 100755 index 6cb4cdf..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/add-code-coverage.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = default_1; -const core_1 = require("@babel/core"); -const istanbul_lib_instrument_1 = require("istanbul-lib-instrument"); -const node_assert_1 = __importDefault(require("node:assert")); -/** - * A babel plugin factory function for adding istanbul instrumentation. - * - * @returns A babel plugin object instance. - */ -function default_1() { - const visitors = new WeakMap(); - return { - visitor: { - Program: { - enter(path, state) { - const visitor = (0, istanbul_lib_instrument_1.programVisitor)(core_1.types, state.filename, { - // Babel returns a Converter object from the `convert-source-map` package - inputSourceMap: state.file.inputMap?.toObject(), - }); - visitors.set(path, visitor); - visitor.enter(path); - }, - exit(path) { - const visitor = visitors.get(path); - (0, node_assert_1.default)(visitor, 'Instrumentation visitor should always be present for program path.'); - visitor.exit(path); - visitors.delete(path); - }, - }, - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-static-class-members.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-static-class-members.d.ts deleted file mode 100755 index 88921ca..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-static-class-members.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { PluginObj } from '@babel/core'; -/** - * Provides one or more keywords that if found within the content of a source file indicate - * that this plugin should be used with a source file. - * - * @returns An a string iterable containing one or more keywords. - */ -export declare function getKeywords(): Iterable; -/** - * A babel plugin factory function for adjusting classes; primarily with Angular metadata. - * The adjustments include wrapping classes with known safe or no side effects with pure - * annotations to support dead code removal of unused classes. Angular compiler generated - * metadata static fields not required in AOT mode are also elided to better support bundler- - * level treeshaking. - * - * @returns A babel plugin object instance. - */ -export default function (): PluginObj; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-static-class-members.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-static-class-members.js deleted file mode 100755 index b025f70..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-static-class-members.js +++ /dev/null @@ -1,348 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getKeywords = getKeywords; -exports.default = default_1; -const core_1 = require("@babel/core"); -const helper_annotate_as_pure_1 = __importDefault(require("@babel/helper-annotate-as-pure")); -const helper_split_export_declaration_1 = __importDefault(require("@babel/helper-split-export-declaration")); -/** - * The name of the Typescript decorator helper function created by the TypeScript compiler. - */ -const TSLIB_DECORATE_HELPER_NAME = '__decorate'; -/** - * The set of Angular static fields that should always be wrapped. - * These fields may appear to have side effects but are safe to remove if the associated class - * is otherwise unused within the output. - */ -const angularStaticsToWrap = new Set([ - 'ɵcmp', - 'ɵdir', - 'ɵfac', - 'ɵinj', - 'ɵmod', - 'ɵpipe', - 'ɵprov', - 'INJECTOR_KEY', -]); -/** - * An object map of static fields and related value checks for discovery of Angular generated - * JIT related static fields. - */ -const angularStaticsToElide = { - 'ctorParameters'(path) { - return path.isFunctionExpression() || path.isArrowFunctionExpression(); - }, - 'decorators'(path) { - return path.isArrayExpression(); - }, - 'propDecorators'(path) { - return path.isObjectExpression(); - }, -}; -/** - * Provides one or more keywords that if found within the content of a source file indicate - * that this plugin should be used with a source file. - * - * @returns An a string iterable containing one or more keywords. - */ -function getKeywords() { - return ['class']; -} -/** - * Determines whether a property and its initializer value can be safely wrapped in a pure - * annotated IIFE. Values that may cause side effects are not considered safe to wrap. - * Wrapping such values may cause runtime errors and/or incorrect runtime behavior. - * - * @param propertyName The name of the property to analyze. - * @param assignmentValue The initializer value that will be assigned to the property. - * @returns If the property can be safely wrapped, then true; otherwise, false. - */ -function canWrapProperty(propertyName, assignmentValue) { - if (angularStaticsToWrap.has(propertyName)) { - return true; - } - const { leadingComments } = assignmentValue.node; - if (leadingComments?.some( - // `@pureOrBreakMyCode` is used by closure and is present in Angular code - ({ value }) => value.includes('@__PURE__') || - value.includes('#__PURE__') || - value.includes('@pureOrBreakMyCode'))) { - return true; - } - return assignmentValue.isPure(); -} -/** - * Analyze the sibling nodes of a class to determine if any downlevel elements should be - * wrapped in a pure annotated IIFE. Also determines if any elements have potential side - * effects. - * - * @param origin The starting NodePath location for analyzing siblings. - * @param classIdentifier The identifier node that represents the name of the class. - * @param allowWrappingDecorators Whether to allow decorators to be wrapped. - * @returns An object containing the results of the analysis. - */ -function analyzeClassSiblings(origin, classIdentifier, allowWrappingDecorators) { - const wrapStatementPaths = []; - let hasPotentialSideEffects = false; - for (let i = 1;; ++i) { - const nextStatement = origin.getSibling(+(origin.key ?? 0) + i); - if (!nextStatement.isExpressionStatement()) { - break; - } - // Valid sibling statements for class declarations are only assignment expressions - // and TypeScript decorator helper call expressions - const nextExpression = nextStatement.get('expression'); - if (nextExpression.isCallExpression()) { - if (!core_1.types.isIdentifier(nextExpression.node.callee) || - nextExpression.node.callee.name !== TSLIB_DECORATE_HELPER_NAME) { - break; - } - if (allowWrappingDecorators) { - wrapStatementPaths.push(nextStatement); - } - else { - // Statement cannot be safely wrapped which makes wrapping the class unneeded. - // The statement will prevent even a wrapped class from being optimized away. - hasPotentialSideEffects = true; - } - continue; - } - else if (!nextExpression.isAssignmentExpression()) { - break; - } - // Valid assignment expressions should be member access expressions using the class - // name as the object and an identifier as the property for static fields or only - // the class name for decorators. - const left = nextExpression.get('left'); - if (left.isIdentifier()) { - if (!left.scope.bindingIdentifierEquals(left.node.name, classIdentifier) || - !core_1.types.isCallExpression(nextExpression.node.right) || - !core_1.types.isIdentifier(nextExpression.node.right.callee) || - nextExpression.node.right.callee.name !== TSLIB_DECORATE_HELPER_NAME) { - break; - } - if (allowWrappingDecorators) { - wrapStatementPaths.push(nextStatement); - } - else { - // Statement cannot be safely wrapped which makes wrapping the class unneeded. - // The statement will prevent even a wrapped class from being optimized away. - hasPotentialSideEffects = true; - } - continue; - } - else if (!left.isMemberExpression() || - !core_1.types.isIdentifier(left.node.object) || - !left.scope.bindingIdentifierEquals(left.node.object.name, classIdentifier) || - !core_1.types.isIdentifier(left.node.property)) { - break; - } - const propertyName = left.node.property.name; - const assignmentValue = nextExpression.get('right'); - if (angularStaticsToElide[propertyName]?.(assignmentValue)) { - nextStatement.remove(); - --i; - } - else if (canWrapProperty(propertyName, assignmentValue)) { - wrapStatementPaths.push(nextStatement); - } - else { - // Statement cannot be safely wrapped which makes wrapping the class unneeded. - // The statement will prevent even a wrapped class from being optimized away. - hasPotentialSideEffects = true; - } - } - return { hasPotentialSideEffects, wrapStatementPaths }; -} -/** - * The set of classes already visited and analyzed during the plugin's execution. - * This is used to prevent adjusted classes from being repeatedly analyzed which can lead - * to an infinite loop. - */ -const visitedClasses = new WeakSet(); -/** - * A map of classes that have already been analyzed during the default export splitting step. - * This is used to avoid analyzing a class declaration twice if it is a direct default export. - */ -const exportDefaultAnalysis = new WeakMap(); -/** - * A babel plugin factory function for adjusting classes; primarily with Angular metadata. - * The adjustments include wrapping classes with known safe or no side effects with pure - * annotations to support dead code removal of unused classes. Angular compiler generated - * metadata static fields not required in AOT mode are also elided to better support bundler- - * level treeshaking. - * - * @returns A babel plugin object instance. - */ -// eslint-disable-next-line max-lines-per-function -function default_1() { - return { - visitor: { - // When a class is converted to a variable declaration, the default export must be moved - // to a subsequent statement to prevent a JavaScript syntax error. - ExportDefaultDeclaration(path, state) { - const declaration = path.get('declaration'); - if (!declaration.isClassDeclaration() || !declaration.node.id) { - return; - } - const { wrapDecorators } = state.opts; - const analysis = analyzeClassSiblings(path, declaration.node.id, wrapDecorators); - exportDefaultAnalysis.set(declaration.node, analysis); - // Splitting the export declaration is not needed if the class will not be wrapped - if (analysis.hasPotentialSideEffects) { - return; - } - (0, helper_split_export_declaration_1.default)(path); - }, - ClassDeclaration(path, state) { - const { node: classNode, parentPath } = path; - const { wrapDecorators } = state.opts; - // Skip if already visited or has no name - if (visitedClasses.has(classNode) || !classNode.id) { - return; - } - // Analyze sibling statements for elements of the class that were downleveled - const origin = parentPath.isExportNamedDeclaration() ? parentPath : path; - const { wrapStatementPaths, hasPotentialSideEffects } = exportDefaultAnalysis.get(classNode) ?? - analyzeClassSiblings(origin, classNode.id, wrapDecorators); - visitedClasses.add(classNode); - // If no statements to wrap, check for static class properties. - if (hasPotentialSideEffects || - (wrapStatementPaths.length === 0 && !analyzeClassStaticProperties(path).shouldWrap)) { - return; - } - const wrapStatementNodes = []; - for (const statementPath of wrapStatementPaths) { - wrapStatementNodes.push(statementPath.node); - statementPath.remove(); - } - // Wrap class and safe static assignments in a pure annotated IIFE - const container = core_1.types.arrowFunctionExpression([], core_1.types.blockStatement([ - classNode, - ...wrapStatementNodes, - core_1.types.returnStatement(core_1.types.cloneNode(classNode.id)), - ])); - const replacementInitializer = core_1.types.callExpression(core_1.types.parenthesizedExpression(container), []); - (0, helper_annotate_as_pure_1.default)(replacementInitializer); - // Replace class with IIFE wrapped class - const declaration = core_1.types.variableDeclaration('let', [ - core_1.types.variableDeclarator(core_1.types.cloneNode(classNode.id), replacementInitializer), - ]); - path.replaceWith(declaration); - }, - ClassExpression(path, state) { - const { node: classNode, parentPath } = path; - const { wrapDecorators } = state.opts; - if (visitedClasses.has(classNode)) { - return; - } - if (!parentPath.isVariableDeclarator() || !core_1.types.isIdentifier(parentPath.node.id)) { - return; - } - const origin = parentPath.parentPath; - if (!origin.isVariableDeclaration() || origin.node.declarations.length !== 1) { - return; - } - const { wrapStatementPaths, hasPotentialSideEffects } = analyzeClassSiblings(origin, parentPath.node.id, wrapDecorators); - visitedClasses.add(classNode); - // If no statements to wrap, check for static class properties. - if (hasPotentialSideEffects || - (wrapStatementPaths.length === 0 && !analyzeClassStaticProperties(path).shouldWrap)) { - return; - } - const wrapStatementNodes = []; - for (const statementPath of wrapStatementPaths) { - wrapStatementNodes.push(statementPath.node); - statementPath.remove(); - } - // Wrap class and safe static assignments in a pure annotated IIFE - const container = core_1.types.arrowFunctionExpression([], core_1.types.blockStatement([ - core_1.types.variableDeclaration('let', [ - core_1.types.variableDeclarator(core_1.types.cloneNode(parentPath.node.id), classNode), - ]), - ...wrapStatementNodes, - core_1.types.returnStatement(core_1.types.cloneNode(parentPath.node.id)), - ])); - const replacementInitializer = core_1.types.callExpression(core_1.types.parenthesizedExpression(container), []); - (0, helper_annotate_as_pure_1.default)(replacementInitializer); - // Add the wrapped class directly to the variable declaration - parentPath.get('init').replaceWith(replacementInitializer); - }, - }, - }; -} -/** - * Static class properties may be downleveled at later stages in the build pipeline - * which results in additional function calls outside the class body. These calls - * then cause the class to be referenced and not eligible for removal. Since it is - * not known at this stage whether the class needs to be downleveled, the transform - * wraps classes preemptively to allow for potential removal within the optimization stages. - */ -function analyzeClassStaticProperties(path) { - let shouldWrap = false; - for (const element of path.get('body').get('body')) { - if (element.isClassProperty()) { - // Only need to analyze static properties - if (!element.node.static) { - continue; - } - // Check for potential side effects. - // These checks are conservative and could potentially be expanded in the future. - const elementKey = element.get('key'); - const elementValue = element.get('value'); - if (elementKey.isIdentifier() && - (!elementValue.isExpression() || canWrapProperty(elementKey.node.name, elementValue))) { - shouldWrap = true; - } - else { - // Not safe to wrap - shouldWrap = false; - break; - } - } - else if (element.isStaticBlock()) { - // Only need to analyze static blocks - const body = element.get('body'); - if (Array.isArray(body) && body.length > 1) { - // Not safe to wrap - shouldWrap = false; - break; - } - const expression = body.find((n) => n.isExpressionStatement()); - const assignmentExpression = expression?.get('expression'); - if (assignmentExpression?.isAssignmentExpression()) { - const left = assignmentExpression.get('left'); - if (!left.isMemberExpression()) { - continue; - } - if (!left.get('object').isThisExpression()) { - // Not safe to wrap - shouldWrap = false; - break; - } - const element = left.get('property'); - const right = assignmentExpression.get('right'); - if (element.isIdentifier() && - (!right.isExpression() || canWrapProperty(element.node.name, right))) { - shouldWrap = true; - } - else { - // Not safe to wrap - shouldWrap = false; - break; - } - } - } - } - return { shouldWrap }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-typescript-enums.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-typescript-enums.d.ts deleted file mode 100755 index 15ff0c0..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-typescript-enums.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { PluginObj } from '@babel/core'; -/** - * Provides one or more keywords that if found within the content of a source file indicate - * that this plugin should be used with a source file. - * - * @returns An a string iterable containing one or more keywords. - */ -export declare function getKeywords(): Iterable; -/** - * A babel plugin factory function for adjusting TypeScript emitted enums. - * - * @returns A babel plugin object instance. - */ -export default function (): PluginObj; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-typescript-enums.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-typescript-enums.js deleted file mode 100755 index d92ca9a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/adjust-typescript-enums.js +++ /dev/null @@ -1,112 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getKeywords = getKeywords; -exports.default = default_1; -const core_1 = require("@babel/core"); -const helper_annotate_as_pure_1 = __importDefault(require("@babel/helper-annotate-as-pure")); -/** - * Provides one or more keywords that if found within the content of a source file indicate - * that this plugin should be used with a source file. - * - * @returns An a string iterable containing one or more keywords. - */ -function getKeywords() { - return ['var']; -} -/** - * A babel plugin factory function for adjusting TypeScript emitted enums. - * - * @returns A babel plugin object instance. - */ -function default_1() { - return { - visitor: { - VariableDeclaration(path) { - const { parentPath, node } = path; - if (node.kind !== 'var' || node.declarations.length !== 1) { - return; - } - const declaration = path.get('declarations')[0]; - if (declaration.node.init) { - return; - } - const declarationId = declaration.node.id; - if (!core_1.types.isIdentifier(declarationId)) { - return; - } - const hasExport = parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration(); - const origin = hasExport ? parentPath : path; - const nextStatement = origin.getSibling(+(origin.key ?? 0) + 1); - if (!nextStatement.isExpressionStatement()) { - return; - } - const nextExpression = nextStatement.get('expression'); - if (!nextExpression.isCallExpression() || nextExpression.node.arguments.length !== 1) { - return; - } - const enumCallArgument = nextExpression.get('arguments')[0]; - if (!enumCallArgument.isLogicalExpression({ operator: '||' })) { - return; - } - const leftCallArgument = enumCallArgument.get('left'); - const rightCallArgument = enumCallArgument.get('right'); - // Check if identifiers match var declaration - if (!leftCallArgument.isIdentifier() || - !nextExpression.scope.bindingIdentifierEquals(leftCallArgument.node.name, declarationId) || - !rightCallArgument.isAssignmentExpression()) { - return; - } - const enumCallee = nextExpression.get('callee'); - if (!enumCallee.isFunctionExpression() || enumCallee.node.params.length !== 1) { - return; - } - const parameterId = enumCallee.get('params')[0]; - if (!parameterId.isIdentifier()) { - return; - } - // Check if all enum member values are pure. - // If not, leave as-is due to potential side efects - let hasElements = false; - for (const enumStatement of enumCallee.get('body').get('body')) { - if (!enumStatement.isExpressionStatement()) { - return; - } - const enumValueAssignment = enumStatement.get('expression'); - if (!enumValueAssignment.isAssignmentExpression() || - !enumValueAssignment.get('right').isPure()) { - return; - } - hasElements = true; - } - // If there are no enum elements then there is nothing to wrap - if (!hasElements) { - return; - } - // Update right-side of initializer call argument to remove redundant assignment - if (rightCallArgument.get('left').isIdentifier()) { - rightCallArgument.replaceWith(rightCallArgument.get('right')); - } - // Add a return statement to the enum initializer block - enumCallee - .get('body') - .node.body.push(core_1.types.returnStatement(core_1.types.cloneNode(parameterId.node))); - // Remove existing enum initializer - const enumInitializer = nextExpression.node; - nextExpression.remove(); - (0, helper_annotate_as_pure_1.default)(enumInitializer); - // Add the wrapped enum initializer directly to the variable declaration - declaration.get('init').replaceWith(enumInitializer); - }, - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/elide-angular-metadata.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/elide-angular-metadata.d.ts deleted file mode 100755 index b13292b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/elide-angular-metadata.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { PluginObj } from '@babel/core'; -/** - * Provides one or more keywords that if found within the content of a source file indicate - * that this plugin should be used with a source file. - * - * @returns An a string iterable containing one or more keywords. - */ -export declare function getKeywords(): Iterable; -/** - * A babel plugin factory function for eliding the Angular class metadata function (`ɵsetClassMetadata`). - * - * @returns A babel plugin object instance. - */ -export default function (): PluginObj; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/elide-angular-metadata.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/elide-angular-metadata.js deleted file mode 100755 index 432f247..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/elide-angular-metadata.js +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getKeywords = getKeywords; -exports.default = default_1; -/** - * The name of the Angular class metadata function created by the Angular compiler. - */ -const SET_CLASS_METADATA_NAME = 'ɵsetClassMetadata'; -/** - * Name of the asynchronous Angular class metadata function created by the Angular compiler. - */ -const SET_CLASS_METADATA_ASYNC_NAME = 'ɵsetClassMetadataAsync'; -/** - * Name of the function that sets debug information on classes. - */ -const SET_CLASS_DEBUG_INFO_NAME = 'ɵsetClassDebugInfo'; -/** - * Provides one or more keywords that if found within the content of a source file indicate - * that this plugin should be used with a source file. - * - * @returns An a string iterable containing one or more keywords. - */ -function getKeywords() { - return Object.keys(angularMetadataFunctions); -} -/** - * An object map of function names and related value checks for discovery of Angular generated - * metadata calls. - */ -const angularMetadataFunctions = { - [SET_CLASS_METADATA_NAME]: isSetClassMetadataCall, - [SET_CLASS_METADATA_ASYNC_NAME]: isSetClassMetadataAsyncCall, - [SET_CLASS_DEBUG_INFO_NAME]: isSetClassDebugInfoCall, -}; -/** - * A babel plugin factory function for eliding the Angular class metadata function (`ɵsetClassMetadata`). - * - * @returns A babel plugin object instance. - */ -function default_1() { - return { - visitor: { - CallExpression(path) { - const callee = path.get('callee'); - // The function being called must be the metadata function name - let calleeName; - if (callee.isMemberExpression()) { - const calleeProperty = callee.get('property'); - if (calleeProperty.isIdentifier()) { - calleeName = calleeProperty.node.name; - } - } - else if (callee.isIdentifier()) { - calleeName = callee.node.name; - } - if (!calleeName) { - return; - } - if (Object.hasOwn(angularMetadataFunctions, calleeName) && - angularMetadataFunctions[calleeName](path.get('arguments'))) { - // The metadata function is always emitted inside a function expression - const parent = path.getFunctionParent(); - if (parent && (parent.isFunctionExpression() || parent.isArrowFunctionExpression())) { - // Replace the metadata function with `void 0` which is the equivalent return value - // of the metadata function. - path.replaceWith(path.scope.buildUndefinedNode()); - } - } - }, - }, - }; -} -/** Determines if a function call is a call to `setClassMetadata`. */ -function isSetClassMetadataCall(callArguments) { - // `setClassMetadata` calls have to meet the following criteria: - // * First must be an identifier - // * Second must be an array literal - return (callArguments.length === 4 && - callArguments[0].isIdentifier() && - callArguments[1].isArrayExpression()); -} -/** Determines if a function call is a call to `setClassMetadataAsync`. */ -function isSetClassMetadataAsyncCall(callArguments) { - // `setClassMetadataAsync` calls have to meet the following criteria: - // * First argument must be an identifier. - // * Second argument must be an inline function. - // * Third argument must be an inline function. - return (callArguments.length === 3 && - callArguments[0].isIdentifier() && - isInlineFunction(callArguments[1]) && - isInlineFunction(callArguments[2])); -} -/** Determines if a function call is a call to `setClassDebugInfo`. */ -function isSetClassDebugInfoCall(callArguments) { - return (callArguments.length === 2 && - callArguments[0].isIdentifier() && - callArguments[1].isObjectExpression()); -} -/** Determines if a node is an inline function expression. */ -function isInlineFunction(path) { - return path.isFunctionExpression() || path.isArrowFunctionExpression(); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/index.d.ts deleted file mode 100755 index 94f4fe6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export { default as adjustStaticMembers } from './adjust-static-class-members'; -export { default as adjustTypeScriptEnums } from './adjust-typescript-enums'; -export { default as elideAngularMetadata } from './elide-angular-metadata'; -export { default as markTopLevelPure } from './pure-toplevel-functions'; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/index.js deleted file mode 100755 index 1cfa47d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.markTopLevelPure = exports.elideAngularMetadata = exports.adjustTypeScriptEnums = exports.adjustStaticMembers = void 0; -var adjust_static_class_members_1 = require("./adjust-static-class-members"); -Object.defineProperty(exports, "adjustStaticMembers", { enumerable: true, get: function () { return __importDefault(adjust_static_class_members_1).default; } }); -var adjust_typescript_enums_1 = require("./adjust-typescript-enums"); -Object.defineProperty(exports, "adjustTypeScriptEnums", { enumerable: true, get: function () { return __importDefault(adjust_typescript_enums_1).default; } }); -var elide_angular_metadata_1 = require("./elide-angular-metadata"); -Object.defineProperty(exports, "elideAngularMetadata", { enumerable: true, get: function () { return __importDefault(elide_angular_metadata_1).default; } }); -var pure_toplevel_functions_1 = require("./pure-toplevel-functions"); -Object.defineProperty(exports, "markTopLevelPure", { enumerable: true, get: function () { return __importDefault(pure_toplevel_functions_1).default; } }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/pure-toplevel-functions.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/pure-toplevel-functions.d.ts deleted file mode 100755 index cea439b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/pure-toplevel-functions.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { PluginObj } from '@babel/core'; -/** - * A babel plugin factory function for adding the PURE annotation to top-level new and call expressions. - * @returns A babel plugin object instance. - */ -export default function (): PluginObj; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/pure-toplevel-functions.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/pure-toplevel-functions.js deleted file mode 100755 index cb6b2bc..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/pure-toplevel-functions.js +++ /dev/null @@ -1,127 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = default_1; -const helper_annotate_as_pure_1 = __importDefault(require("@babel/helper-annotate-as-pure")); -const tslib = __importStar(require("tslib")); -/** - * A set of constructor names that are considered to be side-effect free. - */ -const sideEffectFreeConstructors = new Set(['InjectionToken']); -/** - * A set of TypeScript helper function names used by the helper name matcher utility function. - */ -const tslibHelpers = new Set(Object.keys(tslib).filter((h) => h.startsWith('__'))); -/** - * Determinates whether an identifier name matches one of the TypeScript helper function names. - * - * @param name The identifier name to check. - * @returns True, if the name matches a TypeScript helper name; otherwise, false. - */ -function isTslibHelperName(name) { - const nameParts = name.split('$'); - const originalName = nameParts[0]; - if (nameParts.length > 2 || (nameParts.length === 2 && isNaN(+nameParts[1]))) { - return false; - } - return tslibHelpers.has(originalName); -} -const babelHelpers = new Set(['_defineProperty']); -/** - * Determinates whether an identifier name matches one of the Babel helper function names. - * - * @param name The identifier name to check. - * @returns True, if the name matches a Babel helper name; otherwise, false. - */ -function isBabelHelperName(name) { - return babelHelpers.has(name); -} -/** - * A babel plugin factory function for adding the PURE annotation to top-level new and call expressions. - * @returns A babel plugin object instance. - */ -function default_1() { - return { - visitor: { - CallExpression(path, state) { - const { topLevelSafeMode = false } = state.opts; - if (topLevelSafeMode) { - return; - } - // If the expression has a function parent, it is not top-level - if (path.getFunctionParent()) { - return; - } - const callee = path.get('callee'); - if ((callee.isFunctionExpression() || callee.isArrowFunctionExpression()) && - path.node.arguments.length !== 0) { - return; - } - // Do not annotate TypeScript helpers emitted by the TypeScript compiler or Babel helpers. - // They are intended to cause side effects. - if (callee.isIdentifier() && - (isTslibHelperName(callee.node.name) || isBabelHelperName(callee.node.name))) { - return; - } - (0, helper_annotate_as_pure_1.default)(path); - }, - NewExpression(path, state) { - // If the expression has a function parent, it is not top-level - if (path.getFunctionParent()) { - return; - } - const { topLevelSafeMode = false } = state.opts; - if (!topLevelSafeMode) { - (0, helper_annotate_as_pure_1.default)(path); - return; - } - const callee = path.get('callee'); - if (callee.isIdentifier() && sideEffectFreeConstructors.has(callee.node.name)) { - (0, helper_annotate_as_pure_1.default)(path); - } - }, - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/types.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/types.d.ts deleted file mode 100755 index 4ff052d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/plugins/types.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -declare module 'istanbul-lib-instrument' { - export interface Visitor { - enter(path: import('@babel/core').NodePath): void; - exit(path: import('@babel/core').NodePath): void; - } - - export function programVisitor( - types: typeof import('@babel/core').types, - filePath?: string, - options?: { inputSourceMap?: object | null }, - ): Visitor; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/typings.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/typings.d.ts deleted file mode 100755 index c2132a9..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/babel/typings.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -declare module '@babel/helper-annotate-as-pure' { - export default function annotateAsPure( - pathOrNode: import('@babel/types').Node | { node: import('@babel/types').Node }, - ): void; -} - -declare module '@babel/helper-split-export-declaration' { - export default function splitExportDeclaration( - exportDeclaration: import('@babel/core').NodePath< - import('@babel/types').ExportDefaultDeclaration - >, - ): void; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular-localize-init-warning-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular-localize-init-warning-plugin.d.ts deleted file mode 100755 index 9c28da6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular-localize-init-warning-plugin.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -/** - * This plugin addresses an issue where '@angular/localize/init' is directly imported, - * potentially resulting in undefined behavior. By detecting such imports, the plugin - * issues a warning and suggests including '@angular/localize/init' as a polyfill. - * - * @returns An esbuild plugin. - */ -export declare function createAngularLocalizeInitWarningPlugin(): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular-localize-init-warning-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular-localize-init-warning-plugin.js deleted file mode 100755 index e7cf17e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular-localize-init-warning-plugin.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularLocalizeInitWarningPlugin = createAngularLocalizeInitWarningPlugin; -const NG_LOCALIZE_RESOLUTION = Symbol('NG_LOCALIZE_RESOLUTION'); -/** - * This plugin addresses an issue where '@angular/localize/init' is directly imported, - * potentially resulting in undefined behavior. By detecting such imports, the plugin - * issues a warning and suggests including '@angular/localize/init' as a polyfill. - * - * @returns An esbuild plugin. - */ -function createAngularLocalizeInitWarningPlugin() { - return { - name: 'angular-localize-init-warning', - setup(build) { - build.onResolve({ filter: /^@angular\/localize\/init/ }, async (args) => { - if (args.pluginData?.[NG_LOCALIZE_RESOLUTION]) { - return null; - } - const { importer, kind, resolveDir, namespace, pluginData = {} } = args; - pluginData[NG_LOCALIZE_RESOLUTION] = true; - const result = await build.resolve(args.path, { - importer, - kind, - namespace, - pluginData, - resolveDir, - }); - return { - ...result, - warnings: [ - ...result.warnings, - { - text: `Direct import of '@angular/localize/init' detected. This may lead to undefined behavior.`, - notes: [{ text: `Include '@angular/localize/init' as a polyfill instead.` }], - }, - ], - }; - }); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compilation-state.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compilation-state.d.ts deleted file mode 100755 index ef34531..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compilation-state.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare class SharedTSCompilationState { - #private; - get waitUntilReady(): Promise; - markAsReady(hasErrors: boolean): void; - markAsInProgress(): void; - dispose(): void; -} -export declare function getSharedCompilationState(): SharedTSCompilationState; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compilation-state.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compilation-state.js deleted file mode 100755 index cd321be..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compilation-state.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SharedTSCompilationState = void 0; -exports.getSharedCompilationState = getSharedCompilationState; -class SharedTSCompilationState { - #pendingCompilation = true; - #resolveCompilationReady; - #compilationReadyPromise; - #hasErrors = true; - get waitUntilReady() { - if (!this.#pendingCompilation) { - return Promise.resolve(this.#hasErrors); - } - this.#compilationReadyPromise ??= new Promise((resolve) => { - this.#resolveCompilationReady = resolve; - }); - return this.#compilationReadyPromise; - } - markAsReady(hasErrors) { - this.#hasErrors = hasErrors; - this.#resolveCompilationReady?.(hasErrors); - this.#compilationReadyPromise = undefined; - this.#pendingCompilation = false; - } - markAsInProgress() { - this.#pendingCompilation = true; - } - dispose() { - this.markAsReady(true); - globalSharedCompilationState = undefined; - } -} -exports.SharedTSCompilationState = SharedTSCompilationState; -let globalSharedCompilationState; -function getSharedCompilationState() { - return (globalSharedCompilationState ??= new SharedTSCompilationState()); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compiler-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compiler-plugin.d.ts deleted file mode 100755 index 34efbb1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compiler-plugin.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -import { AngularCompilation } from '../../angular/compilation'; -import { LoadResultCache } from '../load-result-cache'; -import { ComponentStylesheetBundler } from './component-stylesheets'; -import { SourceFileCache } from './source-file-cache'; -export interface CompilerPluginOptions { - sourcemap: boolean | 'external'; - tsconfig: string; - jit?: boolean; - /** - * Include class metadata and JIT information in built code. - * The Angular TestBed APIs require additional metadata for the Angular aspects of the application - * such as Components, Modules, Pipes, etc. - * TestBed may also leverage JIT capabilities during testing (e.g., overrideComponent). - */ - includeTestMetadata?: boolean; - advancedOptimizations?: boolean; - thirdPartySourcemaps?: boolean; - fileReplacements?: Record; - sourceFileCache?: SourceFileCache; - loadResultCache?: LoadResultCache; - incremental: boolean; - externalRuntimeStyles?: boolean; - instrumentForCoverage?: (request: string) => boolean; - templateUpdates?: Map; -} -export declare function createCompilerPlugin(pluginOptions: CompilerPluginOptions, compilationOrFactory: AngularCompilation | (() => Promise), stylesheetBundler: ComponentStylesheetBundler): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compiler-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compiler-plugin.js deleted file mode 100755 index ee68408..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/compiler-plugin.js +++ /dev/null @@ -1,605 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createCompilerPlugin = createCompilerPlugin; -const node_assert_1 = __importDefault(require("node:assert")); -const node_crypto_1 = require("node:crypto"); -const path = __importStar(require("node:path")); -const environment_options_1 = require("../../../utils/environment-options"); -const compilation_1 = require("../../angular/compilation"); -const javascript_transformer_1 = require("../javascript-transformer"); -const load_result_cache_1 = require("../load-result-cache"); -const profiling_1 = require("../profiling"); -const compilation_state_1 = require("./compilation-state"); -const file_reference_tracker_1 = require("./file-reference-tracker"); -const jit_plugin_callbacks_1 = require("./jit-plugin-callbacks"); -const rewrite_bazel_paths_1 = require("./rewrite-bazel-paths"); -// eslint-disable-next-line max-lines-per-function -function createCompilerPlugin(pluginOptions, compilationOrFactory, stylesheetBundler) { - return { - name: 'angular-compiler', - // eslint-disable-next-line max-lines-per-function - async setup(build) { - let setupWarnings = []; - const preserveSymlinks = build.initialOptions.preserveSymlinks; - // Initialize a worker pool for JavaScript transformations. - // Webcontainers currently do not support this persistent cache store. - let cacheStore; - if (pluginOptions.sourceFileCache?.persistentCachePath && !process.versions.webcontainer) { - try { - const { LmbdCacheStore } = await Promise.resolve().then(() => __importStar(require('../lmdb-cache-store'))); - cacheStore = new LmbdCacheStore(path.join(pluginOptions.sourceFileCache.persistentCachePath, 'angular-compiler.db')); - } - catch (e) { - setupWarnings.push({ - text: 'Unable to initialize JavaScript cache storage.', - location: null, - notes: [ - // Only show first line of lmdb load error which has platform support listed - { text: e?.message.split('\n')[0] ?? `${e}` }, - { - text: 'This will not affect the build output content but may result in slower builds.', - }, - ], - }); - } - } - const javascriptTransformer = new javascript_transformer_1.JavaScriptTransformer({ - sourcemap: !!pluginOptions.sourcemap, - thirdPartySourcemaps: pluginOptions.thirdPartySourcemaps, - advancedOptimizations: pluginOptions.advancedOptimizations, - jit: pluginOptions.jit || pluginOptions.includeTestMetadata, - }, environment_options_1.maxWorkers, cacheStore?.createCache('jstransformer')); - // Setup defines based on the values used by the Angular compiler-cli - build.initialOptions.define ??= {}; - build.initialOptions.define['ngI18nClosureMode'] ??= 'false'; - // The factory is only relevant for compatibility purposes with the private API. - // TODO: Update private API in the next major to allow compilation function factory removal here. - const compilation = typeof compilationOrFactory === 'function' - ? await compilationOrFactory() - : compilationOrFactory; - // The in-memory cache of TypeScript file outputs will be used during the build in `onLoad` callbacks for TS files. - // A string value indicates direct TS/NG output and a Uint8Array indicates fully transformed code. - const typeScriptFileCache = pluginOptions.sourceFileCache?.typeScriptFileCache ?? - new Map(); - // The resources from component stylesheets and web workers that will be added to the build results output files - const additionalResults = new Map(); - // Compilation is initially assumed to have errors until emitted - let hasCompilationErrors = true; - // Determines if TypeScript should process JavaScript files based on tsconfig `allowJs` option - let shouldTsIgnoreJs = true; - // Determines if transpilation should be handle by TypeScript or esbuild - let useTypeScriptTranspilation = true; - let sharedTSCompilationState; - // To fully invalidate files, track resource referenced files and their referencing source - const referencedFileTracker = new file_reference_tracker_1.FileReferenceTracker(); - // eslint-disable-next-line max-lines-per-function - build.onStart(async () => { - sharedTSCompilationState = (0, compilation_state_1.getSharedCompilationState)(); - if (!(compilation instanceof compilation_1.NoopCompilation)) { - sharedTSCompilationState.markAsInProgress(); - } - const result = { - warnings: setupWarnings, - }; - // Reset debug performance tracking - (0, profiling_1.resetCumulativeDurations)(); - // Update the reference tracker and generate a full set of modified files for the - // Angular compiler which does not have direct knowledge of transitive resource - // dependencies or web worker processing. - let modifiedFiles; - if (!(compilation instanceof compilation_1.NoopCompilation) && - pluginOptions.sourceFileCache?.modifiedFiles.size) { - // TODO: Differentiate between changed input files and stale output files - modifiedFiles = referencedFileTracker.update(pluginOptions.sourceFileCache.modifiedFiles); - pluginOptions.sourceFileCache.invalidate(modifiedFiles); - // External runtime styles are invalidated and rebuilt at the beginning of a rebuild to avoid - // the need to execute the application bundler for component style only changes. - if (!pluginOptions.externalRuntimeStyles) { - stylesheetBundler.invalidate(modifiedFiles); - } - // Remove any stale additional results based on modified files - modifiedFiles.forEach((file) => additionalResults.delete(file)); - } - if (compilation.update && pluginOptions.sourceFileCache?.modifiedFiles.size) { - await compilation.update(modifiedFiles ?? pluginOptions.sourceFileCache.modifiedFiles); - } - // Create Angular compiler host options - const hostOptions = { - fileReplacements: pluginOptions.fileReplacements, - modifiedFiles, - sourceFileCache: pluginOptions.sourceFileCache, - async transformStylesheet(data, containingFile, stylesheetFile, order, className) { - let stylesheetResult; - let resultSource = stylesheetFile ?? containingFile; - // Stylesheet file only exists for external stylesheets - if (stylesheetFile) { - stylesheetResult = await stylesheetBundler.bundleFile(stylesheetFile); - } - else { - stylesheetResult = await stylesheetBundler.bundleInline(data, containingFile, - // Inline stylesheets from a template style element are always CSS; Otherwise, use default. - containingFile.endsWith('.html') ? 'css' : undefined, - // When external runtime styles are enabled, an identifier for the style that does not change - // based on the content is required to avoid emitted JS code changes. Any JS code changes will - // invalid the output and force a full page reload for HMR cases. The containing file and order - // of the style within the containing file is used. - pluginOptions.externalRuntimeStyles - ? (0, node_crypto_1.createHash)('sha256') - .update(containingFile) - .update((order ?? 0).toString()) - .update(className ?? '') - .digest('hex') - : undefined); - // Adjust result source for inline styles. - // There may be multiple inline styles with the same containing file and to ensure that the results - // do not overwrite each other the result source identifier needs to be unique for each. The class - // name and order fields can be used for this. The structure is arbitrary as long as it is unique. - resultSource += `?class=${className}&order=${order}`; - } - (result.warnings ??= []).push(...stylesheetResult.warnings); - if (stylesheetResult.errors) { - (result.errors ??= []).push(...stylesheetResult.errors); - return ''; - } - const { contents, outputFiles, metafile, referencedFiles } = stylesheetResult; - additionalResults.set(resultSource, { - outputFiles, - metafile, - }); - if (referencedFiles) { - referencedFileTracker.add(containingFile, referencedFiles); - if (stylesheetFile) { - // Angular AOT compiler needs modified direct resource files to correctly invalidate its analysis - referencedFileTracker.add(stylesheetFile, referencedFiles); - } - } - return contents; - }, - processWebWorker(workerFile, containingFile) { - const fullWorkerPath = path.join(path.dirname(containingFile), workerFile); - // The synchronous API must be used due to the TypeScript compilation currently being - // fully synchronous and this process callback being called from within a TypeScript - // transformer. - const workerResult = bundleWebWorker(build, pluginOptions, fullWorkerPath); - (result.warnings ??= []).push(...workerResult.warnings); - if (workerResult.errors.length > 0) { - (result.errors ??= []).push(...workerResult.errors); - // Track worker file errors to allow rebuilds on changes - referencedFileTracker.add(containingFile, workerResult.errors - .map((error) => error.location?.file) - .filter((file) => !!file) - .map((file) => path.join(build.initialOptions.absWorkingDir ?? '', file))); - additionalResults.set(fullWorkerPath, { errors: result.errors }); - // Return the original path if the build failed - return workerFile; - } - (0, node_assert_1.default)('outputFiles' in workerResult, 'Invalid web worker bundle result.'); - additionalResults.set(fullWorkerPath, { - outputFiles: workerResult.outputFiles, - metafile: workerResult.metafile, - }); - referencedFileTracker.add(containingFile, Object.keys(workerResult.metafile.inputs).map((input) => path.join(build.initialOptions.absWorkingDir ?? '', input))); - // Return bundled worker file entry name to be used in the built output - const workerCodeFile = workerResult.outputFiles.find((file) => /^worker-[A-Z0-9]{8}.[cm]?js$/.test(path.basename(file.path))); - (0, node_assert_1.default)(workerCodeFile, 'Web Worker bundled code file should always be present.'); - const workerCodePath = path.relative(build.initialOptions.outdir ?? '', workerCodeFile.path); - return workerCodePath.replaceAll('\\', '/'); - }, - }; - // Initialize the Angular compilation for the current build. - // In watch mode, previous build state will be reused. - let referencedFiles; - let externalStylesheets; - try { - const initializationResult = await compilation.initialize(pluginOptions.tsconfig, hostOptions, createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks, build.initialOptions.conditions)); - shouldTsIgnoreJs = !initializationResult.compilerOptions.allowJs; - // Isolated modules option ensures safe non-TypeScript transpilation. - // Typescript printing support for sourcemaps is not yet integrated. - useTypeScriptTranspilation = - !initializationResult.compilerOptions.isolatedModules || - !!initializationResult.compilerOptions.sourceMap || - !!initializationResult.compilerOptions.inlineSourceMap; - referencedFiles = initializationResult.referencedFiles; - externalStylesheets = initializationResult.externalStylesheets; - if (initializationResult.templateUpdates) { - // Propagate any template updates - initializationResult.templateUpdates.forEach((value, key) => pluginOptions.templateUpdates?.set(key, value)); - } - } - catch (error) { - (result.errors ??= []).push({ - text: 'Angular compilation initialization failed.', - location: null, - notes: [ - { - text: error instanceof Error ? (error.stack ?? error.message) : `${error}`, - location: null, - }, - ], - }); - // Initialization failure prevents further compilation steps - hasCompilationErrors = true; - return result; - } - if (compilation instanceof compilation_1.NoopCompilation) { - hasCompilationErrors = await sharedTSCompilationState.waitUntilReady; - return result; - } - if (externalStylesheets) { - // Process any new external stylesheets - for (const [stylesheetFile, externalId] of externalStylesheets) { - await bundleExternalStylesheet(stylesheetBundler, stylesheetFile, externalId, result, additionalResults); - } - } - // Update TypeScript file output cache for all affected files - try { - await (0, profiling_1.profileAsync)('NG_EMIT_TS', async () => { - for (const { filename, contents } of await compilation.emitAffectedFiles()) { - typeScriptFileCache.set(path.normalize(filename), contents); - } - }); - } - catch (error) { - (result.errors ??= []).push({ - text: 'Angular compilation emit failed.', - location: null, - notes: [ - { - text: error instanceof Error ? (error.stack ?? error.message) : `${error}`, - location: null, - }, - ], - }); - } - const diagnostics = await compilation.diagnoseFiles(environment_options_1.useTypeChecking ? compilation_1.DiagnosticModes.All : compilation_1.DiagnosticModes.All & ~compilation_1.DiagnosticModes.Semantic); - if (diagnostics.errors?.length) { - (result.errors ??= []).push(...diagnostics.errors); - } - if (diagnostics.warnings?.length) { - (result.warnings ??= []).push(...diagnostics.warnings); - } - // Add errors from failed additional results. - // This must be done after emit to capture latest web worker results. - for (const { errors } of additionalResults.values()) { - if (errors) { - (result.errors ??= []).push(...errors); - } - } - // Store referenced files for updated file watching if enabled - if (pluginOptions.sourceFileCache) { - pluginOptions.sourceFileCache.referencedFiles = [ - ...referencedFiles, - ...referencedFileTracker.referencedFiles, - ]; - } - hasCompilationErrors = !!result.errors?.length; - // Reset the setup warnings so that they are only shown during the first build. - setupWarnings = undefined; - sharedTSCompilationState.markAsReady(hasCompilationErrors); - return result; - }); - build.onLoad({ filter: /\.[cm]?[jt]sx?$/ }, async (args) => { - const request = (0, rewrite_bazel_paths_1.rewriteForBazel)(path.normalize(pluginOptions.fileReplacements?.[path.normalize(args.path)] ?? args.path)); - const isJS = /\.[cm]?js$/.test(request); - // Skip TS load attempt if JS TypeScript compilation not enabled and file is JS - if (shouldTsIgnoreJs && isJS) { - return undefined; - } - // The filename is currently used as a cache key. Since the cache is memory only, - // the options cannot change and do not need to be represented in the key. If the - // cache is later stored to disk, then the options that affect transform output - // would need to be added to the key as well as a check for any change of content. - let contents = typeScriptFileCache.get(request); - if (contents === undefined) { - // If the Angular compilation had errors the file may not have been emitted. - // To avoid additional errors about missing files, return empty contents. - if (hasCompilationErrors) { - return { contents: '', loader: 'js' }; - } - // No TS result indicates the file is not part of the TypeScript program. - // If allowJs is enabled and the file is JS then defer to the next load hook. - if (!shouldTsIgnoreJs && isJS) { - return undefined; - } - // Otherwise return an error - return { - errors: [ - createMissingFileError(request, args.path, build.initialOptions.absWorkingDir ?? ''), - ], - }; - } - else if (typeof contents === 'string' && (useTypeScriptTranspilation || isJS)) { - // A string indicates untransformed output from the TS/NG compiler. - // This step is unneeded when using esbuild transpilation. - const sideEffects = await hasSideEffects(request); - const instrumentForCoverage = pluginOptions.instrumentForCoverage?.(request); - contents = await javascriptTransformer.transformData(request, contents, true /* skipLinker */, sideEffects, instrumentForCoverage); - // Store as the returned Uint8Array to allow caching the fully transformed code - typeScriptFileCache.set(request, contents); - } - let loader; - if (useTypeScriptTranspilation || isJS) { - // TypeScript has transpiled to JS or is already JS - loader = 'js'; - } - else if (request.at(-1) === 'x') { - // TSX and TS have different syntax rules. Only set if input is a TSX file. - loader = 'tsx'; - } - else { - // Otherwise, directly bundle TS - loader = 'ts'; - } - return { - contents, - loader, - resolveDir: path.dirname(request), - }; - }); - build.onLoad({ filter: /\.[cm]?js$/ }, (0, load_result_cache_1.createCachedLoad)(pluginOptions.loadResultCache, async (args) => { - let request = (0, rewrite_bazel_paths_1.rewriteForBazel)(args.path); - if (pluginOptions.fileReplacements) { - const replacement = pluginOptions.fileReplacements[path.normalize(args.path)]; - if (replacement) { - request = path.normalize(replacement); - } - } - return (0, profiling_1.profileAsync)('NG_EMIT_JS*', async () => { - const sideEffects = await hasSideEffects(request); - const contents = await javascriptTransformer.transformFile(request, pluginOptions.jit, sideEffects); - return { - contents, - loader: 'js', - resolveDir: path.dirname(request), - watchFiles: request !== args.path ? [request] : undefined, - }; - }, true); - })); - // Add a load handler if there are file replacement option entries for JSON files - if (pluginOptions.fileReplacements && - Object.keys(pluginOptions.fileReplacements).some((value) => value.endsWith('.json'))) { - build.onLoad({ filter: /\.json$/ }, (0, load_result_cache_1.createCachedLoad)(pluginOptions.loadResultCache, async (args) => { - const replacement = pluginOptions.fileReplacements?.[path.normalize(args.path)]; - if (replacement) { - return { - contents: await Promise.resolve().then(() => __importStar(require('node:fs/promises'))).then(({ readFile }) => readFile(path.normalize(replacement))), - loader: 'json', - watchFiles: [replacement], - }; - } - // If no replacement defined, let esbuild handle it directly - return null; - })); - } - // Setup bundling of component templates and stylesheets when in JIT mode - if (pluginOptions.jit) { - (0, jit_plugin_callbacks_1.setupJitPluginCallbacks)(build, stylesheetBundler, additionalResults, pluginOptions.loadResultCache); - } - build.onEnd((result) => { - // Ensure other compilations are unblocked if the main compilation throws during start - sharedTSCompilationState?.markAsReady(hasCompilationErrors); - for (const { outputFiles, metafile } of additionalResults.values()) { - // Add any additional output files to the main output files - if (outputFiles?.length) { - result.outputFiles?.push(...outputFiles); - } - // Combine additional metafiles with main metafile - if (result.metafile && metafile) { - // Append the existing object, by appending to it we prevent unnecessary new objections creations with spread - // mitigating significant performance overhead for large apps. - // See: https://bugs.chromium.org/p/v8/issues/detail?id=11536 - Object.assign(result.metafile.inputs, metafile.inputs); - Object.assign(result.metafile.outputs, metafile.outputs); - } - } - (0, profiling_1.logCumulativeDurations)(); - }); - build.onDispose(() => { - sharedTSCompilationState?.dispose(); - void compilation.close?.(); - void cacheStore?.close(); - }); - /** - * Checks if the file has side-effects when `advancedOptimizations` is enabled. - */ - async function hasSideEffects(path) { - if (!pluginOptions.advancedOptimizations) { - return undefined; - } - const { sideEffects } = await build.resolve(path, { - kind: 'import-statement', - resolveDir: build.initialOptions.absWorkingDir ?? '', - }); - return sideEffects; - } - }, - }; -} -async function bundleExternalStylesheet(stylesheetBundler, stylesheetFile, externalId, result, additionalResults) { - const styleResult = await stylesheetBundler.bundleFile(stylesheetFile, externalId); - (result.warnings ??= []).push(...styleResult.warnings); - if (styleResult.errors) { - (result.errors ??= []).push(...styleResult.errors); - } - else { - const { outputFiles, metafile } = styleResult; - // Clear inputs to prevent triggering a rebuild of the application code for component - // stylesheet file only changes when the dev server enables the internal-only external - // stylesheet option. This does not affect builds since only the dev server can enable - // the internal option. - metafile.inputs = {}; - additionalResults.set(stylesheetFile, { - outputFiles, - metafile, - }); - } -} -function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks, customConditions) { - return (compilerOptions) => { - // target of 9 is ES2022 (using the number avoids an expensive import of typescript just for an enum) - if (compilerOptions.target === undefined || compilerOptions.target < 9 /** ES2022 */) { - // If 'useDefineForClassFields' is already defined in the users project leave the value as is. - // Otherwise fallback to false due to https://github.com/microsoft/TypeScript/issues/45995 - // which breaks the deprecated `@Effects` NGRX decorator and potentially other existing code as well. - compilerOptions.target = 9 /** ES2022 */; - compilerOptions.useDefineForClassFields ??= false; - // Only add the warning on the initial build - setupWarnings?.push({ - text: `TypeScript compiler options 'target' and 'useDefineForClassFields' are set to 'ES2022' and ` + - `'false' respectively by the Angular CLI.`, - location: { file: pluginOptions.tsconfig }, - notes: [ - { - text: 'To control ECMA version and features use the Browserslist configuration. ' + - 'For more information, see https://angular.dev/tools/cli/build#configuring-browser-compatibility', - }, - ], - }); - } - if (compilerOptions.compilationMode === 'partial') { - setupWarnings?.push({ - text: 'Angular partial compilation mode is not supported when building applications.', - location: null, - notes: [{ text: 'Full compilation mode will be used instead.' }], - }); - compilerOptions.compilationMode = 'full'; - } - // Enable incremental compilation by default if caching is enabled and incremental is not explicitly disabled - if (compilerOptions.incremental !== false && - pluginOptions.sourceFileCache?.persistentCachePath) { - compilerOptions.incremental = true; - // Set the build info file location to the configured cache directory - compilerOptions.tsBuildInfoFile = path.join(pluginOptions.sourceFileCache?.persistentCachePath, '.tsbuildinfo'); - } - else { - compilerOptions.incremental = false; - } - if (compilerOptions.module === undefined || compilerOptions.module < 5 /** ES2015 */) { - compilerOptions.module = 7; /** ES2022 */ - setupWarnings?.push({ - text: `TypeScript compiler options 'module' values 'CommonJS', 'UMD', 'System' and 'AMD' are not supported.`, - location: null, - notes: [{ text: `The 'module' option will be set to 'ES2022' instead.` }], - }); - } - if (compilerOptions.isolatedModules && compilerOptions.emitDecoratorMetadata) { - setupWarnings?.push({ - text: `TypeScript compiler option 'isolatedModules' may prevent the 'emitDecoratorMetadata' option from emitting all metadata.`, - location: null, - notes: [ - { - text: `The 'emitDecoratorMetadata' option is not required by Angular` + - 'and can be removed if not explictly required by the project.', - }, - ], - }); - } - // Synchronize custom resolve conditions. - // Set if using the supported bundler resolution mode (bundler is the default in new projects) - if (compilerOptions.moduleResolution === 100 /* ModuleResolutionKind.Bundler */ || - compilerOptions.module === 200 /** ModuleKind.Preserve */) { - compilerOptions.customConditions = customConditions; - } - return { - ...compilerOptions, - noEmitOnError: false, - composite: false, - inlineSources: !!pluginOptions.sourcemap, - inlineSourceMap: !!pluginOptions.sourcemap, - sourceMap: undefined, - mapRoot: undefined, - sourceRoot: undefined, - preserveSymlinks, - externalRuntimeStyles: pluginOptions.externalRuntimeStyles, - _enableHmr: !!pluginOptions.templateUpdates, - supportTestBed: !!pluginOptions.includeTestMetadata, - supportJitMode: !!pluginOptions.includeTestMetadata, - }; - }; -} -function bundleWebWorker(build, pluginOptions, workerFile) { - try { - return build.esbuild.buildSync({ - ...build.initialOptions, - platform: 'browser', - write: false, - bundle: true, - metafile: true, - format: 'esm', - entryNames: 'worker-[hash]', - entryPoints: [workerFile], - sourcemap: pluginOptions.sourcemap, - // Zone.js is not used in Web workers so no need to disable - supported: undefined, - // Plugins are not supported in sync esbuild calls - plugins: undefined, - }); - } - catch (error) { - if (error && typeof error === 'object' && 'errors' in error && 'warnings' in error) { - return error; - } - throw error; - } -} -function createMissingFileError(request, original, root) { - const relativeRequest = path.relative(root, request); - const error = { - text: `File '${relativeRequest}' is missing from the TypeScript compilation.`, - notes: [ - { - text: `Ensure the file is part of the TypeScript program via the 'files' or 'include' property.`, - }, - ], - }; - const relativeOriginal = path.relative(root, original); - if (relativeRequest !== relativeOriginal) { - error.notes.push({ - text: `File is requested from a file replacement of '${relativeOriginal}'.`, - }); - } - return error; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/component-stylesheets.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/component-stylesheets.d.ts deleted file mode 100755 index 5190bdc..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/component-stylesheets.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BundleContextResult } from '../bundler-context'; -import { BundleStylesheetOptions } from '../stylesheets/bundle-options'; -export type ComponentStylesheetResult = BundleContextResult & { - contents: string; - referencedFiles: Set | undefined; -}; -/** - * Bundles component stylesheets. A stylesheet can be either an inline stylesheet that - * is contained within the Component's metadata definition or an external file referenced - * from the Component's metadata definition. - */ -export declare class ComponentStylesheetBundler { - #private; - private readonly options; - private readonly defaultInlineLanguage; - private readonly incremental; - /** - * - * @param options An object containing the stylesheet bundling options. - * @param cache A load result cache to use when bundling. - */ - constructor(options: BundleStylesheetOptions, defaultInlineLanguage: string, incremental: boolean); - /** - * Bundle a file-based component stylesheet for use within an AOT compiled Angular application. - * @param entry The file path of the stylesheet. - * @param externalId Either an external identifier string for initial bundling or a boolean for rebuilds, if external. - * @param direct If true, the output will be used directly by the builder; false if used inside the compiler plugin. - * @returns A component bundle result object. - */ - bundleFile(entry: string, externalId?: string | boolean, direct?: boolean): Promise; - bundleAllFiles(external: boolean, direct: boolean): Promise; - bundleInline(data: string, filename: string, language?: string, externalId?: string): Promise; - /** - * Invalidates both file and inline based component style bundling state for a set of modified files. - * @param files The group of files that have been modified - * @returns An array of file based stylesheet entries if any were invalidated; otherwise, undefined. - */ - invalidate(files: Iterable): string[] | undefined; - collectReferencedFiles(): string[]; - dispose(): Promise; - private extractResult; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/component-stylesheets.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/component-stylesheets.js deleted file mode 100755 index 2e31ab5..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/component-stylesheets.js +++ /dev/null @@ -1,221 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ComponentStylesheetBundler = void 0; -const node_assert_1 = __importDefault(require("node:assert")); -const node_crypto_1 = require("node:crypto"); -const node_path_1 = __importDefault(require("node:path")); -const bundler_context_1 = require("../bundler-context"); -const cache_1 = require("../cache"); -const bundle_options_1 = require("../stylesheets/bundle-options"); -/** - * Bundles component stylesheets. A stylesheet can be either an inline stylesheet that - * is contained within the Component's metadata definition or an external file referenced - * from the Component's metadata definition. - */ -class ComponentStylesheetBundler { - options; - defaultInlineLanguage; - incremental; - #fileContexts = new cache_1.MemoryCache(); - #inlineContexts = new cache_1.MemoryCache(); - /** - * - * @param options An object containing the stylesheet bundling options. - * @param cache A load result cache to use when bundling. - */ - constructor(options, defaultInlineLanguage, incremental) { - this.options = options; - this.defaultInlineLanguage = defaultInlineLanguage; - this.incremental = incremental; - } - /** - * Bundle a file-based component stylesheet for use within an AOT compiled Angular application. - * @param entry The file path of the stylesheet. - * @param externalId Either an external identifier string for initial bundling or a boolean for rebuilds, if external. - * @param direct If true, the output will be used directly by the builder; false if used inside the compiler plugin. - * @returns A component bundle result object. - */ - async bundleFile(entry, externalId, direct) { - const bundlerContext = await this.#fileContexts.getOrCreate(entry, () => { - return new bundler_context_1.BundlerContext(this.options.workspaceRoot, this.incremental, (loadCache) => { - const buildOptions = (0, bundle_options_1.createStylesheetBundleOptions)(this.options, loadCache); - if (externalId) { - (0, node_assert_1.default)(typeof externalId === 'string', 'Initial external component stylesheets must have a string identifier'); - buildOptions.entryPoints = { [externalId]: entry }; - buildOptions.entryNames = '[name]'; - delete buildOptions.publicPath; - } - else { - buildOptions.entryPoints = [entry]; - } - // Angular encapsulation does not support nesting - // See: https://github.com/angular/angular/issues/58996 - buildOptions.supported ??= {}; - buildOptions.supported['nesting'] = false; - return buildOptions; - }); - }); - return this.extractResult(await bundlerContext.bundle(), bundlerContext.watchFiles, !!externalId, !!direct); - } - bundleAllFiles(external, direct) { - return Promise.all(Array.from(this.#fileContexts.entries()).map(([entry]) => this.bundleFile(entry, external, direct))); - } - async bundleInline(data, filename, language = this.defaultInlineLanguage, externalId) { - // Use a hash of the inline stylesheet content to ensure a consistent identifier. External stylesheets will resolve - // to the actual stylesheet file path. - // TODO: Consider xxhash instead for hashing - const id = (0, node_crypto_1.createHash)('sha256') - .update(data) - .update(externalId ?? '') - .digest('hex'); - const entry = [language, id, filename].join(';'); - const bundlerContext = await this.#inlineContexts.getOrCreate(entry, () => { - const namespace = 'angular:styles/component'; - return new bundler_context_1.BundlerContext(this.options.workspaceRoot, this.incremental, (loadCache) => { - const buildOptions = (0, bundle_options_1.createStylesheetBundleOptions)(this.options, loadCache, { - [entry]: data, - }); - if (externalId) { - buildOptions.entryPoints = { [externalId]: `${namespace};${entry}` }; - buildOptions.entryNames = '[name]'; - delete buildOptions.publicPath; - } - else { - buildOptions.entryPoints = [`${namespace};${entry}`]; - } - // Angular encapsulation does not support nesting - // See: https://github.com/angular/angular/issues/58996 - buildOptions.supported ??= {}; - buildOptions.supported['nesting'] = false; - buildOptions.plugins.push({ - name: 'angular-component-styles', - setup(build) { - build.onResolve({ filter: /^angular:styles\/component;/ }, (args) => { - if (args.kind !== 'entry-point') { - return null; - } - return { - path: entry, - namespace, - }; - }); - build.onLoad({ filter: /^css;/, namespace }, () => { - return { - contents: data, - loader: 'css', - resolveDir: node_path_1.default.dirname(filename), - }; - }); - }, - }); - return buildOptions; - }); - }); - // Extract the result of the bundling from the output files - return this.extractResult(await bundlerContext.bundle(), bundlerContext.watchFiles, !!externalId, false); - } - /** - * Invalidates both file and inline based component style bundling state for a set of modified files. - * @param files The group of files that have been modified - * @returns An array of file based stylesheet entries if any were invalidated; otherwise, undefined. - */ - invalidate(files) { - if (!this.incremental) { - return; - } - const normalizedFiles = [...files].map(node_path_1.default.normalize); - let entries; - for (const [entry, bundler] of this.#fileContexts.entries()) { - if (bundler.invalidate(normalizedFiles)) { - entries ??= []; - entries.push(entry); - } - } - for (const bundler of this.#inlineContexts.values()) { - bundler.invalidate(normalizedFiles); - } - return entries; - } - collectReferencedFiles() { - const files = []; - for (const context of this.#fileContexts.values()) { - files.push(...context.watchFiles); - } - return files; - } - async dispose() { - const contexts = [...this.#fileContexts.values(), ...this.#inlineContexts.values()]; - this.#fileContexts.clear(); - this.#inlineContexts.clear(); - await Promise.allSettled(contexts.map((context) => context.dispose())); - } - extractResult(result, referencedFiles, external, direct) { - let contents = ''; - const outputFiles = []; - const { errors, warnings } = result; - if (errors) { - return { errors, warnings, referencedFiles, contents: '' }; - } - for (const outputFile of result.outputFiles) { - const filename = node_path_1.default.basename(outputFile.path); - if (outputFile.type === bundler_context_1.BuildOutputFileType.Media || filename.endsWith('.css.map')) { - // The output files could also contain resources (images/fonts/etc.) that were referenced and the map files. - // Clone the output file to avoid amending the original path which would causes problems during rebuild. - const clonedOutputFile = outputFile.clone(); - // Needed for Bazel as otherwise the files will not be written in the correct place, - // this is because esbuild will resolve the output file from the outdir which is currently set to `workspaceRoot` twice, - // once in the stylesheet and the other in the application code bundler. - // Ex: `../../../../../app.component.css.map`. - if (!direct) { - clonedOutputFile.path = node_path_1.default.join(this.options.workspaceRoot, outputFile.path); - } - outputFiles.push(clonedOutputFile); - } - else if (filename.endsWith('.css')) { - if (external) { - const clonedOutputFile = outputFile.clone(); - if (!direct) { - clonedOutputFile.path = node_path_1.default.join(this.options.workspaceRoot, outputFile.path); - } - outputFiles.push(clonedOutputFile); - contents = node_path_1.default.posix.join(this.options.publicPath ?? '', filename); - } - else { - contents = outputFile.text; - } - } - else { - throw new Error(`Unexpected non CSS/Media file "${filename}" outputted during component stylesheet processing.`); - } - } - const metafile = result.metafile; - // Remove entryPoint fields from outputs to prevent the internal component styles from being - // treated as initial files. Also mark the entry as a component resource for stat reporting. - Object.values(metafile.outputs).forEach((output) => { - delete output.entryPoint; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - output['ng-component'] = true; - }); - return { - errors, - warnings, - contents, - outputFiles, - metafile, - referencedFiles, - externalImports: result.externalImports, - initialFiles: new Map(), - }; - } -} -exports.ComponentStylesheetBundler = ComponentStylesheetBundler; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/diagnostics.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/diagnostics.d.ts deleted file mode 100755 index 061d45f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/diagnostics.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { PartialMessage } from 'esbuild'; -import type ts from 'typescript'; -/** - * Converts a TypeScript Diagnostic message into an esbuild compatible message object. - * @param diagnostic The TypeScript diagnostic to convert. - * @returns An esbuild diagnostic message as a PartialMessage object - */ -export declare function convertTypeScriptDiagnostic(typescript: typeof ts, diagnostic: ts.Diagnostic): PartialMessage; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/diagnostics.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/diagnostics.js deleted file mode 100755 index 192c513..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/diagnostics.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.convertTypeScriptDiagnostic = convertTypeScriptDiagnostic; -const node_os_1 = require("node:os"); -/** - * Converts TypeScript Diagnostic related information into an esbuild compatible note object. - * Related information is a subset of a full TypeScript Diagnostic and also used for diagnostic - * notes associated with the main Diagnostic. - * @param info The TypeScript diagnostic relative information to convert. - * @returns An esbuild diagnostic message as a PartialMessage object - */ -function convertTypeScriptDiagnosticInfo(typescript, info, textPrefix) { - const newLine = (0, node_os_1.platform)() === 'win32' ? '\r\n' : '\n'; - let text = typescript.flattenDiagnosticMessageText(info.messageText, newLine); - if (textPrefix) { - text = textPrefix + text; - } - const note = { text }; - if (info.file) { - note.location = { - file: info.file.fileName, - length: info.length, - }; - // Calculate the line/column location and extract the full line text that has the diagnostic - if (info.start) { - const { line, character } = typescript.getLineAndCharacterOfPosition(info.file, info.start); - note.location.line = line + 1; - note.location.column = character; - // The start position for the slice is the first character of the error line - const lineStartPosition = typescript.getPositionOfLineAndCharacter(info.file, line, 0); - // The end position for the slice is the first character of the next line or the length of - // the entire file if the line is the last line of the file (getPositionOfLineAndCharacter - // will error if a nonexistent line is passed). - const { line: lastLineOfFile } = typescript.getLineAndCharacterOfPosition(info.file, info.file.text.length - 1); - const lineEndPosition = line < lastLineOfFile - ? typescript.getPositionOfLineAndCharacter(info.file, line + 1, 0) - : info.file.text.length; - note.location.lineText = info.file.text.slice(lineStartPosition, lineEndPosition).trimEnd(); - } - } - return note; -} -/** - * Converts a TypeScript Diagnostic message into an esbuild compatible message object. - * @param diagnostic The TypeScript diagnostic to convert. - * @returns An esbuild diagnostic message as a PartialMessage object - */ -function convertTypeScriptDiagnostic(typescript, diagnostic) { - let codePrefix = 'TS'; - let code = `${diagnostic.code}`; - // Custom ngtsc diagnostics are prefixed with -99 which isn't a valid TypeScript diagnostic code. - // Strip it and mark the diagnostic as coming from Angular. Note that we can't rely on - // `diagnostic.source`, because it isn't always produced. This is identical to: - // https://github.com/angular/angular/blob/main/packages/compiler-cli/src/ngtsc/diagnostics/src/util.ts - if (code.startsWith('-99')) { - codePrefix = 'NG'; - code = code.slice(3); - } - const message = convertTypeScriptDiagnosticInfo(typescript, diagnostic, `${codePrefix}${code}: `); - if (diagnostic.relatedInformation?.length) { - message.notes = diagnostic.relatedInformation.map((info) => convertTypeScriptDiagnosticInfo(typescript, info)); - } - return message; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/file-reference-tracker.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/file-reference-tracker.d.ts deleted file mode 100755 index e5db202..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/file-reference-tracker.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare class FileReferenceTracker { - #private; - get referencedFiles(): MapIterator; - add(containingFile: string, referencedFiles: Iterable): void; - /** - * - * @param changed The set of changed files. - */ - update(changed: Set): Set; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/file-reference-tracker.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/file-reference-tracker.js deleted file mode 100755 index 37ff827..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/file-reference-tracker.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FileReferenceTracker = void 0; -const node_path_1 = require("node:path"); -class FileReferenceTracker { - #referencingFiles = new Map(); - get referencedFiles() { - return this.#referencingFiles.keys(); - } - add(containingFile, referencedFiles) { - const normalizedContainingFile = (0, node_path_1.normalize)(containingFile); - for (const file of referencedFiles) { - const normalizedReferencedFile = (0, node_path_1.normalize)(file); - if (normalizedReferencedFile === normalizedContainingFile) { - // Containing file is already known to the AOT compiler - continue; - } - const referencing = this.#referencingFiles.get(normalizedReferencedFile); - if (referencing === undefined) { - this.#referencingFiles.set(normalizedReferencedFile, new Set([normalizedContainingFile])); - } - else { - referencing.add(normalizedContainingFile); - } - } - } - /** - * - * @param changed The set of changed files. - */ - update(changed) { - // Lazily initialized to avoid unneeded copying if there are no additions to return - let allChangedFiles; - // Add referencing files to fully notify the AOT compiler of required component updates - for (const modifiedFile of changed) { - const normalizedModifiedFile = (0, node_path_1.normalize)(modifiedFile); - const referencing = this.#referencingFiles.get(normalizedModifiedFile); - if (referencing) { - allChangedFiles ??= new Set(changed); - for (const referencingFile of referencing) { - allChangedFiles.add(referencingFile); - } - // Cleanup the stale record which will be updated by new resource transforms - this.#referencingFiles.delete(normalizedModifiedFile); - } - } - return allChangedFiles ?? changed; - } -} -exports.FileReferenceTracker = FileReferenceTracker; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts deleted file mode 100755 index bb98a26..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Metafile, OutputFile, PluginBuild } from 'esbuild'; -import { LoadResultCache } from '../load-result-cache'; -import { ComponentStylesheetBundler } from './component-stylesheets'; -/** - * Sets up esbuild resolve and load callbacks to support Angular JIT mode processing - * for both Component stylesheets and templates. These callbacks work alongside the JIT - * resource TypeScript transformer to convert and then bundle Component resources as - * static imports. - * @param build An esbuild {@link PluginBuild} instance used to add callbacks. - * @param styleOptions The options to use when bundling stylesheets. - * @param additionalResultFiles A Map where stylesheet resources will be added. - */ -export declare function setupJitPluginCallbacks(build: PluginBuild, stylesheetBundler: ComponentStylesheetBundler, additionalResultFiles: Map, loadCache?: LoadResultCache): void; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/jit-plugin-callbacks.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/jit-plugin-callbacks.js deleted file mode 100755 index 23fae0d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/jit-plugin-callbacks.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.setupJitPluginCallbacks = setupJitPluginCallbacks; -const promises_1 = require("node:fs/promises"); -const node_path_1 = require("node:path"); -const uri_1 = require("../../angular/uri"); -const load_result_cache_1 = require("../load-result-cache"); -/** - * Loads/extracts the contents from a load callback Angular JIT entry. - * An Angular JIT entry represents either a file path for a component resource or base64 - * encoded data for an inline component resource. - * @param entry The value that represents content to load. - * @param root The absolute path for the root of the build (typically the workspace root). - * @param skipRead If true, do not attempt to read the file; if false, read file content from disk. - * This option has no effect if the entry does not originate from a file. Defaults to false. - * @returns An object containing the absolute path of the contents and optionally the actual contents. - * For inline entries the contents will always be provided. - */ -async function loadEntry(entry, root, skipRead) { - if (entry.startsWith('inline:')) { - const [importer, data] = entry.slice(7).split(';', 2); - return { - path: (0, node_path_1.join)(root, importer), - contents: Buffer.from(data, 'base64').toString(), - }; - } - const path = (0, node_path_1.join)(root, entry); - return { - path, - contents: skipRead ? undefined : await (0, promises_1.readFile)(path, 'utf-8'), - }; -} -/** - * Sets up esbuild resolve and load callbacks to support Angular JIT mode processing - * for both Component stylesheets and templates. These callbacks work alongside the JIT - * resource TypeScript transformer to convert and then bundle Component resources as - * static imports. - * @param build An esbuild {@link PluginBuild} instance used to add callbacks. - * @param styleOptions The options to use when bundling stylesheets. - * @param additionalResultFiles A Map where stylesheet resources will be added. - */ -function setupJitPluginCallbacks(build, stylesheetBundler, additionalResultFiles, loadCache) { - const root = build.initialOptions.absWorkingDir ?? ''; - // Add a resolve callback to capture and parse any JIT URIs that were added by the - // JIT resource TypeScript transformer. - // Resources originating from a file are resolved as relative from the containing file (importer). - build.onResolve({ filter: uri_1.JIT_NAMESPACE_REGEXP }, (args) => { - const parsed = (0, uri_1.parseJitUri)(args.path); - if (!parsed) { - return undefined; - } - const { namespace, origin, specifier } = parsed; - if (origin === 'file') { - return { - // Use a relative path to prevent fully resolved paths in the metafile (JSON stats file). - // This is only necessary for custom namespaces. esbuild will handle the file namespace. - path: (0, node_path_1.relative)(root, (0, node_path_1.join)((0, node_path_1.dirname)(args.importer), specifier)), - namespace, - }; - } - else { - // Inline data may need the importer to resolve imports/references within the content - const importer = (0, node_path_1.relative)(root, args.importer); - return { - path: `inline:${importer};${specifier}`, - namespace, - }; - } - }); - // Add a load callback to handle Component stylesheets (both inline and external) - build.onLoad({ filter: /./, namespace: uri_1.JIT_STYLE_NAMESPACE }, (0, load_result_cache_1.createCachedLoad)(loadCache, async (args) => { - // skipRead is used here because the stylesheet bundling will read a file stylesheet - // directly either via a preprocessor or esbuild itself. - const entry = await loadEntry(args.path, root, true /* skipRead */); - let stylesheetResult; - // Stylesheet contents only exist for internal stylesheets - if (entry.contents === undefined) { - stylesheetResult = await stylesheetBundler.bundleFile(entry.path); - } - else { - stylesheetResult = await stylesheetBundler.bundleInline(entry.contents, entry.path); - } - const { errors, warnings, referencedFiles } = stylesheetResult; - if (stylesheetResult.errors) { - return { - errors, - warnings, - watchFiles: referencedFiles && [...referencedFiles], - }; - } - const { contents, outputFiles, metafile } = stylesheetResult; - additionalResultFiles.set(entry.path, { outputFiles, metafile }); - return { - errors, - warnings, - contents, - loader: 'text', - watchFiles: referencedFiles && [...referencedFiles], - }; - })); - // Add a load callback to handle Component templates - // NOTE: While this callback supports both inline and external templates, the transformer - // currently only supports generating URIs for external templates. - build.onLoad({ filter: /./, namespace: uri_1.JIT_TEMPLATE_NAMESPACE }, (0, load_result_cache_1.createCachedLoad)(loadCache, async (args) => { - const { contents, path } = await loadEntry(args.path, root); - return { - contents, - loader: 'text', - watchFiles: [path], - }; - })); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.d.ts deleted file mode 100755 index cd0988a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare function rewriteForBazel(path: string): string; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.js deleted file mode 100755 index a69977d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/rewrite-bazel-paths.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.rewriteForBazel = rewriteForBazel; -const node_path_1 = require("node:path"); -const bazelBinDirectory = process.env['BAZEL_BINDIR']; -const bazelExecRoot = process.env['JS_BINARY__EXECROOT']; -function rewriteForBazel(path) { - if (!bazelBinDirectory || !bazelExecRoot) { - return path; - } - const fromExecRoot = (0, node_path_1.relative)(bazelExecRoot, path); - if (!fromExecRoot.startsWith('..')) { - return path; - } - const fromBinDirectory = (0, node_path_1.relative)(bazelBinDirectory, path); - if (fromBinDirectory.startsWith('..')) { - return path; - } - return (0, node_path_1.join)(bazelExecRoot, fromBinDirectory); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/source-file-cache.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/source-file-cache.d.ts deleted file mode 100755 index 170ec19..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/source-file-cache.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type ts from 'typescript'; -import { MemoryLoadResultCache } from '../load-result-cache'; -export declare class SourceFileCache extends Map { - readonly persistentCachePath?: string | undefined; - readonly modifiedFiles: Set; - readonly typeScriptFileCache: Map>; - readonly loadResultCache: MemoryLoadResultCache; - referencedFiles?: readonly string[]; - constructor(persistentCachePath?: string | undefined); - invalidate(files: Iterable): boolean; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/source-file-cache.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/source-file-cache.js deleted file mode 100755 index fccf4f1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/angular/source-file-cache.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SourceFileCache = void 0; -const node_os_1 = require("node:os"); -const path = __importStar(require("node:path")); -const load_result_cache_1 = require("../load-result-cache"); -const USING_WINDOWS = (0, node_os_1.platform)() === 'win32'; -const WINDOWS_SEP_REGEXP = new RegExp(`\\${path.win32.sep}`, 'g'); -class SourceFileCache extends Map { - persistentCachePath; - modifiedFiles = new Set(); - typeScriptFileCache = new Map(); - loadResultCache = new load_result_cache_1.MemoryLoadResultCache(); - referencedFiles; - constructor(persistentCachePath) { - super(); - this.persistentCachePath = persistentCachePath; - } - invalidate(files) { - if (files !== this.modifiedFiles) { - this.modifiedFiles.clear(); - } - const extraWatchFiles = new Set(this.referencedFiles?.map(path.normalize)); - let invalid = false; - for (let file of files) { - file = path.normalize(file); - invalid = this.loadResultCache.invalidate(file) || invalid; - invalid = extraWatchFiles.has(file) || invalid; - // Normalize separators to allow matching TypeScript Host paths - if (USING_WINDOWS) { - file = file.replace(WINDOWS_SEP_REGEXP, path.posix.sep); - } - invalid = this.delete(file) || invalid; - this.modifiedFiles.add(file); - } - return invalid; - } -} -exports.SourceFileCache = SourceFileCache; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/application-code-bundle.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/application-code-bundle.d.ts deleted file mode 100755 index adf9cfe..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/application-code-bundle.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuildOptions } from 'esbuild'; -import type { NormalizedApplicationBuildOptions } from '../../builders/application/options'; -import { AngularCompilation } from '../angular/compilation'; -import { ComponentStylesheetBundler } from './angular/component-stylesheets'; -import { SourceFileCache } from './angular/source-file-cache'; -import { BundlerOptionsFactory } from './bundler-context'; -import type { LoadResultCache } from './load-result-cache'; -export declare function createBrowserCodeBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], sourceFileCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler, angularCompilation: AngularCompilation, templateUpdates: Map | undefined): BundlerOptionsFactory; -export declare function createBrowserPolyfillBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], sourceFileCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler): BuildOptions | BundlerOptionsFactory | undefined; -export declare function createServerPolyfillBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], loadResultCache: LoadResultCache | undefined): BundlerOptionsFactory | undefined; -export declare function createServerMainCodeBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], sourceFileCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler): BundlerOptionsFactory; -export declare function createSsrEntryCodeBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], sourceFileCache: SourceFileCache, stylesheetBundler: ComponentStylesheetBundler): BundlerOptionsFactory; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/application-code-bundle.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/application-code-bundle.js deleted file mode 100755 index 353c52d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/application-code-bundle.js +++ /dev/null @@ -1,537 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createBrowserCodeBundleOptions = createBrowserCodeBundleOptions; -exports.createBrowserPolyfillBundleOptions = createBrowserPolyfillBundleOptions; -exports.createServerPolyfillBundleOptions = createServerPolyfillBundleOptions; -exports.createServerMainCodeBundleOptions = createServerMainCodeBundleOptions; -exports.createSsrEntryCodeBundleOptions = createSsrEntryCodeBundleOptions; -const node_assert_1 = __importDefault(require("node:assert")); -const node_crypto_1 = require("node:crypto"); -const node_path_1 = require("node:path"); -const schema_1 = require("../../builders/application/schema"); -const environment_options_1 = require("../../utils/environment-options"); -const path_1 = require("../../utils/path"); -const manifest_1 = require("../../utils/server-rendering/manifest"); -const compilation_1 = require("../angular/compilation"); -const compiler_plugin_1 = require("./angular/compiler-plugin"); -const angular_localize_init_warning_plugin_1 = require("./angular-localize-init-warning-plugin"); -const compiler_plugin_options_1 = require("./compiler-plugin-options"); -const external_packages_plugin_1 = require("./external-packages-plugin"); -const i18n_locale_plugin_1 = require("./i18n-locale-plugin"); -const loader_import_attribute_plugin_1 = require("./loader-import-attribute-plugin"); -const rxjs_esm_resolution_plugin_1 = require("./rxjs-esm-resolution-plugin"); -const server_bundle_metadata_plugin_1 = require("./server-bundle-metadata-plugin"); -const sourcemap_ignorelist_plugin_1 = require("./sourcemap-ignorelist-plugin"); -const utils_1 = require("./utils"); -const virtual_module_plugin_1 = require("./virtual-module-plugin"); -const wasm_plugin_1 = require("./wasm-plugin"); -function createBrowserCodeBundleOptions(options, target, sourceFileCache, stylesheetBundler, angularCompilation, templateUpdates) { - return (loadCache) => { - const { entryPoints, outputNames, polyfills } = options; - const zoneless = (0, utils_1.isZonelessApp)(polyfills); - const pluginOptions = (0, compiler_plugin_options_1.createCompilerPluginOptions)(options, sourceFileCache, loadCache, templateUpdates); - const buildOptions = { - ...getEsBuildCommonOptions(options), - platform: 'browser', - // Note: `es2015` is needed for RxJS v6. If not specified, `module` would - // match and the ES5 distribution would be bundled and ends up breaking at - // runtime with the RxJS testing library. - // More details: https://github.com/angular/angular-cli/issues/25405. - mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'], - entryNames: outputNames.bundles, - entryPoints, - target, - supported: (0, utils_1.getFeatureSupport)(target, zoneless), - }; - buildOptions.plugins ??= []; - buildOptions.plugins.push((0, wasm_plugin_1.createWasmPlugin)({ allowAsync: zoneless, cache: loadCache }), (0, angular_localize_init_warning_plugin_1.createAngularLocalizeInitWarningPlugin)(), (0, compiler_plugin_1.createCompilerPlugin)( - // JS/TS options - pluginOptions, angularCompilation, - // Component stylesheet bundler - stylesheetBundler)); - if (options.plugins) { - buildOptions.plugins.push(...options.plugins); - } - return buildOptions; - }; -} -function createBrowserPolyfillBundleOptions(options, target, sourceFileCache, stylesheetBundler) { - const namespace = 'angular:polyfills'; - const polyfillBundleOptions = getEsBuildCommonPolyfillsOptions(options, namespace, true, sourceFileCache.loadResultCache); - if (!polyfillBundleOptions) { - return; - } - const { outputNames, polyfills } = options; - const hasTypeScriptEntries = polyfills?.some((entry) => /\.[cm]?tsx?$/.test(entry)); - const buildOptions = { - ...polyfillBundleOptions, - platform: 'browser', - // Note: `es2015` is needed for RxJS v6. If not specified, `module` would - // match and the ES5 distribution would be bundled and ends up breaking at - // runtime with the RxJS testing library. - // More details: https://github.com/angular/angular-cli/issues/25405. - mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'], - entryNames: outputNames.bundles, - target, - entryPoints: { - 'polyfills': namespace, - }, - }; - // Only add the Angular TypeScript compiler if TypeScript files are provided in the polyfills - if (hasTypeScriptEntries) { - buildOptions.plugins ??= []; - const pluginOptions = (0, compiler_plugin_options_1.createCompilerPluginOptions)(options, sourceFileCache); - buildOptions.plugins.push((0, compiler_plugin_1.createCompilerPlugin)( - // JS/TS options - pluginOptions, - // Browser compilation handles the actual Angular code compilation - new compilation_1.NoopCompilation(), - // Component stylesheet options are unused for polyfills but required by the plugin - stylesheetBundler)); - } - // Use an options factory to allow fully incremental bundling when no TypeScript files are present. - // The TypeScript compilation is not currently integrated into the bundler invalidation so - // cannot be used with fully incremental bundling yet. - return hasTypeScriptEntries ? buildOptions : () => buildOptions; -} -function createServerPolyfillBundleOptions(options, target, loadResultCache) { - const serverPolyfills = []; - const polyfillsFromConfig = new Set(options.polyfills); - const isNodePlatform = options.ssrOptions?.platform !== schema_1.ExperimentalPlatform.Neutral; - if (!(0, utils_1.isZonelessApp)(options.polyfills)) { - serverPolyfills.push(isNodePlatform ? 'zone.js/node' : 'zone.js'); - } - if (polyfillsFromConfig.has('@angular/localize') || - polyfillsFromConfig.has('@angular/localize/init')) { - serverPolyfills.push('@angular/localize/init'); - } - serverPolyfills.push('@angular/platform-server/init'); - const namespace = 'angular:polyfills-server'; - const polyfillBundleOptions = getEsBuildCommonPolyfillsOptions({ - ...options, - polyfills: serverPolyfills, - }, namespace, false, loadResultCache); - if (!polyfillBundleOptions) { - return; - } - const jsBanner = []; - if (polyfillBundleOptions.external?.length) { - jsBanner.push(`globalThis['ngServerMode'] = true;`); - } - if (isNodePlatform) { - // Note: Needed as esbuild does not provide require shims / proxy from ESModules. - // See: https://github.com/evanw/esbuild/issues/1921. - jsBanner.push(`import { createRequire } from 'node:module';`, `globalThis['require'] ??= createRequire(import.meta.url);`); - } - const buildOptions = { - ...polyfillBundleOptions, - platform: isNodePlatform ? 'node' : 'neutral', - outExtension: { '.js': '.mjs' }, - // Note: `es2015` is needed for RxJS v6. If not specified, `module` would - // match and the ES5 distribution would be bundled and ends up breaking at - // runtime with the RxJS testing library. - // More details: https://github.com/angular/angular-cli/issues/25405. - mainFields: ['es2020', 'es2015', 'module', 'main'], - entryNames: '[name]', - banner: { - js: jsBanner.join('\n'), - }, - target, - entryPoints: { - 'polyfills.server': namespace, - }, - }; - buildOptions.plugins ??= []; - buildOptions.plugins.push((0, server_bundle_metadata_plugin_1.createServerBundleMetadata)()); - return () => buildOptions; -} -function createServerMainCodeBundleOptions(options, target, sourceFileCache, stylesheetBundler) { - const { serverEntryPoint: mainServerEntryPoint, workspaceRoot, outputMode, externalPackages, ssrOptions, polyfills, } = options; - (0, node_assert_1.default)(mainServerEntryPoint, 'createServerCodeBundleOptions should not be called without a defined serverEntryPoint.'); - return (loadResultCache) => { - const pluginOptions = (0, compiler_plugin_options_1.createCompilerPluginOptions)(options, sourceFileCache, loadResultCache); - const mainServerNamespace = 'angular:main-server'; - const mainServerInjectManifestNamespace = 'angular:main-server-inject-manifest'; - const zoneless = (0, utils_1.isZonelessApp)(polyfills); - const entryPoints = { - 'main.server': mainServerNamespace, - }; - const ssrEntryPoint = ssrOptions?.entry; - const isOldBehaviour = !outputMode; - if (ssrEntryPoint && isOldBehaviour) { - // Old behavior: 'server.ts' was bundled together with the SSR (Server-Side Rendering) code. - // This approach combined server-side logic and rendering into a single bundle. - entryPoints['server'] = ssrEntryPoint; - } - const buildOptions = { - ...getEsBuildServerCommonOptions(options), - target, - banner: { - js: `import './polyfills.server.mjs';`, - }, - entryPoints, - supported: (0, utils_1.getFeatureSupport)(target, zoneless), - }; - buildOptions.plugins ??= []; - buildOptions.plugins.push((0, wasm_plugin_1.createWasmPlugin)({ allowAsync: zoneless, cache: loadResultCache }), (0, angular_localize_init_warning_plugin_1.createAngularLocalizeInitWarningPlugin)(), (0, compiler_plugin_1.createCompilerPlugin)( - // JS/TS options - pluginOptions, - // Browser compilation handles the actual Angular code compilation - new compilation_1.NoopCompilation(), - // Component stylesheet bundler - stylesheetBundler)); - if (!externalPackages) { - buildOptions.plugins.push((0, rxjs_esm_resolution_plugin_1.createRxjsEsmResolutionPlugin)()); - } - // Mark manifest and polyfills file as external as these are generated by a different bundle step. - (buildOptions.external ??= []).push(...utils_1.SERVER_GENERATED_EXTERNALS); - const isNodePlatform = options.ssrOptions?.platform !== schema_1.ExperimentalPlatform.Neutral; - if (!isNodePlatform) { - // `@angular/platform-server` lazily depends on `xhr2` for XHR usage with the HTTP client. - // Since `xhr2` has Node.js dependencies, it cannot be used when targeting non-Node.js platforms. - // Note: The framework already issues a warning when using XHR with SSR. - buildOptions.external.push('xhr2'); - } - buildOptions.plugins.push((0, server_bundle_metadata_plugin_1.createServerBundleMetadata)(), (0, virtual_module_plugin_1.createVirtualModulePlugin)({ - namespace: mainServerInjectManifestNamespace, - cache: loadResultCache, - entryPointOnly: false, - loadContent: async () => { - const contents = [ - // Configure `@angular/ssr` manifest. - `import manifest from './${manifest_1.SERVER_APP_MANIFEST_FILENAME}';`, - `import { ɵsetAngularAppManifest } from '@angular/ssr';`, - `ɵsetAngularAppManifest(manifest);`, - ]; - return { - contents: contents.join('\n'), - loader: 'js', - resolveDir: workspaceRoot, - }; - }, - }), (0, virtual_module_plugin_1.createVirtualModulePlugin)({ - namespace: mainServerNamespace, - cache: loadResultCache, - loadContent: async () => { - const mainServerEntryPointJsImport = entryFileToWorkspaceRelative(workspaceRoot, mainServerEntryPoint); - const contents = [ - // Inject manifest - `import '${mainServerInjectManifestNamespace}';`, - // Add @angular/ssr exports - `export { - ɵdestroyAngularServerApp, - ɵextractRoutesAndCreateRouteTree, - ɵgetOrCreateAngularServerApp, - } from '@angular/ssr';`, - // Need for HMR - `export { ɵresetCompiledComponents } from '@angular/core';`, - // Re-export all symbols including default export from 'main.server.ts' - `export { default } from '${mainServerEntryPointJsImport}';`, - `export * from '${mainServerEntryPointJsImport}';`, - ]; - return { - contents: contents.join('\n'), - loader: 'js', - resolveDir: workspaceRoot, - }; - }, - })); - if (options.plugins) { - buildOptions.plugins.push(...options.plugins); - } - return buildOptions; - }; -} -function createSsrEntryCodeBundleOptions(options, target, sourceFileCache, stylesheetBundler) { - const { workspaceRoot, ssrOptions, externalPackages } = options; - const serverEntryPoint = ssrOptions?.entry; - (0, node_assert_1.default)(serverEntryPoint, 'createSsrEntryCodeBundleOptions should not be called without a defined serverEntryPoint.'); - return (loadResultCache) => { - const pluginOptions = (0, compiler_plugin_options_1.createCompilerPluginOptions)(options, sourceFileCache, loadResultCache); - const ssrEntryNamespace = 'angular:ssr-entry'; - const ssrInjectManifestNamespace = 'angular:ssr-entry-inject-manifest'; - const isNodePlatform = options.ssrOptions?.platform !== schema_1.ExperimentalPlatform.Neutral; - const jsBanner = []; - if (options.externalDependencies?.length) { - jsBanner.push(`globalThis['ngServerMode'] = true;`); - } - if (isNodePlatform) { - // Note: Needed as esbuild does not provide require shims / proxy from ESModules. - // See: https://github.com/evanw/esbuild/issues/1921. - jsBanner.push(`import { createRequire } from 'node:module';`, `globalThis['require'] ??= createRequire(import.meta.url);`); - } - const buildOptions = { - ...getEsBuildServerCommonOptions(options), - target, - banner: { - js: jsBanner.join('\n'), - }, - entryPoints: { - 'server': ssrEntryNamespace, - }, - supported: (0, utils_1.getFeatureSupport)(target, true), - }; - buildOptions.plugins ??= []; - buildOptions.plugins.push((0, angular_localize_init_warning_plugin_1.createAngularLocalizeInitWarningPlugin)(), (0, compiler_plugin_1.createCompilerPlugin)( - // JS/TS options - pluginOptions, - // Browser compilation handles the actual Angular code compilation - new compilation_1.NoopCompilation(), - // Component stylesheet bundler - stylesheetBundler)); - if (!externalPackages) { - buildOptions.plugins.push((0, rxjs_esm_resolution_plugin_1.createRxjsEsmResolutionPlugin)()); - } - // Mark manifest file as external. As this will be generated later on. - (buildOptions.external ??= []).push('*/main.server.mjs', ...utils_1.SERVER_GENERATED_EXTERNALS); - if (!isNodePlatform) { - // `@angular/platform-server` lazily depends on `xhr2` for XHR usage with the HTTP client. - // Since `xhr2` has Node.js dependencies, it cannot be used when targeting non-Node.js platforms. - // Note: The framework already issues a warning when using XHR with SSR. - buildOptions.external.push('xhr2'); - } - buildOptions.plugins.push((0, server_bundle_metadata_plugin_1.createServerBundleMetadata)({ ssrEntryBundle: true }), (0, virtual_module_plugin_1.createVirtualModulePlugin)({ - namespace: ssrInjectManifestNamespace, - cache: loadResultCache, - entryPointOnly: false, - loadContent: () => { - const contents = [ - // Configure `@angular/ssr` app engine manifest. - `import manifest from './${manifest_1.SERVER_APP_ENGINE_MANIFEST_FILENAME}';`, - `import { ɵsetAngularAppEngineManifest } from '@angular/ssr';`, - `ɵsetAngularAppEngineManifest(manifest);`, - ]; - return { - contents: contents.join('\n'), - loader: 'js', - resolveDir: workspaceRoot, - }; - }, - }), (0, virtual_module_plugin_1.createVirtualModulePlugin)({ - namespace: ssrEntryNamespace, - cache: loadResultCache, - loadContent: () => { - const serverEntryPointJsImport = entryFileToWorkspaceRelative(workspaceRoot, serverEntryPoint); - const contents = [ - // Configure `@angular/ssr` app engine manifest. - `import '${ssrInjectManifestNamespace}';`, - // Re-export all symbols including default export - `import * as server from '${serverEntryPointJsImport}';`, - `export * from '${serverEntryPointJsImport}';`, - // The below is needed to avoid - // `Import "default" will always be undefined because there is no matching export` warning when no default is present. - `const defaultExportName = 'default';`, - `export default server[defaultExportName]`, - // Add @angular/ssr exports - `export { AngularAppEngine } from '@angular/ssr';`, - ]; - return { - contents: contents.join('\n'), - loader: 'js', - resolveDir: workspaceRoot, - }; - }, - })); - if (options.plugins) { - buildOptions.plugins.push(...options.plugins); - } - return buildOptions; - }; -} -function getEsBuildServerCommonOptions(options) { - const isNodePlatform = options.ssrOptions?.platform !== schema_1.ExperimentalPlatform.Neutral; - const commonOptions = getEsBuildCommonOptions(options); - commonOptions.define ??= {}; - commonOptions.define['ngServerMode'] = 'true'; - return { - ...commonOptions, - platform: isNodePlatform ? 'node' : 'neutral', - outExtension: { '.js': '.mjs' }, - // Note: `es2015` is needed for RxJS v6. If not specified, `module` would - // match and the ES5 distribution would be bundled and ends up breaking at - // runtime with the RxJS testing library. - // More details: https://github.com/angular/angular-cli/issues/25405. - mainFields: ['es2020', 'es2015', 'module', 'main'], - entryNames: '[name]', - }; -} -function getEsBuildCommonOptions(options) { - const { workspaceRoot, outExtension, optimizationOptions, sourcemapOptions, tsconfig, externalDependencies, outputNames, preserveSymlinks, jit, loaderExtensions, jsonLogs, i18nOptions, customConditions, frameworkVersion, } = options; - // Ensure unique hashes for i18n translation changes when using post-process inlining. - // This hash value is added as a footer to each file and ensures that the output file names (with hashes) - // change when translation files have changed. If this is not done the post processed files may have - // different content but would retain identical production file names which would lead to browser caching problems. - let footer; - if (i18nOptions.shouldInline) { - // Update file hashes to include translation file content - const i18nHash = Object.values(i18nOptions.locales).reduce((data, locale) => data + locale.files.map((file) => file.integrity || '').join('|'), ''); - footer = { js: `/**i18n:${(0, node_crypto_1.createHash)('sha256').update(i18nHash).digest('hex')}*/` }; - } - // Core conditions that are always included - const conditions = [ - // Required to support rxjs 7.x which will use es5 code if this condition is not present - 'es2015', - 'es2020', - ]; - // The pre-linked code is not used with JIT for two reasons: - // 1) The pre-linked code may not have the metadata included that is required for JIT - // 2) The CLI is otherwise setup to use runtime linking for JIT to match the application template compilation - if (!jit) { - // The pre-linked package condition is based on the framework version. - // Currently this is specific to each patch version of the framework. - conditions.push('angular:linked-' + frameworkVersion); - } - // Append custom conditions if present - if (customConditions) { - conditions.push(...customConditions); - } - else { - // Include default conditions - conditions.push('module', optimizationOptions.scripts ? 'production' : 'development'); - } - const plugins = [ - (0, loader_import_attribute_plugin_1.createLoaderImportAttributePlugin)(), - (0, sourcemap_ignorelist_plugin_1.createSourcemapIgnorelistPlugin)(), - ]; - let packages = 'bundle'; - if (options.externalPackages) { - // Package files affected by a customized loader should not be implicitly marked as external - if (options.loaderExtensions || - options.plugins || - typeof options.externalPackages === 'object') { - // Plugin must be added after custom plugins to ensure any added loader options are considered - plugins.push((0, external_packages_plugin_1.createExternalPackagesPlugin)(options.externalPackages !== true ? options.externalPackages : undefined)); - packages = 'bundle'; - } - else { - // Safe to use the packages external option directly - packages = 'external'; - } - } - return { - absWorkingDir: workspaceRoot, - format: 'esm', - bundle: true, - packages, - assetNames: outputNames.media, - conditions, - resolveExtensions: ['.ts', '.tsx', '.mjs', '.js', '.cjs'], - metafile: true, - legalComments: options.extractLicenses ? 'none' : 'eof', - logLevel: options.verbose && !jsonLogs ? 'debug' : 'silent', - minifyIdentifiers: optimizationOptions.scripts && environment_options_1.allowMangle, - minifySyntax: optimizationOptions.scripts, - minifyWhitespace: optimizationOptions.scripts, - pure: ['forwardRef'], - outdir: workspaceRoot, - outExtension: outExtension ? { '.js': `.${outExtension}` } : undefined, - sourcemap: sourcemapOptions.scripts && (sourcemapOptions.hidden ? 'external' : true), - sourcesContent: sourcemapOptions.sourcesContent, - splitting: true, - chunkNames: options.namedChunks ? '[name]-[hash]' : 'chunk-[hash]', - tsconfig, - external: externalDependencies ? [...externalDependencies] : undefined, - write: false, - preserveSymlinks, - define: { - ...options.define, - // Only set to false when script optimizations are enabled. It should not be set to true because - // Angular turns `ngDevMode` into an object for development debugging purposes when not defined - // which a constant true value would break. - ...(optimizationOptions.scripts ? { 'ngDevMode': 'false' } : undefined), - 'ngJitMode': jit ? 'true' : 'false', - 'ngServerMode': 'false', - 'ngHmrMode': options.templateUpdates ? 'true' : 'false', - }, - loader: loaderExtensions, - footer, - plugins, - }; -} -function getEsBuildCommonPolyfillsOptions(options, namespace, tryToResolvePolyfillsAsRelative, loadResultCache) { - const { jit, workspaceRoot, i18nOptions } = options; - const buildOptions = getEsBuildCommonOptions(options); - buildOptions.splitting = false; - buildOptions.plugins ??= []; - let polyfills = options.polyfills ? [...options.polyfills] : []; - // Angular JIT mode requires the runtime compiler - if (jit) { - polyfills.unshift('@angular/compiler'); - } - // Add Angular's global locale data if i18n options are present. - // Locale data should go first so that project provided polyfill code can augment if needed. - let needLocaleDataPlugin = false; - if (i18nOptions.shouldInline) { - // Remove localize polyfill as this is not needed for build time i18n. - polyfills = polyfills.filter((path) => !path.startsWith('@angular/localize')); - // Add locale data for all active locales - // TODO: Inject each individually within the inlining process itself - for (const locale of i18nOptions.inlineLocales) { - polyfills.unshift(`angular:locale/data:${locale}`); - } - needLocaleDataPlugin = true; - } - else if (i18nOptions.hasDefinedSourceLocale) { - // When not inlining and a source local is present, use the source locale data directly - polyfills.unshift(`angular:locale/data:${i18nOptions.sourceLocale}`); - needLocaleDataPlugin = true; - } - if (needLocaleDataPlugin) { - buildOptions.plugins.unshift((0, i18n_locale_plugin_1.createAngularLocaleDataPlugin)()); - } - if (polyfills.length === 0) { - return; - } - buildOptions.plugins.push((0, virtual_module_plugin_1.createVirtualModulePlugin)({ - namespace, - cache: loadResultCache, - loadContent: async (_, build) => { - let polyfillPaths = polyfills; - let warnings; - if (tryToResolvePolyfillsAsRelative) { - polyfillPaths = await Promise.all(polyfills.map(async (path) => { - if (path.startsWith('zone.js') || !(0, node_path_1.extname)(path)) { - return path; - } - const potentialPathRelative = './' + path; - const result = await build.resolve(potentialPathRelative, { - kind: 'import-statement', - resolveDir: workspaceRoot, - }); - return result.path ? potentialPathRelative : path; - })); - } - // Generate module contents with an import statement per defined polyfill - let contents = polyfillPaths.map((file) => `import '${(0, path_1.toPosixPath)(file)}';`).join('\n'); - // The below should be done after loading `$localize` as otherwise the locale will be overridden. - if (i18nOptions.shouldInline) { - // When inlining, a placeholder is used to allow the post-processing step to inject the $localize locale identifier. - contents += '(globalThis.$localize ??= {}).locale = "___NG_LOCALE_INSERT___";\n'; - } - else if (i18nOptions.hasDefinedSourceLocale) { - // If not inlining translations and source locale is defined, inject the locale specifier. - contents += `(globalThis.$localize ??= {}).locale = "${i18nOptions.sourceLocale}";\n`; - } - return { - contents, - loader: 'js', - warnings, - resolveDir: workspaceRoot, - }; - }, - })); - return buildOptions; -} -function entryFileToWorkspaceRelative(workspaceRoot, entryFile) { - return './' + (0, path_1.toPosixPath)((0, node_path_1.relative)(workspaceRoot, entryFile).replace(/.[mc]?ts$/, '')); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/budget-stats.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/budget-stats.d.ts deleted file mode 100755 index 8077a25..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/budget-stats.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Metafile } from 'esbuild'; -import type { BudgetStats } from '../../utils/bundle-calculator'; -import { type BuildOutputFile, type InitialFileRecord } from './bundler-context'; -/** - * Generates a bundle budget calculator compatible stats object that provides - * the necessary information for the Webpack-based bundle budget code to - * interoperate with the esbuild-based builders. - * @param metafile The esbuild metafile of a build to use. - * @param initialFiles The records of all initial files of a build. - * @returns A bundle budget compatible stats object. - */ -export declare function generateBudgetStats(metafile: Metafile, outputFiles: BuildOutputFile[], initialFiles: Map): BudgetStats; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/budget-stats.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/budget-stats.js deleted file mode 100755 index 436b7e7..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/budget-stats.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateBudgetStats = generateBudgetStats; -const bundler_context_1 = require("./bundler-context"); -const utils_1 = require("./utils"); -/** - * Generates a bundle budget calculator compatible stats object that provides - * the necessary information for the Webpack-based bundle budget code to - * interoperate with the esbuild-based builders. - * @param metafile The esbuild metafile of a build to use. - * @param initialFiles The records of all initial files of a build. - * @returns A bundle budget compatible stats object. - */ -function generateBudgetStats(metafile, outputFiles, initialFiles) { - const stats = { - chunks: [], - assets: [], - }; - for (const { path: file, size, type } of outputFiles) { - if (!file.endsWith('.js') && !file.endsWith('.css')) { - continue; - } - // Exclude server bundles - if (type === bundler_context_1.BuildOutputFileType.ServerApplication || type === bundler_context_1.BuildOutputFileType.ServerRoot) { - continue; - } - const initialRecord = initialFiles.get(file); - const name = initialRecord?.name ?? (0, utils_1.getChunkNameFromMetafile)(metafile, file); - stats.chunks.push({ - files: [file], - initial: !!initialRecord, - names: name ? [name] : undefined, - }); - stats.assets.push({ - name: file, - size, - }); - } - // Add component styles from metafile - // TODO: Provide this information directly from the AOT compiler - for (const [file, entry] of Object.entries(metafile.outputs)) { - if (!file.endsWith('.css')) { - continue; - } - // 'ng-component' is set by the angular plugin's component stylesheet bundler - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const componentStyle = entry['ng-component']; - if (!componentStyle) { - continue; - } - stats.assets.push({ - // Component styles use the input file - name: Object.keys(entry.inputs)[0], - size: entry.bytes, - componentStyle, - }); - } - return stats; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-context.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-context.d.ts deleted file mode 100755 index 28c2aae..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-context.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BuildOptions, Message, Metafile, OutputFile } from 'esbuild'; -import { LoadResultCache } from './load-result-cache'; -export type BundleContextResult = { - errors: Message[]; - warnings: Message[]; -} | { - errors: undefined; - warnings: Message[]; - metafile: Metafile; - outputFiles: BuildOutputFile[]; - initialFiles: Map; - externalImports: { - server?: Set; - browser?: Set; - }; - externalConfiguration?: string[]; -}; -export interface InitialFileRecord { - entrypoint: boolean; - name?: string; - type: 'script' | 'style'; - external?: boolean; - serverFile: boolean; - depth: number; -} -export declare enum BuildOutputFileType { - Browser = 0, - Media = 1, - ServerApplication = 2, - ServerRoot = 3, - Root = 4 -} -export interface BuildOutputFile extends OutputFile { - type: BuildOutputFileType; - readonly size: number; - clone: () => BuildOutputFile; -} -export type BundlerOptionsFactory = (loadCache: LoadResultCache | undefined) => T; -export declare class BundlerContext { - #private; - private workspaceRoot; - private incremental; - private initialFilter?; - readonly watchFiles: Set; - constructor(workspaceRoot: string, incremental: boolean, options: BuildOptions | BundlerOptionsFactory, initialFilter?: ((initial: Readonly) => boolean) | undefined); - static bundleAll(contexts: Iterable, changedFiles?: Iterable): Promise; - static mergeResults(results: BundleContextResult[]): BundleContextResult; - /** - * Executes the esbuild build function and normalizes the build result in the event of a - * build failure that results in no output being generated. - * All builds use the `write` option with a value of `false` to allow for the output files - * build result array to be populated. - * - * @param force If true, always rebundle. - * @returns If output files are generated, the full esbuild BuildResult; if not, the - * warnings and errors for the attempted build. - */ - bundle(force?: boolean): Promise; - /** - * Invalidate a stored bundler result based on the previous watch files - * and a list of changed files. - * The context must be created with incremental mode enabled for results - * to be stored. - * @returns True, if the result was invalidated; False, otherwise. - */ - invalidate(files: Iterable): boolean; - /** - * Disposes incremental build resources present in the context. - * - * @returns A promise that resolves when disposal is complete. - */ - dispose(): Promise; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-context.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-context.js deleted file mode 100755 index 4f07c47..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-context.js +++ /dev/null @@ -1,398 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BundlerContext = exports.BuildOutputFileType = void 0; -const esbuild_1 = require("esbuild"); -const node_assert_1 = __importDefault(require("node:assert")); -const node_module_1 = require("node:module"); -const node_path_1 = require("node:path"); -const load_result_cache_1 = require("./load-result-cache"); -const utils_1 = require("./utils"); -var BuildOutputFileType; -(function (BuildOutputFileType) { - BuildOutputFileType[BuildOutputFileType["Browser"] = 0] = "Browser"; - BuildOutputFileType[BuildOutputFileType["Media"] = 1] = "Media"; - BuildOutputFileType[BuildOutputFileType["ServerApplication"] = 2] = "ServerApplication"; - BuildOutputFileType[BuildOutputFileType["ServerRoot"] = 3] = "ServerRoot"; - BuildOutputFileType[BuildOutputFileType["Root"] = 4] = "Root"; -})(BuildOutputFileType || (exports.BuildOutputFileType = BuildOutputFileType = {})); -/** - * Determines if an unknown value is an esbuild BuildFailure error object thrown by esbuild. - * @param value A potential esbuild BuildFailure error object. - * @returns `true` if the object is determined to be a BuildFailure object; otherwise, `false`. - */ -function isEsBuildFailure(value) { - return !!value && typeof value === 'object' && 'errors' in value && 'warnings' in value; -} -class BundlerContext { - workspaceRoot; - incremental; - initialFilter; - #esbuildContext; - #esbuildOptions; - #esbuildResult; - #optionsFactory; - #shouldCacheResult; - #loadCache; - watchFiles = new Set(); - constructor(workspaceRoot, incremental, options, initialFilter) { - this.workspaceRoot = workspaceRoot; - this.incremental = incremental; - this.initialFilter = initialFilter; - // To cache the results an option factory is needed to capture the full set of dependencies - this.#shouldCacheResult = incremental && typeof options === 'function'; - this.#optionsFactory = (...args) => { - const baseOptions = typeof options === 'function' ? options(...args) : options; - return { - ...baseOptions, - metafile: true, - write: false, - }; - }; - } - static async bundleAll(contexts, changedFiles) { - const individualResults = await Promise.all([...contexts].map((context) => { - if (changedFiles) { - context.invalidate(changedFiles); - } - return context.bundle(); - })); - return BundlerContext.mergeResults(individualResults); - } - static mergeResults(results) { - // Return directly if only one result - if (results.length === 1) { - return results[0]; - } - let errors; - const warnings = []; - const metafile = { inputs: {}, outputs: {} }; - const initialFiles = new Map(); - const externalImportsBrowser = new Set(); - const externalImportsServer = new Set(); - const outputFiles = []; - let externalConfiguration; - for (const result of results) { - warnings.push(...result.warnings); - if (result.errors) { - errors ??= []; - errors.push(...result.errors); - continue; - } - // Combine metafiles used for the stats option as well as bundle budgets and console output - if (result.metafile) { - Object.assign(metafile.inputs, result.metafile.inputs); - Object.assign(metafile.outputs, result.metafile.outputs); - } - result.initialFiles.forEach((value, key) => initialFiles.set(key, value)); - outputFiles.push(...result.outputFiles); - result.externalImports.browser?.forEach((value) => externalImportsBrowser.add(value)); - result.externalImports.server?.forEach((value) => externalImportsServer.add(value)); - if (result.externalConfiguration) { - externalConfiguration ??= new Set(); - for (const value of result.externalConfiguration) { - externalConfiguration.add(value); - } - } - } - if (errors !== undefined) { - return { errors, warnings }; - } - return { - errors, - warnings, - metafile, - initialFiles, - outputFiles, - externalImports: { - browser: externalImportsBrowser, - server: externalImportsServer, - }, - externalConfiguration: externalConfiguration ? [...externalConfiguration] : undefined, - }; - } - /** - * Executes the esbuild build function and normalizes the build result in the event of a - * build failure that results in no output being generated. - * All builds use the `write` option with a value of `false` to allow for the output files - * build result array to be populated. - * - * @param force If true, always rebundle. - * @returns If output files are generated, the full esbuild BuildResult; if not, the - * warnings and errors for the attempted build. - */ - async bundle(force) { - // Return existing result if present - if (!force && this.#esbuildResult) { - return this.#esbuildResult; - } - const result = await this.#performBundle(); - if (this.#shouldCacheResult) { - this.#esbuildResult = result; - } - return result; - } - // eslint-disable-next-line max-lines-per-function - async #performBundle() { - // Create esbuild options if not present - if (this.#esbuildOptions === undefined) { - if (this.incremental) { - this.#loadCache = new load_result_cache_1.MemoryLoadResultCache(); - } - this.#esbuildOptions = this.#optionsFactory(this.#loadCache); - } - if (this.incremental) { - this.watchFiles.clear(); - } - let result; - try { - if (this.#esbuildContext) { - // Rebuild using the existing incremental build context - result = await this.#esbuildContext.rebuild(); - } - else if (this.incremental) { - // Create an incremental build context and perform the first build. - // Context creation does not perform a build. - this.#esbuildContext = await (0, esbuild_1.context)(this.#esbuildOptions); - result = await this.#esbuildContext.rebuild(); - } - else { - // For non-incremental builds, perform a single build - result = await (0, esbuild_1.build)(this.#esbuildOptions); - } - } - catch (failure) { - // Build failures will throw an exception which contains errors/warnings - if (isEsBuildFailure(failure)) { - this.#addErrorsToWatch(failure); - return failure; - } - else { - throw failure; - } - } - finally { - if (this.incremental) { - // When incremental always add any files from the load result cache - if (this.#loadCache) { - for (const file of this.#loadCache.watchFiles) { - if (!isInternalAngularFile(file)) { - // watch files are fully resolved paths - this.watchFiles.add(file); - } - } - } - } - } - // Update files that should be watched. - // While this should technically not be linked to incremental mode, incremental is only - // currently enabled with watch mode where watch files are needed. - if (this.incremental) { - // Add input files except virtual angular files which do not exist on disk - for (const input of Object.keys(result.metafile.inputs)) { - if (isInternalAngularFile(input) || isInternalBundlerFile(input)) { - continue; - } - // Input file paths are always relative to the workspace root - this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, input)); - } - } - // Return if the build encountered any errors - if (result.errors.length) { - this.#addErrorsToWatch(result); - return { - errors: result.errors, - warnings: result.warnings, - }; - } - const { 'ng-platform-server': isPlatformServer = false, 'ng-ssr-entry-bundle': isSsrEntryBundle = false, } = result.metafile; - // Find all initial files - const initialFiles = new Map(); - for (const outputFile of result.outputFiles) { - // Entries in the metafile are relative to the `absWorkingDir` option which is set to the workspaceRoot - const relativeFilePath = (0, node_path_1.relative)(this.workspaceRoot, outputFile.path); - const entryPoint = result.metafile.outputs[relativeFilePath]?.entryPoint; - outputFile.path = relativeFilePath; - if (entryPoint) { - // The first part of the filename is the name of file (e.g., "polyfills" for "polyfills-7S5G3MDY.js") - const name = (0, node_path_1.basename)(relativeFilePath).replace(/(?:-[\dA-Z]{8})?\.[a-z]{2,3}$/, ''); - // Entry points are only styles or scripts - const type = (0, node_path_1.extname)(relativeFilePath) === '.css' ? 'style' : 'script'; - // Only entrypoints with an entry in the options are initial files. - // Dynamic imports also have an entryPoint value in the meta file. - if (this.#esbuildOptions.entryPoints?.[name]) { - // An entryPoint value indicates an initial file - const record = { - name, - type, - entrypoint: true, - serverFile: isPlatformServer, - depth: 0, - }; - if (!this.initialFilter || this.initialFilter(record)) { - initialFiles.set(relativeFilePath, record); - } - } - } - } - // Analyze for transitive initial files - const entriesToAnalyze = [...initialFiles]; - let currentEntry; - while ((currentEntry = entriesToAnalyze.pop())) { - const [entryPath, entryRecord] = currentEntry; - for (const initialImport of result.metafile.outputs[entryPath].imports) { - const existingRecord = initialFiles.get(initialImport.path); - if (existingRecord) { - // Store the smallest value depth - if (existingRecord.depth > entryRecord.depth + 1) { - existingRecord.depth = entryRecord.depth + 1; - } - continue; - } - if (initialImport.kind === 'import-statement' || initialImport.kind === 'import-rule') { - const record = { - type: initialImport.kind === 'import-rule' ? 'style' : 'script', - entrypoint: false, - external: initialImport.external, - serverFile: isPlatformServer, - depth: entryRecord.depth + 1, - }; - if (!this.initialFilter || this.initialFilter(record)) { - initialFiles.set(initialImport.path, record); - } - if (!initialImport.external) { - entriesToAnalyze.push([initialImport.path, record]); - } - } - } - } - // Collect all external package names - const externalImports = new Set(); - for (const { imports } of Object.values(result.metafile.outputs)) { - for (const { external, kind, path } of imports) { - if (!external || - utils_1.SERVER_GENERATED_EXTERNALS.has(path) || - isInternalAngularFile(path) || - (kind !== 'import-statement' && kind !== 'dynamic-import' && kind !== 'require-call')) { - continue; - } - externalImports.add(path); - } - } - (0, node_assert_1.default)(this.#esbuildOptions, 'esbuild options cannot be undefined.'); - const outputFiles = result.outputFiles.map((file) => { - let fileType; - // All files that are not JS, CSS, WASM, or sourcemaps for them are considered media - if (!/\.([cm]?js|css|wasm)(\.map)?$/i.test(file.path)) { - fileType = BuildOutputFileType.Media; - } - else if (isPlatformServer) { - fileType = isSsrEntryBundle - ? BuildOutputFileType.ServerRoot - : BuildOutputFileType.ServerApplication; - } - else { - fileType = BuildOutputFileType.Browser; - } - return (0, utils_1.convertOutputFile)(file, fileType); - }); - let externalConfiguration = this.#esbuildOptions.external; - if (isPlatformServer && externalConfiguration) { - externalConfiguration = externalConfiguration.filter((dep) => !utils_1.SERVER_GENERATED_EXTERNALS.has(dep)); - if (!externalConfiguration.length) { - externalConfiguration = undefined; - } - } - // Return the successful build results - return { - ...result, - outputFiles, - initialFiles, - externalImports: { - [isPlatformServer ? 'server' : 'browser']: externalImports, - }, - externalConfiguration, - errors: undefined, - }; - } - #addErrorsToWatch(result) { - for (const error of result.errors) { - let file = error.location?.file; - if (file && !isInternalAngularFile(file)) { - this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, file)); - } - for (const note of error.notes) { - file = note.location?.file; - if (file && !isInternalAngularFile(file)) { - this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, file)); - } - } - } - } - /** - * Invalidate a stored bundler result based on the previous watch files - * and a list of changed files. - * The context must be created with incremental mode enabled for results - * to be stored. - * @returns True, if the result was invalidated; False, otherwise. - */ - invalidate(files) { - if (!this.incremental) { - return false; - } - let invalid = false; - for (const file of files) { - if (this.#loadCache?.invalidate(file)) { - invalid = true; - continue; - } - invalid ||= this.watchFiles.has(file); - } - if (invalid) { - this.#esbuildResult = undefined; - } - return invalid; - } - /** - * Disposes incremental build resources present in the context. - * - * @returns A promise that resolves when disposal is complete. - */ - async dispose() { - try { - this.#esbuildOptions = undefined; - this.#esbuildResult = undefined; - this.#loadCache = undefined; - await this.#esbuildContext?.dispose(); - } - finally { - this.#esbuildContext = undefined; - } - } -} -exports.BundlerContext = BundlerContext; -function isInternalAngularFile(file) { - return file.startsWith('angular:'); -} -function isInternalBundlerFile(file) { - // Bundler virtual files such as "" or "" - if (file[0] === '<' && file.at(-1) === '>') { - return true; - } - const DISABLED_BUILTIN = '(disabled):'; - // Disabled node builtins such as "/some/path/(disabled):fs" - const disabledIndex = file.indexOf(DISABLED_BUILTIN); - if (disabledIndex >= 0) { - return node_module_1.builtinModules.includes(file.slice(disabledIndex + DISABLED_BUILTIN.length)); - } - return false; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-execution-result.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-execution-result.d.ts deleted file mode 100755 index b972c4f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-execution-result.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Message, PartialMessage } from 'esbuild'; -import type { ChangedFiles } from '../../tools/esbuild/watcher'; -import type { ComponentStylesheetBundler } from './angular/component-stylesheets'; -import type { SourceFileCache } from './angular/source-file-cache'; -import type { BuildOutputFile, BuildOutputFileType, BundlerContext } from './bundler-context'; -export interface BuildOutputAsset { - source: string; - destination: string; -} -export interface RebuildState { - rebuildContexts: { - typescriptContexts: BundlerContext[]; - otherContexts: BundlerContext[]; - }; - componentStyleBundler: ComponentStylesheetBundler; - codeBundleCache?: SourceFileCache; - fileChanges: ChangedFiles; - previousOutputInfo: ReadonlyMap; - previousAssetsInfo: ReadonlyMap; - templateUpdates?: Map; -} -export interface ExternalResultMetadata { - implicitBrowser: string[]; - implicitServer: string[]; - explicit: string[]; -} -export type PrerenderedRoutesRecord = Record; -}>; -/** - * Represents the result of a single builder execute call. - */ -export declare class ExecutionResult { - private rebuildContexts; - private componentStyleBundler; - private codeBundleCache?; - readonly templateUpdates?: Map | undefined; - outputFiles: BuildOutputFile[]; - assetFiles: BuildOutputAsset[]; - errors: (Message | PartialMessage)[]; - prerenderedRoutes: PrerenderedRoutesRecord; - warnings: (Message | PartialMessage)[]; - logs: string[]; - externalMetadata?: ExternalResultMetadata; - extraWatchFiles: string[]; - htmlIndexPath?: string; - htmlBaseHref?: string; - constructor(rebuildContexts: { - typescriptContexts: BundlerContext[]; - otherContexts: BundlerContext[]; - }, componentStyleBundler: ComponentStylesheetBundler, codeBundleCache?: SourceFileCache | undefined, templateUpdates?: Map | undefined); - addOutputFile(path: string, content: string | Uint8Array, type: BuildOutputFileType): void; - addAssets(assets: BuildOutputAsset[]): void; - addLog(value: string): void; - addError(error: PartialMessage | string): void; - addErrors(errors: (PartialMessage | string)[]): void; - addPrerenderedRoutes(routes: PrerenderedRoutesRecord): void; - addWarning(error: PartialMessage | string): void; - addWarnings(errors: (PartialMessage | string)[]): void; - /** - * Add external JavaScript import metadata to the result. This is currently used - * by the development server to optimize the prebundling process. - * @param implicitBrowser External dependencies for the browser bundles due to the external packages option. - * @param implicitServer External dependencies for the server bundles due to the external packages option. - * @param explicit External dependencies due to explicit project configuration. - */ - setExternalMetadata(implicitBrowser: string[], implicitServer: string[], explicit: string[]): void; - get output(): { - success: boolean; - }; - get outputWithFiles(): { - success: boolean; - outputFiles: BuildOutputFile[]; - assetFiles: BuildOutputAsset[]; - errors: (PartialMessage | Message)[]; - externalMetadata: ExternalResultMetadata | undefined; - }; - get watchFiles(): Readonly; - createRebuildState(fileChanges: ChangedFiles): RebuildState; - findChangedFiles(previousOutputHashes: ReadonlyMap): Set; - dispose(): Promise; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-execution-result.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-execution-result.js deleted file mode 100755 index 03d2630..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/bundler-execution-result.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExecutionResult = void 0; -const node_path_1 = require("node:path"); -const utils_1 = require("./utils"); -/** - * Represents the result of a single builder execute call. - */ -class ExecutionResult { - rebuildContexts; - componentStyleBundler; - codeBundleCache; - templateUpdates; - outputFiles = []; - assetFiles = []; - errors = []; - prerenderedRoutes = {}; - warnings = []; - logs = []; - externalMetadata; - extraWatchFiles = []; - htmlIndexPath; - htmlBaseHref; - constructor(rebuildContexts, componentStyleBundler, codeBundleCache, templateUpdates) { - this.rebuildContexts = rebuildContexts; - this.componentStyleBundler = componentStyleBundler; - this.codeBundleCache = codeBundleCache; - this.templateUpdates = templateUpdates; - } - addOutputFile(path, content, type) { - this.outputFiles.push((0, utils_1.createOutputFile)(path, content, type)); - } - addAssets(assets) { - this.assetFiles.push(...assets); - } - addLog(value) { - this.logs.push(value); - } - addError(error) { - if (typeof error === 'string') { - this.errors.push({ text: error, location: null }); - } - else { - this.errors.push(error); - } - } - addErrors(errors) { - for (const error of errors) { - this.addError(error); - } - } - addPrerenderedRoutes(routes) { - Object.assign(this.prerenderedRoutes, routes); - // Sort the prerendered routes. - const sortedObj = {}; - for (const key of Object.keys(this.prerenderedRoutes).sort()) { - sortedObj[key] = this.prerenderedRoutes[key]; - } - this.prerenderedRoutes = sortedObj; - } - addWarning(error) { - if (typeof error === 'string') { - this.warnings.push({ text: error, location: null }); - } - else { - this.warnings.push(error); - } - } - addWarnings(errors) { - for (const error of errors) { - this.addWarning(error); - } - } - /** - * Add external JavaScript import metadata to the result. This is currently used - * by the development server to optimize the prebundling process. - * @param implicitBrowser External dependencies for the browser bundles due to the external packages option. - * @param implicitServer External dependencies for the server bundles due to the external packages option. - * @param explicit External dependencies due to explicit project configuration. - */ - setExternalMetadata(implicitBrowser, implicitServer, explicit) { - this.externalMetadata = { implicitBrowser, implicitServer, explicit }; - } - get output() { - return { - success: this.errors.length === 0, - }; - } - get outputWithFiles() { - return { - success: this.errors.length === 0, - outputFiles: this.outputFiles, - assetFiles: this.assetFiles, - errors: this.errors, - externalMetadata: this.externalMetadata, - }; - } - get watchFiles() { - const { typescriptContexts, otherContexts } = this.rebuildContexts; - return [ - // Bundler contexts internally normalize file dependencies. - ...typescriptContexts.flatMap((context) => [...context.watchFiles]), - ...otherContexts.flatMap((context) => [...context.watchFiles]), - // These files originate from TS/NG and can have POSIX path separators even on Windows. - // To ensure path comparisons are valid, all these paths must be normalized. - ...(this.codeBundleCache?.referencedFiles?.map(node_path_1.normalize) ?? []), - // The assets source files. - ...this.assetFiles.map(({ source }) => source), - ...this.extraWatchFiles, - ]; - } - createRebuildState(fileChanges) { - return { - rebuildContexts: this.rebuildContexts, - codeBundleCache: this.codeBundleCache, - componentStyleBundler: this.componentStyleBundler, - fileChanges, - previousOutputInfo: new Map(this.outputFiles.map(({ path, hash, type }) => [path, { hash, type }])), - previousAssetsInfo: new Map(this.assetFiles.map(({ source, destination }) => [source, destination])), - templateUpdates: this.templateUpdates, - }; - } - findChangedFiles(previousOutputHashes) { - const changed = new Set(); - for (const file of this.outputFiles) { - const previousHash = previousOutputHashes.get(file.path)?.hash; - if (previousHash === undefined || previousHash !== file.hash) { - changed.add(file.path); - } - } - return changed; - } - async dispose() { - await Promise.allSettled([ - ...this.rebuildContexts.typescriptContexts.map((context) => context.dispose()), - ...this.rebuildContexts.otherContexts.map((context) => context.dispose()), - this.componentStyleBundler.dispose(), - ]); - } -} -exports.ExecutionResult = ExecutionResult; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/cache.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/cache.d.ts deleted file mode 100755 index d125397..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/cache.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -/** - * @fileoverview - * Provides infrastructure for common caching functionality within the build system. - */ -/** - * A backing data store for one or more Cache instances. - * The interface is intentionally designed to support using a JavaScript - * Map instance as a potential cache store. - */ -export interface CacheStore { - /** - * Returns the specified value from the cache store or `undefined` if not found. - * @param key The key to retrieve from the store. - */ - get(key: string): V | undefined | Promise; - /** - * Returns whether the provided key is present in the cache store. - * @param key The key to check from the store. - */ - has(key: string): boolean | Promise; - /** - * Adds a new value to the cache store if the key is not present. - * Updates the value for the key if already present. - * @param key The key to associate with the value in the cache store. - * @param value The value to add to the cache store. - */ - set(key: string, value: V): this | Promise; -} -/** - * A cache object that allows accessing and storing key/value pairs in - * an underlying CacheStore. This class is the primary method for consumers - * to use a cache. - */ -export declare class Cache = CacheStore> { - protected readonly store: S; - readonly namespace?: string | undefined; - constructor(store: S, namespace?: string | undefined); - /** - * Prefixes a key with the cache namespace if present. - * @param key A key string to prefix. - * @returns A prefixed key if a namespace is present. Otherwise the provided key. - */ - protected withNamespace(key: string): string; - /** - * Gets the value associated with a provided key if available. - * Otherwise, creates a value using the factory creator function, puts the value - * in the cache, and returns the new value. - * @param key A key associated with the value. - * @param creator A factory function for the value if no value is present. - * @returns A value associated with the provided key. - */ - getOrCreate(key: string, creator: () => V | Promise): Promise; - /** - * Gets the value associated with a provided key if available. - * @param key A key associated with the value. - * @returns A value associated with the provided key if present. Otherwise, `undefined`. - */ - get(key: string): Promise; - /** - * Puts a value in the cache and associates it with the provided key. - * If the key is already present, the value is updated instead. - * @param key A key associated with the value. - * @param value A value to put in the cache. - */ - put(key: string, value: V): Promise; -} -/** - * A lightweight in-memory cache implementation based on a JavaScript Map object. - */ -export declare class MemoryCache extends Cache> { - constructor(); - /** - * Removes all entries from the cache instance. - */ - clear(): void; - /** - * Provides all the values currently present in the cache instance. - * @returns An iterable of all values in the cache. - */ - values(): MapIterator; - /** - * Provides all the keys/values currently present in the cache instance. - * @returns An iterable of all key/value pairs in the cache. - */ - entries(): MapIterator<[string, V]>; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/cache.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/cache.js deleted file mode 100755 index 59fdc10..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/cache.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MemoryCache = exports.Cache = void 0; -/** - * A cache object that allows accessing and storing key/value pairs in - * an underlying CacheStore. This class is the primary method for consumers - * to use a cache. - */ -class Cache { - store; - namespace; - constructor(store, namespace) { - this.store = store; - this.namespace = namespace; - } - /** - * Prefixes a key with the cache namespace if present. - * @param key A key string to prefix. - * @returns A prefixed key if a namespace is present. Otherwise the provided key. - */ - withNamespace(key) { - if (this.namespace) { - return `${this.namespace}:${key}`; - } - return key; - } - /** - * Gets the value associated with a provided key if available. - * Otherwise, creates a value using the factory creator function, puts the value - * in the cache, and returns the new value. - * @param key A key associated with the value. - * @param creator A factory function for the value if no value is present. - * @returns A value associated with the provided key. - */ - async getOrCreate(key, creator) { - const namespacedKey = this.withNamespace(key); - let value = await this.store.get(namespacedKey); - if (value === undefined) { - value = await creator(); - await this.store.set(namespacedKey, value); - } - return value; - } - /** - * Gets the value associated with a provided key if available. - * @param key A key associated with the value. - * @returns A value associated with the provided key if present. Otherwise, `undefined`. - */ - async get(key) { - const value = await this.store.get(this.withNamespace(key)); - return value; - } - /** - * Puts a value in the cache and associates it with the provided key. - * If the key is already present, the value is updated instead. - * @param key A key associated with the value. - * @param value A value to put in the cache. - */ - async put(key, value) { - await this.store.set(this.withNamespace(key), value); - } -} -exports.Cache = Cache; -/** - * A lightweight in-memory cache implementation based on a JavaScript Map object. - */ -class MemoryCache extends Cache { - constructor() { - super(new Map()); - } - /** - * Removes all entries from the cache instance. - */ - clear() { - this.store.clear(); - } - /** - * Provides all the values currently present in the cache instance. - * @returns An iterable of all values in the cache. - */ - values() { - return this.store.values(); - } - /** - * Provides all the keys/values currently present in the cache instance. - * @returns An iterable of all key/value pairs in the cache. - */ - entries() { - return this.store.entries(); - } -} -exports.MemoryCache = MemoryCache; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/commonjs-checker.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/commonjs-checker.d.ts deleted file mode 100755 index 0af59dd..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/commonjs-checker.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Metafile, PartialMessage } from 'esbuild'; -/** - * Checks the input files of a build to determine if any of the files included - * in the build are not ESM. ESM files can be tree-shaken and otherwise optimized - * in ways that CommonJS and other module formats cannot. The esbuild metafile - * information is used as the basis for the analysis as it contains information - * for each input file including its respective format. - * - * If any allowed dependencies are provided via the `allowedCommonJsDependencies` - * parameter, both the direct import and any deep imports will be ignored and no - * diagnostic will be generated. Use `'*'` as entry to skip the check. - * - * If a module has been issued a diagnostic message, then all descendant modules - * will not be checked. This prevents a potential massive amount of inactionable - * messages since the initial module import is the cause of the problem. - * - * @param metafile An esbuild metafile object to check. - * @param allowedCommonJsDependencies An optional list of allowed dependencies. - * @returns Zero or more diagnostic messages for any non-ESM modules. - */ -export declare function checkCommonJSModules(metafile: Metafile, allowedCommonJsDependencies?: string[]): PartialMessage[]; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/commonjs-checker.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/commonjs-checker.js deleted file mode 100755 index e884a46..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/commonjs-checker.js +++ /dev/null @@ -1,150 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkCommonJSModules = checkCommonJSModules; -/** - * Checks the input files of a build to determine if any of the files included - * in the build are not ESM. ESM files can be tree-shaken and otherwise optimized - * in ways that CommonJS and other module formats cannot. The esbuild metafile - * information is used as the basis for the analysis as it contains information - * for each input file including its respective format. - * - * If any allowed dependencies are provided via the `allowedCommonJsDependencies` - * parameter, both the direct import and any deep imports will be ignored and no - * diagnostic will be generated. Use `'*'` as entry to skip the check. - * - * If a module has been issued a diagnostic message, then all descendant modules - * will not be checked. This prevents a potential massive amount of inactionable - * messages since the initial module import is the cause of the problem. - * - * @param metafile An esbuild metafile object to check. - * @param allowedCommonJsDependencies An optional list of allowed dependencies. - * @returns Zero or more diagnostic messages for any non-ESM modules. - */ -function checkCommonJSModules(metafile, allowedCommonJsDependencies) { - const messages = []; - const allowedRequests = new Set(allowedCommonJsDependencies); - if (allowedRequests.has('*')) { - return messages; - } - // Ignore Angular locale definitions which are currently UMD - allowedRequests.add('@angular/common/locales'); - // Ignore zone.js due to it currently being built with a UMD like structure. - // Once the build output is updated to be fully ESM, this can be removed. - allowedRequests.add('zone.js'); - // Used by '@angular/platform-server' and is in a seperate chunk that is unused when - // using `provideHttpClient(withFetch())`. - allowedRequests.add('xhr2'); - // Packages used by @angular/ssr. - // While beasties is ESM it has a number of direct and transtive CJS deps. - allowedRequests.add('express'); - allowedRequests.add('beasties'); - // Find all entry points that contain code (JS/TS) - const files = []; - for (const { entryPoint } of Object.values(metafile.outputs)) { - if (!entryPoint) { - continue; - } - if (!isPathCode(entryPoint)) { - continue; - } - files.push(entryPoint); - } - // Track seen files so they are only analyzed once. - // Bundler runtime code is also ignored since it cannot be actionable. - const seenFiles = new Set(['']); - // Analyze the files present by walking the import graph - let currentFile; - while ((currentFile = files.shift())) { - const input = metafile.inputs[currentFile]; - for (const imported of input.imports) { - // Ignore imports that were already seen or not originally in the code (bundler injected) - if (!imported.original || seenFiles.has(imported.path)) { - continue; - } - seenFiles.add(imported.path); - // If the dependency is allowed ignore all other checks - if (allowedRequests.has(imported.original)) { - continue; - } - // Only check actual code files - if (!isPathCode(imported.path)) { - continue; - } - // Check if non-relative import is ESM format and issue a diagnostic if the file is not allowed - if (!isPotentialRelative(imported.original) && - metafile.inputs[imported.path].format !== 'esm') { - const request = imported.original; - let notAllowed = true; - if (allowedRequests.has(request)) { - notAllowed = false; - } - else { - // Check for deep imports of allowed requests - for (const allowed of allowedRequests) { - if (request.startsWith(allowed + '/')) { - notAllowed = false; - break; - } - } - } - if (notAllowed) { - // Issue a diagnostic message for CommonJS module - messages.push(createCommonJSModuleError(request, currentFile)); - } - // Skip all descendants since they are also most likely not ESM but solved by addressing this import - continue; - } - // Add the path so that its imports can be checked - files.push(imported.path); - } - } - return messages; -} -/** - * Determines if a file path has an extension that is a JavaScript or TypeScript - * code file. - * - * @param name A path to check for code file extensions. - * @returns True, if a code file path; false, otherwise. - */ -function isPathCode(name) { - return /\.[cm]?[jt]sx?$/.test(name); -} -/** - * Test an import module specifier to determine if the string potentially references a relative file. - * npm packages should not start with a period so if the first character is a period than it is not a - * package. While this is sufficient for the use case in the CommmonJS checker, only checking the - * first character does not definitely indicate the specifier is a relative path. - * - * @param specifier An import module specifier. - * @returns True, if specifier is potentially relative; false, otherwise. - */ -function isPotentialRelative(specifier) { - return specifier[0] === '.'; -} -/** - * Creates an esbuild diagnostic message for a given non-ESM module request. - * - * @param request The requested non-ESM module name. - * @param importer The path of the file containing the import. - * @returns A message representing the diagnostic. - */ -function createCommonJSModuleError(request, importer) { - const error = { - text: `Module '${request}' used by '${importer}' is not ESM`, - notes: [ - { - text: 'CommonJS or AMD dependencies can cause optimization bailouts.\n' + - 'For more information see: https://angular.dev/tools/cli/build#configuring-commonjs-dependencies', - }, - ], - }; - return error; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/compiler-plugin-options.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/compiler-plugin-options.d.ts deleted file mode 100755 index de99e8d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/compiler-plugin-options.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { NormalizedApplicationBuildOptions } from '../../builders/application/options'; -import type { createCompilerPlugin } from './angular/compiler-plugin'; -import type { SourceFileCache } from './angular/source-file-cache'; -import type { LoadResultCache } from './load-result-cache'; -type CreateCompilerPluginParameters = Parameters; -export declare function createCompilerPluginOptions(options: NormalizedApplicationBuildOptions, sourceFileCache: SourceFileCache, loadResultCache?: LoadResultCache, templateUpdates?: Map): CreateCompilerPluginParameters[0]; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/compiler-plugin-options.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/compiler-plugin-options.js deleted file mode 100755 index 22adab1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/compiler-plugin-options.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createCompilerPluginOptions = createCompilerPluginOptions; -function createCompilerPluginOptions(options, sourceFileCache, loadResultCache, templateUpdates) { - const { sourcemapOptions, tsconfig, fileReplacements, advancedOptimizations, jit, externalRuntimeStyles, instrumentForCoverage, optimizationOptions, } = options; - const incremental = !!options.watch; - return { - sourcemap: !!sourcemapOptions.scripts && (sourcemapOptions.hidden ? 'external' : true), - thirdPartySourcemaps: sourcemapOptions.vendor, - tsconfig, - jit, - advancedOptimizations, - fileReplacements, - sourceFileCache, - loadResultCache, - incremental, - externalRuntimeStyles, - instrumentForCoverage, - templateUpdates, - includeTestMetadata: !optimizationOptions.scripts, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/external-packages-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/external-packages-plugin.d.ts deleted file mode 100755 index 4010026..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/external-packages-plugin.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -/** - * Creates a plugin that marks any resolved path as external if it is within a node modules directory. - * This is used instead of the esbuild `packages` option to avoid marking files that should be loaded - * via customized loaders. This is necessary to prevent Vite development server pre-bundling errors. - * - * @returns An esbuild plugin. - */ -export declare function createExternalPackagesPlugin(options?: { - exclude?: string[]; -}): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/external-packages-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/external-packages-plugin.js deleted file mode 100755 index 864b315..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/external-packages-plugin.js +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createExternalPackagesPlugin = createExternalPackagesPlugin; -const node_path_1 = require("node:path"); -const EXTERNAL_PACKAGE_RESOLUTION = Symbol('EXTERNAL_PACKAGE_RESOLUTION'); -/** - * Creates a plugin that marks any resolved path as external if it is within a node modules directory. - * This is used instead of the esbuild `packages` option to avoid marking files that should be loaded - * via customized loaders. This is necessary to prevent Vite development server pre-bundling errors. - * - * @returns An esbuild plugin. - */ -function createExternalPackagesPlugin(options) { - const exclusions = new Set(options?.exclude); - // Similar to esbuild, --external:@foo/bar automatically implies --external:@foo/bar/*, - // which matches import paths like @foo/bar/baz. - // This means all paths within the @foo/bar package are also marked as external. - const exclusionsPrefixes = options?.exclude?.map((exclusion) => exclusion + '/') ?? []; - const seenExclusions = new Set(); - const seenExternals = new Set(); - const seenNonExclusions = new Set(); - return { - name: 'angular-external-packages', - setup(build) { - // Find all loader keys that are not using the 'file' loader. - // The 'file' loader is automatically handled by Vite and does not need exclusion. - const loaderOptionKeys = build.initialOptions.loader && - Object.entries(build.initialOptions.loader) - .filter(([, value]) => value !== 'file') - .map(([key]) => key); - // Safe to use native packages external option if no loader options or exclusions present - if (!exclusions.size && !loaderOptionKeys?.length) { - build.initialOptions.packages = 'external'; - return; - } - const loaderFileExtensions = new Set(loaderOptionKeys); - // Only attempt resolve of non-relative and non-absolute paths - build.onResolve({ filter: /^[^./]/ }, async (args) => { - if (args.pluginData?.[EXTERNAL_PACKAGE_RESOLUTION]) { - return null; - } - if (seenExternals.has(args.path)) { - return { external: true }; - } - if (exclusions.has(args.path) || seenExclusions.has(args.path)) { - return null; - } - if (!seenNonExclusions.has(args.path)) { - for (const exclusion of exclusionsPrefixes) { - if (args.path.startsWith(exclusion)) { - seenExclusions.add(args.path); - return null; - } - } - seenNonExclusions.add(args.path); - } - const { importer, kind, resolveDir, namespace, pluginData = {} } = args; - pluginData[EXTERNAL_PACKAGE_RESOLUTION] = true; - const result = await build.resolve(args.path, { - importer, - kind, - namespace, - pluginData, - resolveDir, - }); - // Return result if unable to resolve - if (!result.path) { - return result; - } - // Return if explicitly marked external (externalDependencies option) - if (result.external) { - seenExternals.add(args.path); - return { external: true }; - } - // Allow customized loaders to run against configured paths regardless of location - if (loaderFileExtensions.has((0, node_path_1.extname)(result.path))) { - return result; - } - // Mark paths from a node modules directory as external - if (/[\\/]node_modules[\\/]/.test(result.path)) { - seenExternals.add(args.path); - return { external: true }; - } - // Otherwise return original result - return result; - }); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-scripts.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-scripts.d.ts deleted file mode 100755 index ab23064..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-scripts.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { NormalizedApplicationBuildOptions } from '../../builders/application/options'; -import { BundlerOptionsFactory } from './bundler-context'; -/** - * Create an esbuild 'build' options object for all global scripts defined in the user provied - * build options. - * @param options The builder's user-provider normalized options. - * @returns An esbuild BuildOptions object. - */ -export declare function createGlobalScriptsBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], initial: boolean): BundlerOptionsFactory | undefined; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-scripts.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-scripts.js deleted file mode 100755 index 927e2fc..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-scripts.js +++ /dev/null @@ -1,152 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createGlobalScriptsBundleOptions = createGlobalScriptsBundleOptions; -const magic_string_1 = __importStar(require("magic-string")); -const node_assert_1 = __importDefault(require("node:assert")); -const promises_1 = require("node:fs/promises"); -const node_path_1 = __importDefault(require("node:path")); -const error_1 = require("../../utils/error"); -const load_result_cache_1 = require("./load-result-cache"); -const sourcemap_ignorelist_plugin_1 = require("./sourcemap-ignorelist-plugin"); -const virtual_module_plugin_1 = require("./virtual-module-plugin"); -/** - * Create an esbuild 'build' options object for all global scripts defined in the user provied - * build options. - * @param options The builder's user-provider normalized options. - * @returns An esbuild BuildOptions object. - */ -function createGlobalScriptsBundleOptions(options, target, initial) { - const { globalScripts, optimizationOptions, outputNames, preserveSymlinks, sourcemapOptions, jsonLogs, workspaceRoot, define, } = options; - const namespace = 'angular:script/global'; - const entryPoints = {}; - let found = false; - for (const script of globalScripts) { - if (script.initial === initial) { - found = true; - entryPoints[script.name] = `${namespace}:${script.name}`; - } - } - // Skip if there are no entry points for the style loading type - if (found === false) { - return; - } - return (loadCache) => { - return { - absWorkingDir: workspaceRoot, - bundle: false, - splitting: false, - entryPoints, - entryNames: initial ? outputNames.bundles : '[name]', - assetNames: outputNames.media, - mainFields: ['script', 'browser', 'main'], - conditions: ['script', optimizationOptions.scripts ? 'production' : 'development'], - resolveExtensions: ['.mjs', '.js', '.cjs'], - logLevel: options.verbose && !jsonLogs ? 'debug' : 'silent', - metafile: true, - minify: optimizationOptions.scripts, - outdir: workspaceRoot, - sourcemap: sourcemapOptions.scripts && (sourcemapOptions.hidden ? 'external' : true), - write: false, - platform: 'neutral', - target, - preserveSymlinks, - define, - plugins: [ - (0, sourcemap_ignorelist_plugin_1.createSourcemapIgnorelistPlugin)(), - (0, virtual_module_plugin_1.createVirtualModulePlugin)({ - namespace, - external: true, - // Add the `js` extension here so that esbuild generates an output file with the extension - transformPath: (path) => path.slice(namespace.length + 1) + '.js', - loadContent: (args, build) => (0, load_result_cache_1.createCachedLoad)(loadCache, async (args) => { - const files = globalScripts.find(({ name }) => name === args.path.slice(0, -3))?.files; - (0, node_assert_1.default)(files, `Invalid operation: global scripts name not found [${args.path}]`); - // Global scripts are concatenated using magic-string instead of bundled via esbuild. - const bundleContent = new magic_string_1.Bundle(); - const watchFiles = []; - for (const filename of files) { - let fileContent; - try { - // Attempt to read as a relative path from the workspace root - const fullPath = node_path_1.default.join(workspaceRoot, filename); - fileContent = await (0, promises_1.readFile)(fullPath, 'utf-8'); - watchFiles.push(fullPath); - } - catch (e) { - (0, error_1.assertIsError)(e); - if (e.code !== 'ENOENT') { - throw e; - } - // If not found, attempt to resolve as a module specifier - const resolveResult = await build.resolve(filename, { - kind: 'entry-point', - resolveDir: workspaceRoot, - }); - if (resolveResult.errors.length) { - // Remove resolution failure notes about marking as external since it doesn't apply - // to global scripts. - resolveResult.errors.forEach((error) => (error.notes = [])); - return { - errors: resolveResult.errors, - warnings: resolveResult.warnings, - }; - } - watchFiles.push(resolveResult.path); - fileContent = await (0, promises_1.readFile)(resolveResult.path, 'utf-8'); - } - bundleContent.addSource(new magic_string_1.default(fileContent, { filename })); - } - return { - contents: bundleContent.toString(), - loader: 'js', - watchFiles, - }; - }).call(build, args), - }), - ], - }; - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-styles.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-styles.d.ts deleted file mode 100755 index de2f03d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-styles.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { NormalizedApplicationBuildOptions } from '../../builders/application/options'; -import { BundlerOptionsFactory } from './bundler-context'; -export declare function createGlobalStylesBundleOptions(options: NormalizedApplicationBuildOptions, target: string[], initial: boolean): BundlerOptionsFactory | undefined; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-styles.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-styles.js deleted file mode 100755 index c00742b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/global-styles.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createGlobalStylesBundleOptions = createGlobalStylesBundleOptions; -const node_assert_1 = __importDefault(require("node:assert")); -const path_1 = require("../../utils/path"); -const bundle_options_1 = require("./stylesheets/bundle-options"); -const virtual_module_plugin_1 = require("./virtual-module-plugin"); -function createGlobalStylesBundleOptions(options, target, initial) { - const { workspaceRoot, optimizationOptions, sourcemapOptions, outputNames, globalStyles, preserveSymlinks, externalDependencies, stylePreprocessorOptions, tailwindConfiguration, postcssConfiguration, cacheOptions, } = options; - const namespace = 'angular:styles/global'; - const entryPoints = {}; - let found = false; - for (const style of globalStyles) { - if (style.initial === initial) { - found = true; - entryPoints[style.name] = `${namespace};${style.name}`; - } - } - // Skip if there are no entry points for the style loading type - if (found === false) { - return; - } - return (loadCache) => { - const buildOptions = (0, bundle_options_1.createStylesheetBundleOptions)({ - workspaceRoot, - optimization: !!optimizationOptions.styles.minify, - inlineFonts: !!optimizationOptions.fonts.inline, - sourcemap: !!sourcemapOptions.styles && (sourcemapOptions.hidden ? 'external' : true), - sourcesContent: sourcemapOptions.sourcesContent, - preserveSymlinks, - target, - externalDependencies, - outputNames: initial - ? outputNames - : { - ...outputNames, - bundles: '[name]', - }, - includePaths: stylePreprocessorOptions?.includePaths, - // string[] | undefined' is not assignable to type '(Version | DeprecationOrId)[] | undefined'. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - sass: stylePreprocessorOptions?.sass, - tailwindConfiguration, - postcssConfiguration, - cacheOptions, - }, loadCache); - // Keep special CSS comments `/*! comment */` in place when `removeSpecialComments` is disabled. - // These comments are special for a number of CSS tools such as Beasties and PurgeCSS. - buildOptions.legalComments = optimizationOptions.styles?.removeSpecialComments - ? 'none' - : 'inline'; - buildOptions.entryPoints = entryPoints; - buildOptions.plugins.unshift((0, virtual_module_plugin_1.createVirtualModulePlugin)({ - namespace, - transformPath: (path) => path.split(';', 2)[1], - loadContent: (args) => { - const files = globalStyles.find(({ name }) => name === args.path)?.files; - (0, node_assert_1.default)(files, `global style name should always be found [${args.path}]`); - return { - contents: files.map((file) => `@import '${(0, path_1.toPosixPath)(file)}';`).join('\n'), - loader: 'css', - resolveDir: workspaceRoot, - }; - }, - })); - return buildOptions; - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner-worker.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner-worker.d.ts deleted file mode 100755 index f660a06..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner-worker.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -/** - * The options passed to the inliner for each file request - */ -interface InlineFileRequest { - /** - * The filename that should be processed. The data for the file is provided to the Worker - * during Worker initialization. - */ - filename: string; - /** - * The locale specifier that should be used during the inlining process of the file. - */ - locale: string; - /** - * The translation messages for the locale that should be used during the inlining process of the file. - */ - translation?: Record; -} -/** - * The options passed to the inliner for each code request - */ -interface InlineCodeRequest { - /** - * The code that should be processed. - */ - code: string; - /** - * The filename to use in error and warning messages for the provided code. - */ - filename: string; - /** - * The locale specifier that should be used during the inlining process of the file. - */ - locale: string; - /** - * The translation messages for the locale that should be used during the inlining process of the file. - */ - translation?: Record; -} -/** - * Inlines the provided locale and translation into a JavaScript file that contains `$localize` usage. - * This function is the main entry for the Worker's action that is called by the worker pool. - * - * @param request An InlineRequest object representing the options for inlining - * @returns An object containing the inlined file and optional map content. - */ -export default function inlineFile(request: InlineFileRequest): Promise<{ - file: string; - code: string; - map: string | undefined; - messages: { - type: "warning" | "error"; - message: string; - }[]; -}>; -/** - * Inlines the provided locale and translation into JavaScript code that contains `$localize` usage. - * This function is a secondary entry primarily for use with component HMR update modules. - * - * @param request An InlineRequest object representing the options for inlining - * @returns An object containing the inlined code. - */ -export declare function inlineCode(request: InlineCodeRequest): Promise<{ - output: string; - messages: { - type: "warning" | "error"; - message: string; - }[]; -}>; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner-worker.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner-worker.js deleted file mode 100755 index 311b2c0..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner-worker.js +++ /dev/null @@ -1,151 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = inlineFile; -exports.inlineCode = inlineCode; -const remapping_1 = __importDefault(require("@ampproject/remapping")); -const core_1 = require("@babel/core"); -const node_assert_1 = __importDefault(require("node:assert")); -const node_worker_threads_1 = require("node:worker_threads"); -const error_1 = require("../../utils/error"); -const load_esm_1 = require("../../utils/load-esm"); -// Extract the application files and common options used for inline requests from the Worker context -// TODO: Evaluate overall performance difference of passing translations here as well -const { files, missingTranslation, shouldOptimize } = (node_worker_threads_1.workerData || {}); -/** - * Inlines the provided locale and translation into a JavaScript file that contains `$localize` usage. - * This function is the main entry for the Worker's action that is called by the worker pool. - * - * @param request An InlineRequest object representing the options for inlining - * @returns An object containing the inlined file and optional map content. - */ -async function inlineFile(request) { - const data = files.get(request.filename); - (0, node_assert_1.default)(data !== undefined, `Invalid inline request for file '${request.filename}'.`); - const code = await data.text(); - const map = await files.get(request.filename + '.map')?.text(); - const result = await transformWithBabel(code, map && JSON.parse(map), request); - return { - file: request.filename, - code: result.code, - map: result.map, - messages: result.diagnostics.messages, - }; -} -/** - * Inlines the provided locale and translation into JavaScript code that contains `$localize` usage. - * This function is a secondary entry primarily for use with component HMR update modules. - * - * @param request An InlineRequest object representing the options for inlining - * @returns An object containing the inlined code. - */ -async function inlineCode(request) { - const result = await transformWithBabel(request.code, undefined, request); - return { - output: result.code, - messages: result.diagnostics.messages, - }; -} -/** - * Cached instance of the `@angular/localize/tools` module. - * This is used to remove the need to repeatedly import the module per file translation. - */ -let localizeToolsModule; -/** - * Attempts to load the `@angular/localize/tools` module containing the functionality to - * perform the file translations. - * This module must be dynamically loaded as it is an ESM module and this file is CommonJS. - */ -async function loadLocalizeTools() { - // Load ESM `@angular/localize/tools` using the TypeScript dynamic import workaround. - // Once TypeScript provides support for keeping the dynamic import this workaround can be - // changed to a direct dynamic import. - localizeToolsModule ??= await (0, load_esm_1.loadEsmModule)('@angular/localize/tools'); - return localizeToolsModule; -} -/** - * Creates the needed Babel plugins to inline a given locale and translation for a JavaScript file. - * @param locale A string containing the locale specifier to use. - * @param translation A object record containing locale specific messages to use. - * @returns An array of Babel plugins. - */ -async function createI18nPlugins(locale, translation) { - const { Diagnostics, makeEs2015TranslatePlugin } = await loadLocalizeTools(); - const plugins = []; - const diagnostics = new Diagnostics(); - plugins.push( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - makeEs2015TranslatePlugin(diagnostics, (translation || {}), { - missingTranslation: translation === undefined ? 'ignore' : missingTranslation, - })); - // Create a plugin to replace the locale specifier constant inject by the build system with the actual specifier - plugins.push({ - visitor: { - StringLiteral(path) { - if (path.node.value === '___NG_LOCALE_INSERT___') { - path.replaceWith(core_1.types.stringLiteral(locale)); - } - }, - }, - }); - return { diagnostics, plugins }; -} -/** - * Transforms a JavaScript file using Babel to inline the request locale and translation. - * @param code A string containing the JavaScript code to transform. - * @param map A sourcemap object for the provided JavaScript code. - * @param options The inline request options to use. - * @returns An object containing the code, map, and diagnostics from the transformation. - */ -async function transformWithBabel(code, map, options) { - let ast; - try { - ast = (0, core_1.parseSync)(code, { - babelrc: false, - configFile: false, - sourceType: 'unambiguous', - filename: options.filename, - }); - } - catch (error) { - (0, error_1.assertIsError)(error); - // Make the error more readable. - // Same errors will contain the full content of the file as the error message - // Which makes it hard to find the actual error message. - const index = error.message.indexOf(')\n'); - const msg = index !== -1 ? error.message.slice(0, index + 1) : error.message; - throw new Error(`${msg}\nAn error occurred inlining file "${options.filename}"`); - } - if (!ast) { - throw new Error(`Unknown error occurred inlining file "${options.filename}"`); - } - const { diagnostics, plugins } = await createI18nPlugins(options.locale, options.translation); - const transformResult = await (0, core_1.transformFromAstAsync)(ast, code, { - filename: options.filename, - // false is a valid value but not included in the type definition - inputSourceMap: false, - sourceMaps: !!map, - compact: shouldOptimize, - configFile: false, - babelrc: false, - browserslistConfigFile: false, - plugins, - }); - if (!transformResult || !transformResult.code) { - throw new Error(`Unknown error occurred processing bundle for "${options.filename}".`); - } - let outputMap; - if (map && transformResult.map) { - outputMap = (0, remapping_1.default)([transformResult.map, map], () => null); - } - return { code: transformResult.code, map: outputMap && JSON.stringify(outputMap), diagnostics }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner.d.ts deleted file mode 100755 index 9b44032..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BuildOutputFile } from './bundler-context'; -/** - * Inlining options that should apply to all transformed code. - */ -export interface I18nInlinerOptions { - missingTranslation: 'error' | 'warning' | 'ignore'; - outputFiles: BuildOutputFile[]; - shouldOptimize?: boolean; - persistentCachePath?: string; -} -/** - * A class that performs i18n translation inlining of JavaScript code. - * A worker pool is used to distribute the transformation actions and allow - * parallel processing. Inlining is only performed on code that contains the - * localize function (`$localize`). - */ -export declare class I18nInliner { - #private; - private readonly options; - constructor(options: I18nInlinerOptions, maxThreads?: number); - /** - * Performs inlining of translations for the provided locale and translations. The files that - * are processed originate from the files passed to the class constructor and filter by presence - * of the localize function keyword. - * @param locale The string representing the locale to inline. - * @param translation The translation messages to use when inlining. - * @returns A promise that resolves to an array of OutputFiles representing a translated result. - */ - inlineForLocale(locale: string, translation: Record | undefined): Promise<{ - outputFiles: BuildOutputFile[]; - errors: string[]; - warnings: string[]; - }>; - inlineTemplateUpdate(locale: string, translation: Record | undefined, templateCode: string, templateId: string): Promise<{ - code: string; - errors: string[]; - warnings: string[]; - }>; - /** - * Stops all active transformation tasks and shuts down all workers. - * @returns A void promise that resolves when closing is complete. - */ - close(): Promise; - /** - * Initializes the cache for storing translated bundles. - * If the cache is already initialized, it does nothing. - * - * @returns A promise that resolves once the cache initialization process is complete. - */ - private initCache; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner.js deleted file mode 100755 index 7c25cc7..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-inliner.js +++ /dev/null @@ -1,265 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.I18nInliner = void 0; -const node_assert_1 = __importDefault(require("node:assert")); -const node_crypto_1 = require("node:crypto"); -const node_path_1 = require("node:path"); -const worker_pool_1 = require("../../utils/worker-pool"); -const bundler_context_1 = require("./bundler-context"); -const utils_1 = require("./utils"); -/** - * A keyword used to indicate if a JavaScript file may require inlining of translations. - * This keyword is used to avoid processing files that would not otherwise need i18n processing. - */ -const LOCALIZE_KEYWORD = '$localize'; -/** - * A class that performs i18n translation inlining of JavaScript code. - * A worker pool is used to distribute the transformation actions and allow - * parallel processing. Inlining is only performed on code that contains the - * localize function (`$localize`). - */ -class I18nInliner { - options; - #cacheInitFailed = false; - #workerPool; - #cache; - #localizeFiles; - #unmodifiedFiles; - constructor(options, maxThreads) { - this.options = options; - this.#unmodifiedFiles = []; - const { outputFiles, shouldOptimize, missingTranslation } = options; - const files = new Map(); - const pendingMaps = []; - for (const file of outputFiles) { - if (file.type === bundler_context_1.BuildOutputFileType.Root || file.type === bundler_context_1.BuildOutputFileType.ServerRoot) { - // Skip also the server entry-point. - // Skip stats and similar files. - continue; - } - const fileExtension = (0, node_path_1.extname)(file.path); - if (fileExtension === '.js' || fileExtension === '.mjs') { - // Check if localizations are present - const contentBuffer = Buffer.isBuffer(file.contents) - ? file.contents - : Buffer.from(file.contents.buffer, file.contents.byteOffset, file.contents.byteLength); - const hasLocalize = contentBuffer.includes(LOCALIZE_KEYWORD); - if (hasLocalize) { - files.set(file.path, file); - continue; - } - } - else if (fileExtension === '.map') { - // The related JS file may not have been checked yet. To ensure that map files are not - // missed, store any pending map files and check them after all output files. - pendingMaps.push(file); - continue; - } - this.#unmodifiedFiles.push(file); - } - // Check if any pending map files should be processed by checking if the parent JS file is present - for (const file of pendingMaps) { - if (files.has(file.path.slice(0, -4))) { - files.set(file.path, file); - } - else { - this.#unmodifiedFiles.push(file); - } - } - this.#localizeFiles = files; - this.#workerPool = new worker_pool_1.WorkerPool({ - filename: require.resolve('./i18n-inliner-worker'), - maxThreads, - // Extract options to ensure only the named options are serialized and sent to the worker - workerData: { - missingTranslation, - shouldOptimize, - // A Blob is an immutable data structure that allows sharing the data between workers - // without copying until the data is actually used within a Worker. This is useful here - // since each file may not actually be processed in each Worker and the Blob avoids - // unneeded repeat copying of potentially large JavaScript files. - files: new Map(Array.from(files, ([name, file]) => [name, new Blob([file.contents])])), - }, - }); - } - /** - * Performs inlining of translations for the provided locale and translations. The files that - * are processed originate from the files passed to the class constructor and filter by presence - * of the localize function keyword. - * @param locale The string representing the locale to inline. - * @param translation The translation messages to use when inlining. - * @returns A promise that resolves to an array of OutputFiles representing a translated result. - */ - async inlineForLocale(locale, translation) { - await this.initCache(); - const { shouldOptimize, missingTranslation } = this.options; - // Request inlining for each file that contains localize calls - const requests = []; - let fileCacheKeyBase; - for (const [filename, file] of this.#localizeFiles) { - let cacheKey; - if (filename.endsWith('.map')) { - continue; - } - let cacheResultPromise = Promise.resolve(null); - if (this.#cache) { - fileCacheKeyBase ??= Buffer.from(JSON.stringify({ locale, translation, missingTranslation, shouldOptimize }), 'utf-8'); - // NOTE: If additional options are added, this may need to be updated. - // TODO: Consider xxhash or similar instead of SHA256 - cacheKey = (0, node_crypto_1.createHash)('sha256') - .update(file.hash) - .update(filename) - .update(fileCacheKeyBase) - .digest('hex'); - // Failure to get the value should not fail the transform - cacheResultPromise = this.#cache.get(cacheKey).catch(() => null); - } - const fileResult = cacheResultPromise.then(async (cachedResult) => { - if (cachedResult) { - return cachedResult; - } - const result = await this.#workerPool.run({ filename, locale, translation }); - if (this.#cache && cacheKey) { - // Failure to set the value should not fail the transform - await this.#cache.set(cacheKey, result).catch(() => { }); - } - return result; - }); - requests.push(fileResult); - } - // Wait for all file requests to complete - const rawResults = await Promise.all(requests); - // Convert raw results to output file objects and include all unmodified files - const errors = []; - const warnings = []; - const outputFiles = [ - ...rawResults.flatMap(({ file, code, map, messages }) => { - const type = this.#localizeFiles.get(file)?.type; - (0, node_assert_1.default)(type !== undefined, 'localized file should always have a type' + file); - const resultFiles = [(0, utils_1.createOutputFile)(file, code, type)]; - if (map) { - resultFiles.push((0, utils_1.createOutputFile)(file + '.map', map, type)); - } - for (const message of messages) { - if (message.type === 'error') { - errors.push(message.message); - } - else { - warnings.push(message.message); - } - } - return resultFiles; - }), - ...this.#unmodifiedFiles.map((file) => file.clone()), - ]; - return { - outputFiles, - errors, - warnings, - }; - } - async inlineTemplateUpdate(locale, translation, templateCode, templateId) { - const hasLocalize = templateCode.includes(LOCALIZE_KEYWORD); - if (!hasLocalize) { - return { - code: templateCode, - errors: [], - warnings: [], - }; - } - const { output, messages } = await this.#workerPool.run({ code: templateCode, filename: templateId, locale, translation }, { name: 'inlineCode' }); - const errors = []; - const warnings = []; - for (const message of messages) { - if (message.type === 'error') { - errors.push(message.message); - } - else { - warnings.push(message.message); - } - } - return { - code: output, - errors, - warnings, - }; - } - /** - * Stops all active transformation tasks and shuts down all workers. - * @returns A void promise that resolves when closing is complete. - */ - close() { - return this.#workerPool.destroy(); - } - /** - * Initializes the cache for storing translated bundles. - * If the cache is already initialized, it does nothing. - * - * @returns A promise that resolves once the cache initialization process is complete. - */ - async initCache() { - if (this.#cache || this.#cacheInitFailed) { - return; - } - const { persistentCachePath } = this.options; - // Webcontainers currently do not support this persistent cache store. - if (!persistentCachePath || process.versions.webcontainer) { - return; - } - // Initialize a persistent cache for i18n transformations. - try { - const { LmbdCacheStore } = await Promise.resolve().then(() => __importStar(require('./lmdb-cache-store'))); - this.#cache = new LmbdCacheStore((0, node_path_1.join)(persistentCachePath, 'angular-i18n.db')); - } - catch { - this.#cacheInitFailed = true; - // eslint-disable-next-line no-console - console.warn('Unable to initialize JavaScript cache storage.\n' + - 'This will not affect the build output content but may result in slower builds.'); - } - } -} -exports.I18nInliner = I18nInliner; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-locale-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-locale-plugin.d.ts deleted file mode 100755 index 144b4d1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-locale-plugin.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -/** - * The internal namespace used by generated locale import statements and Angular locale data plugin. - */ -export declare const LOCALE_DATA_NAMESPACE = "angular:locale/data"; -/** - * The base module location used to search for locale specific data. - */ -export declare const LOCALE_DATA_BASE_MODULE = "@angular/common/locales/global"; -/** - * Creates an esbuild plugin that resolves Angular locale data files from `@angular/common`. - * - * @returns An esbuild plugin. - */ -export declare function createAngularLocaleDataPlugin(): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-locale-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-locale-plugin.js deleted file mode 100755 index 0ffd286..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/i18n-locale-plugin.js +++ /dev/null @@ -1,138 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LOCALE_DATA_BASE_MODULE = exports.LOCALE_DATA_NAMESPACE = void 0; -exports.createAngularLocaleDataPlugin = createAngularLocaleDataPlugin; -const node_module_1 = require("node:module"); -/** - * The internal namespace used by generated locale import statements and Angular locale data plugin. - */ -exports.LOCALE_DATA_NAMESPACE = 'angular:locale/data'; -/** - * The base module location used to search for locale specific data. - */ -exports.LOCALE_DATA_BASE_MODULE = '@angular/common/locales/global'; -/** - * Creates an esbuild plugin that resolves Angular locale data files from `@angular/common`. - * - * @returns An esbuild plugin. - */ -function createAngularLocaleDataPlugin() { - return { - name: 'angular-locale-data', - setup(build) { - build.onResolve({ filter: /^angular:locale\/data:/ }, async ({ path }) => { - // Extract the locale from the path - const rawLocaleTag = path.split(':', 3)[2]; - // Extract and normalize the base name of the raw locale tag - let partialLocaleTag; - try { - const locale = new Intl.Locale(rawLocaleTag); - partialLocaleTag = locale.baseName; - } - catch { - return { - path: rawLocaleTag, - namespace: exports.LOCALE_DATA_NAMESPACE, - errors: [ - { - text: `Invalid or unsupported locale provided in configuration: "${rawLocaleTag}"`, - }, - ], - }; - } - let exact = true; - let localeRequire; - while (partialLocaleTag) { - // Angular embeds the `en`/`en-US` locale into the framework and it does not need to be included again here. - // The onLoad hook below for the locale data namespace has an `empty` loader that will prevent inclusion. - // Angular does not contain exact locale data for `en-US` but `en` is equivalent. - if (partialLocaleTag === 'en' || partialLocaleTag === 'en-US') { - return { - path: rawLocaleTag, - namespace: exports.LOCALE_DATA_NAMESPACE, - }; - } - // Attempt to resolve the locale tag data within the Angular base module location - const potentialPath = `${exports.LOCALE_DATA_BASE_MODULE}/${partialLocaleTag}`; - // If packages are configured to be external then leave the original angular locale import path. - // This happens when using the development server with caching enabled to allow Vite prebundling to work. - // There currently is no option on the esbuild resolve function to resolve while disabling the option. - // NOTE: If esbuild eventually allows controlling the external package options in a build.resolve call, this - // workaround can be removed. - let result; - const { packages, absWorkingDir } = build.initialOptions; - if (packages === 'external' && absWorkingDir) { - localeRequire ??= (0, node_module_1.createRequire)(absWorkingDir + '/'); - try { - localeRequire.resolve(potentialPath); - result = { - errors: [], - warnings: [], - external: true, - sideEffects: true, - namespace: '', - suffix: '', - pluginData: undefined, - path: potentialPath, - }; - } - catch { } - } - else { - result = await build.resolve(potentialPath, { - kind: 'import-statement', - resolveDir: absWorkingDir, - }); - } - if (result?.path) { - if (exact) { - return result; - } - else { - return { - ...result, - warnings: [ - ...result.warnings, - { - location: null, - text: `Locale data for '${rawLocaleTag}' cannot be found. Using locale data for '${partialLocaleTag}'.`, - }, - ], - }; - } - } - // Remove the last subtag and try again with a less specific locale. - // Usually the match is exact so the string splitting here is not done until actually needed after the exact - // match fails to resolve. - const parts = partialLocaleTag.split('-'); - partialLocaleTag = parts.slice(0, -1).join('-'); - exact = false; - } - // Not found so issue a warning and use an empty loader. Framework built-in `en-US` data will be used. - // This retains existing behavior as in the Webpack-based builder. - return { - path: rawLocaleTag, - namespace: exports.LOCALE_DATA_NAMESPACE, - warnings: [ - { - location: null, - text: `Locale data for '${rawLocaleTag}' cannot be found. No locale data will be included for this locale.`, - }, - ], - }; - }); - // Locales that cannot be found will be loaded as empty content with a warning from the resolve step - build.onLoad({ filter: /./, namespace: exports.LOCALE_DATA_NAMESPACE }, () => ({ - contents: '', - loader: 'empty', - })); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/index-html-generator.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/index-html-generator.d.ts deleted file mode 100755 index 98cb578..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/index-html-generator.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { NormalizedApplicationBuildOptions } from '../../builders/application/options'; -import { BuildOutputFile, InitialFileRecord } from './bundler-context'; -export declare function generateIndexHtml(initialFiles: Map, outputFiles: BuildOutputFile[], buildOptions: NormalizedApplicationBuildOptions, lang?: string): Promise<{ - csrContent: string; - ssrContent?: string; - warnings: string[]; - errors: string[]; -}>; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/index-html-generator.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/index-html-generator.js deleted file mode 100755 index d37f6ad..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/index-html-generator.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateIndexHtml = generateIndexHtml; -const node_assert_1 = __importDefault(require("node:assert")); -const node_path_1 = __importDefault(require("node:path")); -const index_html_generator_1 = require("../../utils/index-file/index-html-generator"); -const bundler_context_1 = require("./bundler-context"); -/** - * The maximum number of module preload link elements that should be added for - * initial scripts. - */ -const MODULE_PRELOAD_MAX = 10; -async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang) { - // Analyze metafile for initial link-based hints. - // Skip if the internal externalPackages option is enabled since this option requires - // dev server cooperation to properly resolve and fetch imports. - const hints = []; - const { indexHtmlOptions, externalPackages, optimizationOptions, crossOrigin, subresourceIntegrity, baseHref, } = buildOptions; - (0, node_assert_1.default)(indexHtmlOptions, 'indexHtmlOptions cannot be undefined.'); - if (!externalPackages && indexHtmlOptions.preloadInitial) { - const modulePreloads = []; - for (const [key, value] of initialFiles) { - if (value.entrypoint || value.serverFile) { - // Entry points are already referenced in the HTML - continue; - } - if (value.type === 'script') { - modulePreloads.push({ url: key, mode: 'modulepreload', depth: value.depth }); - } - else if (value.type === 'style') { - // Provide an "as" value of "style" to ensure external URLs which may not have a - // file extension are treated as stylesheets. - hints.push({ url: key, mode: 'preload', as: 'style' }); - } - } - // Limit the number of module preloads with smallest depth given priority - modulePreloads.sort((a, b) => a.depth - b.depth); - hints.push(...modulePreloads.slice(0, MODULE_PRELOAD_MAX)); - } - /** Virtual output path to support reading in-memory files. */ - const browserOutputFiles = outputFiles.filter(({ type }) => type === bundler_context_1.BuildOutputFileType.Browser); - const virtualOutputPath = '/'; - const readAsset = async function (filePath) { - // Remove leading directory separator - const relativefilePath = node_path_1.default.relative(virtualOutputPath, filePath); - const file = browserOutputFiles.find((file) => file.path === relativefilePath); - if (file) { - return file.text; - } - throw new Error(`Output file does not exist: ${relativefilePath}`); - }; - // Create an index HTML generator that reads from the in-memory output files - const indexHtmlGenerator = new index_html_generator_1.IndexHtmlGenerator({ - indexPath: indexHtmlOptions.input, - entrypoints: indexHtmlOptions.insertionOrder, - sri: subresourceIntegrity, - optimization: optimizationOptions, - crossOrigin: crossOrigin, - deployUrl: buildOptions.publicPath, - postTransform: indexHtmlOptions.transformer, - generateDedicatedSSRContent: !!(buildOptions.ssrOptions || - buildOptions.prerenderOptions || - buildOptions.appShellOptions), - autoCsp: buildOptions.security.autoCsp, - }); - indexHtmlGenerator.readAsset = readAsset; - return indexHtmlGenerator.process({ - baseHref, - lang, - outputPath: virtualOutputPath, - files: [...initialFiles] - .filter(([, file]) => !file.serverFile) - .map(([file, record]) => ({ - name: record.name ?? '', - file, - extension: node_path_1.default.extname(file), - })), - hints, - }); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer-worker.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer-worker.d.ts deleted file mode 100755 index e0a02c0..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer-worker.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -interface JavaScriptTransformRequest { - filename: string; - data: string | Uint8Array; - sourcemap: boolean; - thirdPartySourcemaps: boolean; - advancedOptimizations: boolean; - skipLinker?: boolean; - sideEffects?: boolean; - jit: boolean; - instrumentForCoverage?: boolean; -} -export default function transformJavaScript(request: JavaScriptTransformRequest): Promise; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer-worker.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer-worker.js deleted file mode 100755 index 95a7693..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer-worker.js +++ /dev/null @@ -1,161 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = transformJavaScript; -const core_1 = require("@babel/core"); -const node_fs_1 = __importDefault(require("node:fs")); -const node_path_1 = __importDefault(require("node:path")); -const piscina_1 = __importDefault(require("piscina")); -const load_esm_1 = require("../../utils/load-esm"); -const textDecoder = new TextDecoder(); -const textEncoder = new TextEncoder(); -/** - * The function name prefix for all Angular partial compilation functions. - * Used to determine if linking of a JavaScript file is required. - * If any additional declarations are added or otherwise changed in the linker, - * the names MUST begin with this prefix. - */ -const LINKER_DECLARATION_PREFIX = 'ɵɵngDeclare'; -async function transformJavaScript(request) { - const { filename, data, ...options } = request; - const textData = typeof data === 'string' ? data : textDecoder.decode(data); - const transformedData = await transformWithBabel(filename, textData, options); - // Transfer the data via `move` instead of cloning - return piscina_1.default.move(textEncoder.encode(transformedData)); -} -/** - * Cached instance of the compiler-cli linker's createEs2015LinkerPlugin function. - */ -let linkerPluginCreator; -async function transformWithBabel(filename, data, options) { - const shouldLink = !options.skipLinker && (await requiresLinking(filename, data)); - const useInputSourcemap = options.sourcemap && - (!!options.thirdPartySourcemaps || !/[\\/]node_modules[\\/]/.test(filename)); - const plugins = []; - if (options.instrumentForCoverage) { - const { default: coveragePlugin } = await Promise.resolve().then(() => __importStar(require('../babel/plugins/add-code-coverage.js'))); - plugins.push(coveragePlugin); - } - if (shouldLink) { - // Lazy load the linker plugin only when linking is required - const linkerPlugin = await createLinkerPlugin(options); - plugins.push(linkerPlugin); - } - if (options.advancedOptimizations) { - const { adjustStaticMembers, adjustTypeScriptEnums, elideAngularMetadata, markTopLevelPure } = await Promise.resolve().then(() => __importStar(require('../babel/plugins'))); - const sideEffectFree = options.sideEffects === false; - const safeAngularPackage = sideEffectFree && /[\\/]node_modules[\\/]@angular[\\/]/.test(filename); - plugins.push([markTopLevelPure, { topLevelSafeMode: !safeAngularPackage }], elideAngularMetadata, adjustTypeScriptEnums, [adjustStaticMembers, { wrapDecorators: sideEffectFree }]); - } - // If no additional transformations are needed, return the data directly - if (plugins.length === 0) { - // Strip sourcemaps if they should not be used - return useInputSourcemap ? data : data.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, ''); - } - const result = await (0, core_1.transformAsync)(data, { - filename, - inputSourceMap: (useInputSourcemap ? undefined : false), - sourceMaps: useInputSourcemap ? 'inline' : false, - compact: false, - configFile: false, - babelrc: false, - browserslistConfigFile: false, - plugins, - }); - const outputCode = result?.code ?? data; - // Strip sourcemaps if they should not be used. - // Babel will keep the original comments even if sourcemaps are disabled. - return useInputSourcemap - ? outputCode - : outputCode.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, ''); -} -async function requiresLinking(path, source) { - // @angular/core and @angular/compiler will cause false positives - // Also, TypeScript files do not require linking - if (/[\\/]@angular[\\/](?:compiler|core)|\.tsx?$/.test(path)) { - return false; - } - // Check if the source code includes one of the declaration functions. - // There is a low chance of a false positive but the names are fairly unique - // and the result would be an unnecessary no-op additional plugin pass. - return source.includes(LINKER_DECLARATION_PREFIX); -} -async function createLinkerPlugin(options) { - linkerPluginCreator ??= (await (0, load_esm_1.loadEsmModule)('@angular/compiler-cli/linker/babel')).createEs2015LinkerPlugin; - const linkerPlugin = linkerPluginCreator({ - linkerJitMode: options.jit, - // This is a workaround until https://github.com/angular/angular/issues/42769 is fixed. - sourceMapping: false, - logger: { - level: 1, // Info level - debug(...args) { - // eslint-disable-next-line no-console - console.debug(args); - }, - info(...args) { - // eslint-disable-next-line no-console - console.info(args); - }, - warn(...args) { - // eslint-disable-next-line no-console - console.warn(args); - }, - error(...args) { - // eslint-disable-next-line no-console - console.error(args); - }, - }, - fileSystem: { - resolve: node_path_1.default.resolve, - exists: node_fs_1.default.existsSync, - dirname: node_path_1.default.dirname, - relative: node_path_1.default.relative, - readFile: node_fs_1.default.readFileSync, - // Node.JS types don't overlap the Compiler types. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - }, - }); - return linkerPlugin; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer.d.ts deleted file mode 100755 index e2188ff..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { Cache } from './cache'; -/** - * Transformation options that should apply to all transformed files and data. - */ -export interface JavaScriptTransformerOptions { - sourcemap: boolean; - thirdPartySourcemaps?: boolean; - advancedOptimizations?: boolean; - jit?: boolean; -} -/** - * A class that performs transformation of JavaScript files and raw data. - * A worker pool is used to distribute the transformation actions and allow - * parallel processing. Transformation behavior is based on the filename and - * data. Transformations may include: async downleveling, Angular linking, - * and advanced optimizations. - */ -export declare class JavaScriptTransformer { - #private; - readonly maxThreads: number; - private readonly cache?; - constructor(options: JavaScriptTransformerOptions, maxThreads: number, cache?: Cache | undefined); - /** - * Performs JavaScript transformations on a file from the filesystem. - * If no transformations are required, the data for the original file will be returned. - * @param filename The full path to the file. - * @param skipLinker If true, bypass all Angular linker processing; if false, attempt linking. - * @param sideEffects If false, and `advancedOptimizations` is enabled tslib decorators are wrapped. - * @returns A promise that resolves to a UTF-8 encoded Uint8Array containing the result. - */ - transformFile(filename: string, skipLinker?: boolean, sideEffects?: boolean, instrumentForCoverage?: boolean): Promise; - /** - * Performs JavaScript transformations on the provided data of a file. The file does not need - * to exist on the filesystem. - * @param filename The full path of the file represented by the data. - * @param data The data of the file that should be transformed. - * @param skipLinker If true, bypass all Angular linker processing; if false, attempt linking. - * @param sideEffects If false, and `advancedOptimizations` is enabled tslib decorators are wrapped. - * @returns A promise that resolves to a UTF-8 encoded Uint8Array containing the result. - */ - transformData(filename: string, data: string, skipLinker: boolean, sideEffects?: boolean, instrumentForCoverage?: boolean): Promise; - /** - * Stops all active transformation tasks and shuts down all workers. - * @returns A void promise that resolves when closing is complete. - */ - close(): Promise; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer.js deleted file mode 100755 index 6e823d9..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/javascript-transformer.js +++ /dev/null @@ -1,152 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.JavaScriptTransformer = void 0; -const node_crypto_1 = require("node:crypto"); -const promises_1 = require("node:fs/promises"); -const utils_1 = require("../../utils/server-rendering/esm-in-memory-loader/utils"); -const worker_pool_1 = require("../../utils/worker-pool"); -/** - * A class that performs transformation of JavaScript files and raw data. - * A worker pool is used to distribute the transformation actions and allow - * parallel processing. Transformation behavior is based on the filename and - * data. Transformations may include: async downleveling, Angular linking, - * and advanced optimizations. - */ -class JavaScriptTransformer { - maxThreads; - cache; - #workerPool; - #commonOptions; - #fileCacheKeyBase; - constructor(options, maxThreads, cache) { - this.maxThreads = maxThreads; - this.cache = cache; - // Extract options to ensure only the named options are serialized and sent to the worker - const { sourcemap, thirdPartySourcemaps = false, advancedOptimizations = false, jit = false, } = options; - this.#commonOptions = { - sourcemap, - thirdPartySourcemaps, - advancedOptimizations, - jit, - }; - this.#fileCacheKeyBase = Buffer.from(JSON.stringify(this.#commonOptions), 'utf-8'); - } - #ensureWorkerPool() { - if (this.#workerPool) { - return this.#workerPool; - } - const workerPoolOptions = { - filename: require.resolve('./javascript-transformer-worker'), - maxThreads: this.maxThreads, - }; - // Prevent passing SSR `--import` (loader-hooks) from parent to child worker. - const filteredExecArgv = process.execArgv.filter((v) => v !== utils_1.IMPORT_EXEC_ARGV); - if (process.execArgv.length !== filteredExecArgv.length) { - workerPoolOptions.execArgv = filteredExecArgv; - } - this.#workerPool = new worker_pool_1.WorkerPool(workerPoolOptions); - return this.#workerPool; - } - /** - * Performs JavaScript transformations on a file from the filesystem. - * If no transformations are required, the data for the original file will be returned. - * @param filename The full path to the file. - * @param skipLinker If true, bypass all Angular linker processing; if false, attempt linking. - * @param sideEffects If false, and `advancedOptimizations` is enabled tslib decorators are wrapped. - * @returns A promise that resolves to a UTF-8 encoded Uint8Array containing the result. - */ - async transformFile(filename, skipLinker, sideEffects, instrumentForCoverage) { - const data = await (0, promises_1.readFile)(filename); - let result; - let cacheKey; - if (this.cache) { - // Create a cache key from the file data and options that effect the output. - // NOTE: If additional options are added, this may need to be updated. - // TODO: Consider xxhash or similar instead of SHA256 - const hash = (0, node_crypto_1.createHash)('sha256'); - hash.update(`${!!skipLinker}--${!!sideEffects}`); - hash.update(data); - hash.update(this.#fileCacheKeyBase); - cacheKey = hash.digest('hex'); - try { - result = await this.cache?.get(cacheKey); - } - catch { - // Failure to get the value should not fail the transform - } - } - if (result === undefined) { - // If there is no cache or no cached entry, process the file - result = (await this.#ensureWorkerPool().run({ - filename, - data, - skipLinker, - sideEffects, - instrumentForCoverage, - ...this.#commonOptions, - }, { - // The below is disable as with Yarn PNP this causes build failures with the below message - // `Unable to deserialize cloned data`. - transferList: process.versions.pnp ? undefined : [data.buffer], - })); - // If there is a cache then store the result - if (this.cache && cacheKey) { - try { - await this.cache.put(cacheKey, result); - } - catch { - // Failure to store the value in the cache should not fail the transform - } - } - } - return result; - } - /** - * Performs JavaScript transformations on the provided data of a file. The file does not need - * to exist on the filesystem. - * @param filename The full path of the file represented by the data. - * @param data The data of the file that should be transformed. - * @param skipLinker If true, bypass all Angular linker processing; if false, attempt linking. - * @param sideEffects If false, and `advancedOptimizations` is enabled tslib decorators are wrapped. - * @returns A promise that resolves to a UTF-8 encoded Uint8Array containing the result. - */ - async transformData(filename, data, skipLinker, sideEffects, instrumentForCoverage) { - // Perform a quick test to determine if the data needs any transformations. - // This allows directly returning the data without the worker communication overhead. - if (skipLinker && !this.#commonOptions.advancedOptimizations && !instrumentForCoverage) { - const keepSourcemap = this.#commonOptions.sourcemap && - (!!this.#commonOptions.thirdPartySourcemaps || !/[\\/]node_modules[\\/]/.test(filename)); - return Buffer.from(keepSourcemap ? data : data.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, ''), 'utf-8'); - } - return this.#ensureWorkerPool().run({ - filename, - data, - skipLinker, - sideEffects, - instrumentForCoverage, - ...this.#commonOptions, - }); - } - /** - * Stops all active transformation tasks and shuts down all workers. - * @returns A void promise that resolves when closing is complete. - */ - async close() { - if (this.#workerPool) { - try { - await this.#workerPool.destroy(); - } - finally { - this.#workerPool = undefined; - } - } - } -} -exports.JavaScriptTransformer = JavaScriptTransformer; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/license-extractor.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/license-extractor.d.ts deleted file mode 100755 index f9c3b15..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/license-extractor.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Metafile } from 'esbuild'; -/** - * Extracts license information for each node module package included in the output - * files of the built code. This includes JavaScript and CSS output files. The esbuild - * metafile generated during the bundling steps is used as the source of information - * regarding what input files where included and where they are located. A path segment - * of `node_modules` is used to indicate that a file belongs to a package and its license - * should be include in the output licenses file. - * - * The package name and license field are extracted from the `package.json` file for the - * package. If a license file (e.g., `LICENSE`) is present in the root of the package, it - * will also be included in the output licenses file. - * - * @param metafile An esbuild metafile object. - * @param rootDirectory The root directory of the workspace. - * @returns A string containing the content of the output licenses file. - */ -export declare function extractLicenses(metafile: Metafile, rootDirectory: string): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/license-extractor.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/license-extractor.js deleted file mode 100755 index 4fac04c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/license-extractor.js +++ /dev/null @@ -1,157 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.extractLicenses = extractLicenses; -const promises_1 = require("node:fs/promises"); -const node_path_1 = __importDefault(require("node:path")); -/** - * The path segment used to signify that a file is part of a package. - */ -const NODE_MODULE_SEGMENT = 'node_modules'; -/** - * String constant for the NPM recommended custom license wording. - * - * See: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#license - * - * Example: - * ``` - * { - * "license" : "SEE LICENSE IN " - * } - * ``` - */ -const CUSTOM_LICENSE_TEXT = 'SEE LICENSE IN '; -/** - * A list of commonly named license files found within packages. - */ -const LICENSE_FILES = ['LICENSE', 'LICENSE.txt', 'LICENSE.md']; -/** - * Header text that will be added to the top of the output license extraction file. - */ -const EXTRACTION_FILE_HEADER = ''; -/** - * The package entry separator to use within the output license extraction file. - */ -const EXTRACTION_FILE_SEPARATOR = '-'.repeat(80) + '\n'; -/** - * Extracts license information for each node module package included in the output - * files of the built code. This includes JavaScript and CSS output files. The esbuild - * metafile generated during the bundling steps is used as the source of information - * regarding what input files where included and where they are located. A path segment - * of `node_modules` is used to indicate that a file belongs to a package and its license - * should be include in the output licenses file. - * - * The package name and license field are extracted from the `package.json` file for the - * package. If a license file (e.g., `LICENSE`) is present in the root of the package, it - * will also be included in the output licenses file. - * - * @param metafile An esbuild metafile object. - * @param rootDirectory The root directory of the workspace. - * @returns A string containing the content of the output licenses file. - */ -async function extractLicenses(metafile, rootDirectory) { - let extractedLicenseContent = `${EXTRACTION_FILE_HEADER}\n${EXTRACTION_FILE_SEPARATOR}`; - const seenPaths = new Set(); - const seenPackages = new Set(); - for (const entry of Object.values(metafile.outputs)) { - for (const [inputPath, { bytesInOutput }] of Object.entries(entry.inputs)) { - // Skip if not included in output - if (bytesInOutput <= 0) { - continue; - } - // Skip already processed paths - if (seenPaths.has(inputPath)) { - continue; - } - seenPaths.add(inputPath); - // Skip non-package paths - if (!inputPath.includes(NODE_MODULE_SEGMENT)) { - continue; - } - // Extract the package name from the path - let baseDirectory = node_path_1.default.join(rootDirectory, inputPath); - let nameOrScope, nameOrFile; - let found = false; - while (baseDirectory !== node_path_1.default.dirname(baseDirectory)) { - const segment = node_path_1.default.basename(baseDirectory); - if (segment === NODE_MODULE_SEGMENT) { - found = true; - break; - } - nameOrFile = nameOrScope; - nameOrScope = segment; - baseDirectory = node_path_1.default.dirname(baseDirectory); - } - // Skip non-package path edge cases that are not caught in the includes check above - if (!found || !nameOrScope) { - continue; - } - const packageName = nameOrScope.startsWith('@') - ? `${nameOrScope}/${nameOrFile}` - : nameOrScope; - const packageDirectory = node_path_1.default.join(baseDirectory, packageName); - // Load the package's metadata to find the package's name, version, and license type - const packageJsonPath = node_path_1.default.join(packageDirectory, 'package.json'); - let packageJson; - try { - packageJson = JSON.parse(await (0, promises_1.readFile)(packageJsonPath, 'utf-8')); - } - catch { - // Invalid package - continue; - } - // Skip already processed packages - const packageId = `${packageName}@${packageJson.version}`; - if (seenPackages.has(packageId)) { - continue; - } - seenPackages.add(packageId); - // Attempt to find license text inside package - let licenseText = ''; - if (typeof packageJson.license === 'string' && - packageJson.license.toLowerCase().startsWith(CUSTOM_LICENSE_TEXT)) { - // Attempt to load the package's custom license - let customLicensePath; - const customLicenseFile = node_path_1.default.normalize(packageJson.license.slice(CUSTOM_LICENSE_TEXT.length + 1).trim()); - if (customLicenseFile.startsWith('..') || node_path_1.default.isAbsolute(customLicenseFile)) { - // Path is attempting to access files outside of the package - // TODO: Issue warning? - } - else { - customLicensePath = node_path_1.default.join(packageDirectory, customLicenseFile); - try { - licenseText = await (0, promises_1.readFile)(customLicensePath, 'utf-8'); - break; - } - catch { } - } - } - else { - // Search for a license file within the root of the package - for (const potentialLicense of LICENSE_FILES) { - const packageLicensePath = node_path_1.default.join(packageDirectory, potentialLicense); - try { - licenseText = await (0, promises_1.readFile)(packageLicensePath, 'utf-8'); - break; - } - catch { } - } - } - // Generate the package's license entry in the output content - extractedLicenseContent += `Package: ${packageJson.name}\n`; - extractedLicenseContent += `License: ${JSON.stringify(packageJson.license, null, 2)}\n`; - extractedLicenseContent += `\n${licenseText}\n`; - extractedLicenseContent += EXTRACTION_FILE_SEPARATOR; - } - } - return extractedLicenseContent; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/lmdb-cache-store.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/lmdb-cache-store.d.ts deleted file mode 100755 index 66dba9a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/lmdb-cache-store.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { Cache, CacheStore } from './cache'; -export declare class LmbdCacheStore implements CacheStore { - #private; - readonly cachePath: string; - constructor(cachePath: string); - get(key: string): Promise; - has(key: string): boolean; - set(key: string, value: unknown): Promise; - createCache(namespace: string): Cache; - close(): Promise; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/lmdb-cache-store.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/lmdb-cache-store.js deleted file mode 100755 index e36de3e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/lmdb-cache-store.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LmbdCacheStore = void 0; -const lmdb_1 = require("lmdb"); -const cache_1 = require("./cache"); -class LmbdCacheStore { - cachePath; - #cacheFileUrl; - #db; - constructor(cachePath) { - this.cachePath = cachePath; - this.#cacheFileUrl = cachePath; - } - #ensureCacheFile() { - this.#db ??= (0, lmdb_1.open)({ - path: this.#cacheFileUrl, - compression: true, - }); - return this.#db; - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - async get(key) { - const db = this.#ensureCacheFile(); - const value = db.get(key); - return value; - } - has(key) { - return this.#ensureCacheFile().doesExist(key); - } - async set(key, value) { - const db = this.#ensureCacheFile(); - await db.put(key, value); - return this; - } - createCache(namespace) { - return new cache_1.Cache(this, namespace); - } - async close() { - try { - await this.#db?.close(); - } - catch { - // Failure to close should not be fatal - } - } -} -exports.LmbdCacheStore = LmbdCacheStore; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/load-result-cache.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/load-result-cache.d.ts deleted file mode 100755 index 97d2827..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/load-result-cache.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { OnLoadResult, PluginBuild } from 'esbuild'; -export interface LoadResultCache { - get(path: string): OnLoadResult | undefined; - put(path: string, result: OnLoadResult): Promise; - readonly watchFiles: ReadonlyArray; -} -export declare function createCachedLoad(cache: LoadResultCache | undefined, callback: Parameters[1]): Parameters[1]; -export declare class MemoryLoadResultCache implements LoadResultCache { - #private; - get(path: string): OnLoadResult | undefined; - put(path: string, result: OnLoadResult): Promise; - invalidate(path: string): boolean; - get watchFiles(): string[]; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/load-result-cache.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/load-result-cache.js deleted file mode 100755 index 26d9437..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/load-result-cache.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MemoryLoadResultCache = void 0; -exports.createCachedLoad = createCachedLoad; -const node_path_1 = require("node:path"); -function createCachedLoad(cache, callback) { - if (cache === undefined) { - return callback; - } - return async (args) => { - const loadCacheKey = `${args.namespace}:${args.path}`; - let result = cache.get(loadCacheKey); - if (result === undefined) { - result = await callback(args); - // Do not cache null or undefined - if (result) { - // Ensure requested path is included if it was a resolved file - if (args.namespace === 'file') { - result.watchFiles ??= []; - result.watchFiles.push(args.path); - } - await cache.put(loadCacheKey, result); - } - } - return result; - }; -} -class MemoryLoadResultCache { - #loadResults = new Map(); - #fileDependencies = new Map(); - get(path) { - return this.#loadResults.get(path); - } - async put(path, result) { - this.#loadResults.set(path, result); - if (result.watchFiles) { - for (const watchFile of result.watchFiles) { - // Normalize the watch file path to ensure OS consistent paths - const normalizedWatchFile = (0, node_path_1.normalize)(watchFile); - let affected = this.#fileDependencies.get(normalizedWatchFile); - if (affected === undefined) { - affected = new Set(); - this.#fileDependencies.set(normalizedWatchFile, affected); - } - affected.add(path); - } - } - } - invalidate(path) { - const affectedPaths = this.#fileDependencies.get(path); - let found = false; - if (affectedPaths) { - for (const affected of affectedPaths) { - if (this.#loadResults.delete(affected)) { - found = true; - } - } - this.#fileDependencies.delete(path); - } - return found; - } - get watchFiles() { - // this.#loadResults.keys() is not included here because the keys - // are namespaced request paths and not disk-based file paths. - return [...this.#fileDependencies.keys()]; - } -} -exports.MemoryLoadResultCache = MemoryLoadResultCache; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/loader-import-attribute-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/loader-import-attribute-plugin.d.ts deleted file mode 100755 index ed86af0..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/loader-import-attribute-plugin.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -export declare function createLoaderImportAttributePlugin(): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/loader-import-attribute-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/loader-import-attribute-plugin.js deleted file mode 100755 index f73fdae..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/loader-import-attribute-plugin.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createLoaderImportAttributePlugin = createLoaderImportAttributePlugin; -const promises_1 = require("node:fs/promises"); -const SUPPORTED_LOADERS = ['base64', 'binary', 'dataurl', 'file', 'text']; -function createLoaderImportAttributePlugin() { - return { - name: 'angular-loader-import-attributes', - setup(build) { - build.onLoad({ filter: /./ }, async (args) => { - const loader = args.with['loader']; - if (!loader) { - return undefined; - } - if (!SUPPORTED_LOADERS.includes(loader)) { - return { - errors: [ - { - text: 'Unsupported loader import attribute', - notes: [ - { text: 'Attribute value must be one of: ' + SUPPORTED_LOADERS.join(', ') }, - ], - }, - ], - }; - } - return { - contents: await (0, promises_1.readFile)(args.path), - loader, - }; - }); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/profiling.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/profiling.d.ts deleted file mode 100755 index de0b15e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/profiling.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare function resetCumulativeDurations(): void; -export declare function logCumulativeDurations(): void; -export declare function profileAsync(name: string, action: () => Promise, cumulative?: boolean): Promise; -export declare function profileSync(name: string, action: () => T, cumulative?: boolean): T; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/profiling.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/profiling.js deleted file mode 100755 index 4eba37f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/profiling.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.resetCumulativeDurations = resetCumulativeDurations; -exports.logCumulativeDurations = logCumulativeDurations; -exports.profileAsync = profileAsync; -exports.profileSync = profileSync; -const environment_options_1 = require("../../utils/environment-options"); -let cumulativeDurations; -function resetCumulativeDurations() { - cumulativeDurations?.clear(); -} -function logCumulativeDurations() { - if (!environment_options_1.debugPerformance || !cumulativeDurations) { - return; - } - for (const [name, durations] of cumulativeDurations) { - let total = 0; - let min; - let max; - for (const duration of durations) { - total += duration; - if (min === undefined || duration < min) { - min = duration; - } - if (max === undefined || duration > max) { - max = duration; - } - } - const average = total / durations.length; - // eslint-disable-next-line no-console - console.log(`DURATION[${name}]: ${total.toFixed(9)}s [count: ${durations.length}; avg: ${average.toFixed(9)}s; min: ${min?.toFixed(9)}s; max: ${max?.toFixed(9)}s]`); - } -} -function recordDuration(name, startTime, cumulative) { - const duration = Number(process.hrtime.bigint() - startTime) / 10 ** 9; - if (cumulative) { - cumulativeDurations ??= new Map(); - const durations = cumulativeDurations.get(name) ?? []; - durations.push(duration); - cumulativeDurations.set(name, durations); - } - else { - // eslint-disable-next-line no-console - console.log(`DURATION[${name}]: ${duration.toFixed(9)}s`); - } -} -async function profileAsync(name, action, cumulative) { - if (!environment_options_1.debugPerformance) { - return action(); - } - const startTime = process.hrtime.bigint(); - try { - return await action(); - } - finally { - recordDuration(name, startTime, cumulative); - } -} -function profileSync(name, action, cumulative) { - if (!environment_options_1.debugPerformance) { - return action(); - } - const startTime = process.hrtime.bigint(); - try { - return action(); - } - finally { - recordDuration(name, startTime, cumulative); - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts deleted file mode 100755 index d0737f2..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -/** - * Creates a plugin that forces ESM resolution of rxjs. - * This is needed as when targeting node, the CJS version is used to the current package conditional exports. - * @see: https://github.com/ReactiveX/rxjs/blob/2947583bb33e97f3db9e6d9f6cea70c62a173060/package.json#L19. - * - * NOTE: This can be removed when and if rxjs adds an import condition that allows ESM usage on Node.js. - * - * @returns An esbuild plugin. - */ -export declare function createRxjsEsmResolutionPlugin(): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/rxjs-esm-resolution-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/rxjs-esm-resolution-plugin.js deleted file mode 100755 index d887137..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/rxjs-esm-resolution-plugin.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createRxjsEsmResolutionPlugin = createRxjsEsmResolutionPlugin; -const RXJS_ESM_RESOLUTION = Symbol('RXJS_ESM_RESOLUTION'); -/** - * Creates a plugin that forces ESM resolution of rxjs. - * This is needed as when targeting node, the CJS version is used to the current package conditional exports. - * @see: https://github.com/ReactiveX/rxjs/blob/2947583bb33e97f3db9e6d9f6cea70c62a173060/package.json#L19. - * - * NOTE: This can be removed when and if rxjs adds an import condition that allows ESM usage on Node.js. - * - * @returns An esbuild plugin. - */ -function createRxjsEsmResolutionPlugin() { - return { - name: 'angular-rxjs-resolution', - setup(build) { - build.onResolve({ filter: /^rxjs/ }, async (args) => { - if (args.pluginData?.[RXJS_ESM_RESOLUTION]) { - return null; - } - const { importer, kind, resolveDir, namespace, pluginData = {} } = args; - pluginData[RXJS_ESM_RESOLUTION] = true; - const result = await build.resolve(args.path, { - importer, - kind, - namespace, - pluginData, - resolveDir, - }); - result.path = result.path.replace(/([\\/]dist[\\/])cjs([\\/])/, '$1esm$2'); - return result; - }); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/server-bundle-metadata-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/server-bundle-metadata-plugin.d.ts deleted file mode 100755 index 3663caa..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/server-bundle-metadata-plugin.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -/** - * Generates an esbuild plugin that appends metadata to the output bundle, - * marking it with server-side rendering (SSR) details for Angular SSR scenarios. - * - * @param options Optional configuration object. - * - `ssrEntryBundle`: If `true`, marks the bundle as an SSR entry point. - * - * @remarks We can't rely on `platform: node` or `platform: neutral`, as the latter - * is used for non-SSR-related code too (e.g., global scripts). - * @returns An esbuild plugin that injects SSR metadata into the build result's metafile. - */ -export declare function createServerBundleMetadata(options?: { - ssrEntryBundle?: boolean; -}): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/server-bundle-metadata-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/server-bundle-metadata-plugin.js deleted file mode 100755 index e122b54..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/server-bundle-metadata-plugin.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createServerBundleMetadata = createServerBundleMetadata; -/** - * Generates an esbuild plugin that appends metadata to the output bundle, - * marking it with server-side rendering (SSR) details for Angular SSR scenarios. - * - * @param options Optional configuration object. - * - `ssrEntryBundle`: If `true`, marks the bundle as an SSR entry point. - * - * @remarks We can't rely on `platform: node` or `platform: neutral`, as the latter - * is used for non-SSR-related code too (e.g., global scripts). - * @returns An esbuild plugin that injects SSR metadata into the build result's metafile. - */ -function createServerBundleMetadata(options) { - return { - name: 'angular-server-bundle-metadata', - setup(build) { - build.onEnd((result) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const metafile = result.metafile; - if (metafile) { - metafile['ng-ssr-entry-bundle'] = !!options?.ssrEntryBundle; - metafile['ng-platform-server'] = true; - } - }); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts deleted file mode 100755 index c635f8e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -/** - * Creates an esbuild plugin that updates generated sourcemaps to include the Chrome - * DevTools ignore list extension. All source files that originate from a node modules - * directory are added to the ignore list by this plugin. - * - * For more information, see https://developer.chrome.com/articles/x-google-ignore-list/ - * @returns An esbuild plugin. - */ -export declare function createSourcemapIgnorelistPlugin(): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/sourcemap-ignorelist-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/sourcemap-ignorelist-plugin.js deleted file mode 100755 index 1910c95..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/sourcemap-ignorelist-plugin.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createSourcemapIgnorelistPlugin = createSourcemapIgnorelistPlugin; -/** - * The field identifier for the sourcemap Chrome Devtools ignore list extension. - * - * Following the naming conventions from https://sourcemaps.info/spec.html#h.ghqpj1ytqjbm - */ -const IGNORE_LIST_ID = 'x_google_ignoreList'; -/** - * The UTF-8 bytes for the node modules check text used to avoid unnecessary parsing - * of a full source map if not present in the source map data. - */ -const NODE_MODULE_BYTES = Buffer.from('node_modules/', 'utf-8'); -/** - * Creates an esbuild plugin that updates generated sourcemaps to include the Chrome - * DevTools ignore list extension. All source files that originate from a node modules - * directory are added to the ignore list by this plugin. - * - * For more information, see https://developer.chrome.com/articles/x-google-ignore-list/ - * @returns An esbuild plugin. - */ -function createSourcemapIgnorelistPlugin() { - return { - name: 'angular-sourcemap-ignorelist', - setup(build) { - if (!build.initialOptions.sourcemap) { - return; - } - build.onEnd((result) => { - if (!result.outputFiles) { - return; - } - for (const file of result.outputFiles) { - // Only process sourcemap files - if (!file.path.endsWith('.map')) { - continue; - } - // Create a Buffer object that shares the memory of the output file contents - const contents = Buffer.from(file.contents.buffer, file.contents.byteOffset, file.contents.byteLength); - // Avoid parsing sourcemaps that have no node modules references - if (!contents.includes(NODE_MODULE_BYTES)) { - continue; - } - const map = JSON.parse(contents.toString('utf-8')); - const ignoreList = []; - // Check and store the index of each source originating from a node modules directory - for (let index = 0; index < map.sources.length; ++index) { - const location = map.sources[index].indexOf('node_modules/'); - if (location === 0 || (location > 0 && map.sources[index][location - 1] === '/')) { - ignoreList.push(index); - } - } - // Avoid regenerating the source map if nothing changed - if (ignoreList.length === 0) { - continue; - } - // Update the sourcemap in the output file - map[IGNORE_LIST_ID] = ignoreList; - file.contents = Buffer.from(JSON.stringify(map), 'utf-8'); - } - }); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/bundle-options.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/bundle-options.d.ts deleted file mode 100755 index 0630bba..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/bundle-options.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { BuildOptions } from 'esbuild'; -import { NormalizedCachedOptions } from '../../../utils/normalize-cache'; -import { PostcssConfiguration } from '../../../utils/postcss-configuration'; -import { LoadResultCache } from '../load-result-cache'; -import { StylesheetPluginsass } from './stylesheet-plugin-factory'; -export interface BundleStylesheetOptions { - workspaceRoot: string; - optimization: boolean; - inlineFonts: boolean; - preserveSymlinks?: boolean; - sourcemap: boolean | 'external' | 'inline' | 'linked'; - sourcesContent?: boolean; - outputNames: { - bundles: string; - media: string; - }; - includePaths?: string[]; - sass?: StylesheetPluginsass; - externalDependencies?: string[]; - target: string[]; - tailwindConfiguration?: { - file: string; - package: string; - }; - postcssConfiguration?: PostcssConfiguration; - publicPath?: string; - cacheOptions: NormalizedCachedOptions; -} -export declare function createStylesheetBundleOptions(options: BundleStylesheetOptions, cache?: LoadResultCache, inlineComponentData?: Record): BuildOptions & { - plugins: NonNullable; -}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/bundle-options.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/bundle-options.js deleted file mode 100755 index e1b9058..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/bundle-options.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createStylesheetBundleOptions = createStylesheetBundleOptions; -const node_path_1 = __importDefault(require("node:path")); -const css_inline_fonts_plugin_1 = require("./css-inline-fonts-plugin"); -const css_language_1 = require("./css-language"); -const css_resource_plugin_1 = require("./css-resource-plugin"); -const less_language_1 = require("./less-language"); -const sass_language_1 = require("./sass-language"); -const stylesheet_plugin_factory_1 = require("./stylesheet-plugin-factory"); -function createStylesheetBundleOptions(options, cache, inlineComponentData) { - // Ensure preprocessor include paths are absolute based on the workspace root - const includePaths = options.includePaths?.map((includePath) => node_path_1.default.resolve(options.workspaceRoot, includePath)); - const pluginFactory = new stylesheet_plugin_factory_1.StylesheetPluginFactory({ - sourcemap: !!options.sourcemap, - includePaths, - inlineComponentData, - tailwindConfiguration: options.tailwindConfiguration, - postcssConfiguration: options.postcssConfiguration, - sass: options.sass, - }, cache); - const plugins = [ - pluginFactory.create(sass_language_1.SassStylesheetLanguage), - pluginFactory.create(less_language_1.LessStylesheetLanguage), - pluginFactory.create(css_language_1.CssStylesheetLanguage), - (0, css_resource_plugin_1.createCssResourcePlugin)(cache), - ]; - if (options.inlineFonts) { - plugins.unshift((0, css_inline_fonts_plugin_1.createCssInlineFontsPlugin)({ cache, cacheOptions: options.cacheOptions })); - } - return { - absWorkingDir: options.workspaceRoot, - bundle: true, - entryNames: options.outputNames.bundles, - assetNames: options.outputNames.media, - logLevel: 'silent', - minify: options.optimization, - metafile: true, - sourcemap: options.sourcemap, - sourcesContent: options.sourcesContent, - outdir: options.workspaceRoot, - write: false, - platform: 'browser', - target: options.target, - preserveSymlinks: options.preserveSymlinks, - external: options.externalDependencies, - publicPath: options.publicPath, - conditions: ['style', 'sass', 'less', options.optimization ? 'production' : 'development'], - mainFields: ['style', 'sass'], - // Unlike JS, CSS does not have implicit file extensions in the general case. - // Preprocessor specific behavior is handled in each stylesheet language plugin. - resolveExtensions: [], - plugins, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts deleted file mode 100755 index 481b9e8..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -import { NormalizedCachedOptions } from '../../../utils/normalize-cache'; -import { LoadResultCache } from '../load-result-cache'; -/** - * Options for the createCssInlineFontsPlugin - * @see createCssInlineFontsPlugin - */ -export interface CssInlineFontsPluginOptions { - /** Disk cache normalized options */ - cacheOptions?: NormalizedCachedOptions; - /** Load results cache. */ - cache?: LoadResultCache; -} -/** - * Creates an esbuild {@link Plugin} that inlines fonts imported via import-rule. - * within the build configuration. - */ -export declare function createCssInlineFontsPlugin({ cache, cacheOptions, }: CssInlineFontsPluginOptions): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js deleted file mode 100755 index 759b36a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createCssInlineFontsPlugin = createCssInlineFontsPlugin; -const inline_fonts_1 = require("../../../utils/index-file/inline-fonts"); -const load_result_cache_1 = require("../load-result-cache"); -/** - * Creates an esbuild {@link Plugin} that inlines fonts imported via import-rule. - * within the build configuration. - */ -function createCssInlineFontsPlugin({ cache, cacheOptions, }) { - return { - name: 'angular-css-inline-fonts-plugin', - setup(build) { - const inlineFontsProcessor = new inline_fonts_1.InlineFontsProcessor({ cache: cacheOptions, minify: false }); - build.onResolve({ filter: /fonts\.googleapis\.com|use\.typekit\.net/ }, (args) => { - // Only attempt to resolve import-rule tokens which only exist inside CSS. - if (args.kind !== 'import-rule') { - return null; - } - if (!inlineFontsProcessor.canInlineRequest(args.path)) { - return null; - } - return { - path: args.path, - namespace: 'css-inline-fonts', - }; - }); - build.onLoad({ filter: /./, namespace: 'css-inline-fonts' }, (0, load_result_cache_1.createCachedLoad)(cache, async (args) => { - try { - return { - contents: await inlineFontsProcessor.processURL(args.path), - loader: 'css', - }; - } - catch (error) { - return { - loader: 'css', - errors: [ - { - text: `Failed to inline external stylesheet '${args.path}'.`, - notes: error instanceof Error ? [{ text: error.toString() }] : undefined, - }, - ], - }; - } - })); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-language.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-language.d.ts deleted file mode 100755 index 2a7c9c9..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-language.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { StylesheetLanguage } from './stylesheet-plugin-factory'; -export declare const CssStylesheetLanguage: Readonly; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-language.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-language.js deleted file mode 100755 index 65fd051..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-language.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CssStylesheetLanguage = void 0; -exports.CssStylesheetLanguage = Object.freeze({ - name: 'css', - componentFilter: /^css;/, - fileFilter: /\.css$/, -}); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts deleted file mode 100755 index e239e8c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -import { LoadResultCache } from '../load-result-cache'; -/** - * Creates an esbuild {@link Plugin} that loads all CSS url token references using the - * built-in esbuild `file` loader. A plugin is used to allow for all file extensions - * and types to be supported without needing to manually specify all extensions - * within the build configuration. - * - * @returns An esbuild {@link Plugin} instance. - */ -export declare function createCssResourcePlugin(cache?: LoadResultCache): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-resource-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-resource-plugin.js deleted file mode 100755 index ca6e6a0..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/css-resource-plugin.js +++ /dev/null @@ -1,113 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createCssResourcePlugin = createCssResourcePlugin; -const promises_1 = require("node:fs/promises"); -const node_path_1 = require("node:path"); -const load_result_cache_1 = require("../load-result-cache"); -const CSS_RESOURCE_NAMESPACE = 'angular:css-resource'; -/** - * Symbol marker used to indicate CSS resource resolution is being attempted. - * This is used to prevent an infinite loop within the plugin's resolve hook. - */ -const CSS_RESOURCE_RESOLUTION = Symbol('CSS_RESOURCE_RESOLUTION'); -/** - * Creates an esbuild {@link Plugin} that loads all CSS url token references using the - * built-in esbuild `file` loader. A plugin is used to allow for all file extensions - * and types to be supported without needing to manually specify all extensions - * within the build configuration. - * - * @returns An esbuild {@link Plugin} instance. - */ -function createCssResourcePlugin(cache) { - return { - name: 'angular-css-resource', - setup(build) { - build.onResolve({ filter: /.*/ }, async (args) => { - const { importer, path, kind, resolveDir, namespace, pluginData = {} } = args; - // Only attempt to resolve url tokens which only exist inside CSS. - // Also, skip this plugin if already attempting to resolve the url-token. - if (kind !== 'url-token' || pluginData[CSS_RESOURCE_RESOLUTION]) { - return null; - } - let [containingDir, resourceUrl] = path.split('||file:', 2); - if (resourceUrl === undefined) { - // This can happen due to early exit checks in rebasing-importer - // logic such as when the url is an external URL. - resourceUrl = containingDir; - containingDir = ''; - } - // If root-relative, absolute or protocol relative url, mark as external to leave the - // path/URL in place. - if (/^((?:\w+:)?\/\/|data:|chrome:|#|\/)/.test(resourceUrl)) { - return { - path: resourceUrl, - external: true, - }; - } - pluginData[CSS_RESOURCE_RESOLUTION] = true; - const result = await build.resolve(resourceUrl, { - importer, - kind, - namespace, - pluginData, - resolveDir: (0, node_path_1.join)(resolveDir, containingDir), - }); - if (result.errors.length) { - const error = result.errors[0]; - if (resourceUrl[0] === '~') { - error.notes = [ - { - location: null, - text: 'You can remove the tilde and use a relative path to reference it, which should remove this error.', - }, - ]; - } - else if (resourceUrl[0] === '^') { - error.notes = [ - { - location: null, - text: 'You can remove the caret and add the path to the `externalDependencies` build option,' + - ' which should remove this error.', - }, - ]; - } - const extension = importer && (0, node_path_1.extname)(importer); - if (extension !== '.css') { - error.notes.push({ - location: null, - text: 'Preprocessor stylesheets may not show the exact file location of the error.', - }); - } - } - // Return results that are not files since these are most likely specific to another plugin - // and cannot be loaded by this plugin. - if (result.namespace !== 'file') { - return result; - } - // All file results are considered CSS resources and will be loaded via the file loader - return { - ...result, - // Use a relative path to prevent fully resolved paths in the metafile (JSON stats file). - // This is only necessary for custom namespaces. esbuild will handle the file namespace. - path: (0, node_path_1.relative)(build.initialOptions.absWorkingDir ?? '', result.path), - namespace: CSS_RESOURCE_NAMESPACE, - }; - }); - build.onLoad({ filter: /./, namespace: CSS_RESOURCE_NAMESPACE }, (0, load_result_cache_1.createCachedLoad)(cache, async (args) => { - const resourcePath = (0, node_path_1.join)(build.initialOptions.absWorkingDir ?? '', args.path); - return { - contents: await (0, promises_1.readFile)(resourcePath), - loader: 'file', - watchFiles: [resourcePath], - }; - })); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/less-language.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/less-language.d.ts deleted file mode 100755 index f962194..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/less-language.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { StylesheetLanguage } from './stylesheet-plugin-factory'; -export declare const LessStylesheetLanguage: Readonly; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/less-language.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/less-language.js deleted file mode 100755 index 80f029c..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/less-language.js +++ /dev/null @@ -1,184 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LessStylesheetLanguage = void 0; -const promises_1 = require("node:fs/promises"); -/** - * The lazy-loaded instance of the less stylesheet preprocessor. - * It is only imported and initialized if a less stylesheet is used. - */ -let lessPreprocessor; -function isLessException(error) { - return !!error && typeof error === 'object' && 'column' in error; -} -exports.LessStylesheetLanguage = Object.freeze({ - name: 'less', - componentFilter: /^less;/, - fileFilter: /\.less$/, - process(data, file, _, options, build) { - return compileString(data, file, options, build.resolve.bind(build), - /* unsafeInlineJavaScript */ false); - }, -}); -async function compileString(data, filename, options, resolver, unsafeInlineJavaScript) { - try { - lessPreprocessor ??= (await Promise.resolve().then(() => __importStar(require('less')))).default; - } - catch { - return { - errors: [ - { - text: 'Unable to load the "less" stylesheet preprocessor.', - location: null, - notes: [ - { - text: 'Ensure that the "less" Node.js package is installed within the project. ' + - "If not present, installation via the project's package manager should resolve the error.", - }, - ], - }, - ], - }; - } - const less = lessPreprocessor; - const resolverPlugin = { - install({ FileManager }, pluginManager) { - const resolverFileManager = new (class extends FileManager { - supportsSync() { - return false; - } - supports() { - return true; - } - async loadFile(filename, currentDirectory, options, environment) { - // Attempt direct loading as a relative path to avoid resolution overhead - try { - return await super.loadFile(filename, currentDirectory, options, environment); - } - catch (error) { - // Attempt a full resolution if not found - const fullResult = await resolver(filename, { - kind: 'import-rule', - resolveDir: currentDirectory, - }); - if (fullResult.path) { - return { - filename: fullResult.path, - contents: await (0, promises_1.readFile)(fullResult.path, 'utf-8'), - }; - } - // Otherwise error by throwing the failing direct result - throw error; - } - } - })(); - pluginManager.addFileManager(resolverFileManager); - }, - }; - try { - const { imports, css } = await less.render(data, { - filename, - paths: options.includePaths, - plugins: [resolverPlugin], - rewriteUrls: 'all', - javascriptEnabled: unsafeInlineJavaScript, - sourceMap: options.sourcemap - ? { - sourceMapFileInline: true, - outputSourceFiles: true, - } - : undefined, - }); - return { - contents: css, - loader: 'css', - watchFiles: [filename, ...imports], - }; - } - catch (error) { - if (isLessException(error)) { - const location = convertExceptionLocation(error); - // Retry with a warning for less files requiring the deprecated inline JavaScript option - if (error.message.includes('Inline JavaScript is not enabled.')) { - const withJsResult = await compileString(data, filename, options, resolver, - /* unsafeInlineJavaScript */ true); - withJsResult.warnings = [ - { - text: 'Deprecated inline execution of JavaScript has been enabled ("javascriptEnabled")', - location, - notes: [ - { - location: null, - text: 'JavaScript found within less stylesheets may be executed at build time. [https://lesscss.org/usage/#less-options]', - }, - { - location: null, - text: 'Support for "javascriptEnabled" may be removed from the Angular CLI starting with Angular v19.', - }, - ], - }, - ]; - return withJsResult; - } - return { - errors: [ - { - text: error.message, - location, - }, - ], - loader: 'css', - watchFiles: location.file ? [filename, location.file] : [filename], - }; - } - throw error; - } -} -function convertExceptionLocation(exception) { - return { - file: exception.filename, - line: exception.line, - column: exception.column, - // Middle element represents the line containing the exception - lineText: exception.extract && exception.extract[Math.trunc(exception.extract.length / 2)], - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/sass-language.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/sass-language.d.ts deleted file mode 100755 index 24aad8e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/sass-language.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { StylesheetLanguage } from './stylesheet-plugin-factory'; -export declare function shutdownSassWorkerPool(): void; -export declare const SassStylesheetLanguage: Readonly; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/sass-language.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/sass-language.js deleted file mode 100755 index b6e8b3e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/sass-language.js +++ /dev/null @@ -1,230 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SassStylesheetLanguage = void 0; -exports.shutdownSassWorkerPool = shutdownSassWorkerPool; -const node_path_1 = require("node:path"); -const node_url_1 = require("node:url"); -const cache_1 = require("../cache"); -let sassWorkerPool; -let sassWorkerPoolPromise; -function isSassException(error) { - return !!error && typeof error === 'object' && 'sassMessage' in error; -} -function shutdownSassWorkerPool() { - if (sassWorkerPool) { - void sassWorkerPool.close(); - sassWorkerPool = undefined; - } - else if (sassWorkerPoolPromise) { - void sassWorkerPoolPromise.then(shutdownSassWorkerPool); - } - sassWorkerPoolPromise = undefined; -} -exports.SassStylesheetLanguage = Object.freeze({ - name: 'sass', - componentFilter: /^s[ac]ss;/, - fileFilter: /\.s[ac]ss$/, - process(data, file, format, options, build) { - const syntax = format === 'sass' ? 'indented' : 'scss'; - const resolveUrl = async (url, options) => { - let resolveDir = build.initialOptions.absWorkingDir; - if (options.containingUrl) { - resolveDir = (0, node_path_1.dirname)((0, node_url_1.fileURLToPath)(options.containingUrl)); - } - const path = url.startsWith('pkg:') ? url.slice(4) : url; - const result = await build.resolve(path, { - kind: 'import-rule', - resolveDir, - }); - return result; - }; - return compileString(data, file, syntax, options, resolveUrl); - }, -}); -function parsePackageName(url) { - const parts = (url.startsWith('pkg:') ? url.slice(4) : url).split('/'); - const hasScope = parts.length >= 2 && parts[0][0] === '@'; - const [nameOrScope, nameOrFirstPath, ...pathPart] = parts; - const packageName = hasScope ? `${nameOrScope}/${nameOrFirstPath}` : nameOrScope; - return { - packageName, - get pathSegments() { - return !hasScope && nameOrFirstPath ? [nameOrFirstPath, ...pathPart] : pathPart; - }, - }; -} -async function compileString(data, filePath, syntax, options, resolveUrl) { - // Lazily load Sass when a Sass file is found - if (sassWorkerPool === undefined) { - if (sassWorkerPoolPromise === undefined) { - sassWorkerPoolPromise = Promise.resolve().then(() => __importStar(require('../../sass/sass-service'))).then((sassService) => new sassService.SassWorkerImplementation(true)); - } - sassWorkerPool = await sassWorkerPoolPromise; - } - // Cache is currently local to individual compile requests. - // Caching follows Sass behavior where a given url will always resolve to the same value - // regardless of its importer's path. - // A null value indicates that the cached resolution attempt failed to find a location and - // later stage resolution should be attempted. This avoids potentially expensive repeat - // failing resolution attempts. - const resolutionCache = new cache_1.MemoryCache(); - const packageRootCache = new cache_1.MemoryCache(); - const warnings = []; - const { silenceDeprecations, futureDeprecations, fatalDeprecations } = options.sass ?? {}; - try { - const { css, sourceMap, loadedUrls } = await sassWorkerPool.compileStringAsync(data, { - url: (0, node_url_1.pathToFileURL)(filePath), - style: 'expanded', - syntax, - loadPaths: options.includePaths, - sourceMap: options.sourcemap, - sourceMapIncludeSources: options.sourcemap, - silenceDeprecations, - fatalDeprecations, - futureDeprecations, - quietDeps: true, - importers: [ - { - findFileUrl: (url, options) => resolutionCache.getOrCreate(url, async () => { - const result = await resolveUrl(url, options); - if (result.path) { - return (0, node_url_1.pathToFileURL)(result.path); - } - // Check for package deep imports - const { packageName, pathSegments } = parsePackageName(url); - // Caching package root locations is particularly beneficial for `@material/*` packages - // which extensively use deep imports. - const packageRoot = await packageRootCache.getOrCreate(packageName, async () => { - // Use the required presence of a package root `package.json` file to resolve the location - const packageResult = await resolveUrl(packageName + '/package.json', options); - return packageResult.path ? (0, node_path_1.dirname)(packageResult.path) : null; - }); - // Package not found could be because of an error or the specifier is intended to be found - // via a later stage of the resolution process (`loadPaths`, etc.). - // Errors are reported after the full completion of the resolution process. Exceptions for - // not found packages should not be raised here. - if (packageRoot) { - return (0, node_url_1.pathToFileURL)((0, node_path_1.join)(packageRoot, ...pathSegments)); - } - // Not found - return null; - }), - }, - ], - logger: { - warn: (text, { deprecation, stack, span }) => { - const notes = []; - if (deprecation) { - notes.push({ text }); - } - if (stack && !span) { - notes.push({ text: stack }); - } - warnings.push({ - text: deprecation ? 'Deprecation' : text, - location: span && { - file: span.url && (0, node_url_1.fileURLToPath)(span.url), - lineText: span.context, - // Sass line numbers are 0-based while esbuild's are 1-based - line: span.start.line + 1, - column: span.start.column, - }, - notes, - }); - }, - }, - }); - return { - loader: 'css', - contents: sourceMap ? `${css}\n${sourceMapToUrlComment(sourceMap)}` : css, - watchFiles: loadedUrls.map((url) => (0, node_url_1.fileURLToPath)(url)), - warnings, - }; - } - catch (error) { - if (isSassException(error)) { - const fileWithError = error.span.url ? (0, node_url_1.fileURLToPath)(error.span.url) : undefined; - const watchFiles = [filePath, ...extractFilesFromStack(error.sassStack)]; - if (fileWithError) { - watchFiles.push(fileWithError); - } - return { - loader: 'css', - errors: [ - { - text: error.message, - }, - ], - warnings, - watchFiles, - }; - } - throw error; - } -} -function sourceMapToUrlComment(sourceMap) { - const urlSourceMap = Buffer.from(JSON.stringify(sourceMap), 'utf-8').toString('base64'); - return `/*# sourceMappingURL=data:application/json;charset=utf-8;base64,${urlSourceMap} */`; -} -function* extractFilesFromStack(stack) { - const lines = stack.split('\n'); - const cwd = process.cwd(); - // Stack line has format of " " - for (const line of lines) { - const segments = line.split(' '); - if (segments.length < 3) { - break; - } - // Extract path from stack line. - // Paths may contain spaces. All segments before location are part of the file path. - let path = ''; - let index = 0; - while (!segments[index].match(/\d+:\d+/)) { - path += segments[index++]; - } - if (path) { - // Stack paths from dart-sass are relative to the current working directory (not input file or workspace root) - yield (0, node_path_1.join)(cwd, path); - } - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts deleted file mode 100755 index a0faac6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { OnLoadResult, Plugin, PluginBuild } from 'esbuild'; -import type { Options } from 'sass'; -import type { PostcssConfiguration } from '../../../utils/postcss-configuration'; -import { LoadResultCache } from '../load-result-cache'; -/** - * Configuration options for handling Sass-specific deprecations in a stylesheet plugin. - */ -export type StylesheetPluginsass = Pick, 'futureDeprecations' | 'fatalDeprecations' | 'silenceDeprecations'>; -/** - * An object containing the plugin options to use when processing stylesheets. - */ -export interface StylesheetPluginOptions { - /** - * Controls the use and creation of sourcemaps when processing the stylesheets. - * If true, sourcemap processing is enabled; if false, disabled. - */ - sourcemap: boolean; - /** - * An optional array of paths that will be searched for stylesheets if the default - * resolution process for the stylesheet language does not succeed. - */ - includePaths?: string[]; - /** - * Optional component data for any inline styles from Component decorator `styles` fields. - * The key is an internal angular resource URI and the value is the stylesheet content. - */ - inlineComponentData?: Record; - /** - * Optional information used to load and configure Tailwind CSS. If present, the postcss - * will be added to the stylesheet processing with the Tailwind plugin setup as provided - * by the configuration file. - */ - tailwindConfiguration?: { - file: string; - package: string; - }; - /** - * Optional configuration object for custom postcss usage. If present, postcss will be - * initialized and used for every stylesheet. This overrides the tailwind integration - * and any tailwind usage must be manually configured in the custom postcss usage. - */ - postcssConfiguration?: PostcssConfiguration; - /** - * Optional Options for configuring Sass behavior. - */ - sass?: StylesheetPluginsass; -} -export interface StylesheetLanguage { - name: string; - componentFilter: RegExp; - fileFilter: RegExp; - process?(data: string, file: string, format: string, options: StylesheetPluginOptions, build: PluginBuild): OnLoadResult | Promise; -} -export declare class StylesheetPluginFactory { - private readonly options; - private readonly cache?; - constructor(options: StylesheetPluginOptions, cache?: LoadResultCache | undefined); - create(language: Readonly): Plugin; - private setupPostcssPromise; - private get setupPostcss(); - private initPostcssCallCount; - /** - * This method should not be called directly. - * Use {@link setupPostcss} instead. - */ - private initPostcss; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js deleted file mode 100755 index 1f50b6a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js +++ /dev/null @@ -1,328 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StylesheetPluginFactory = void 0; -const node_assert_1 = __importDefault(require("node:assert")); -const promises_1 = require("node:fs/promises"); -const node_path_1 = require("node:path"); -const tinyglobby_1 = require("tinyglobby"); -const error_1 = require("../../../utils/error"); -const load_result_cache_1 = require("../load-result-cache"); -/** - * The lazy-loaded instance of the postcss stylesheet postprocessor. - * It is only imported and initialized if postcss is needed. - */ -let postcss; -/** - * An array of keywords that indicate Tailwind CSS processing is required for a stylesheet. - * - * Based on https://tailwindcss.com/docs/functions-and-directives - */ -const TAILWIND_KEYWORDS = [ - '@tailwind', - '@layer', - '@apply', - '@config', - 'theme(', - 'screen(', - '@screen', // Undocumented in version 3, see: https://github.com/tailwindlabs/tailwindcss/discussions/7516. -]; -/** - * Cached postcss instances that can be re-used between various StylesheetPluginFactory instances. - */ -const postcssProcessors = new Map(); -class StylesheetPluginFactory { - options; - cache; - constructor(options, cache) { - this.options = options; - this.cache = cache; - } - create(language) { - const { cache, options, setupPostcss } = this; - // Return a noop plugin if no load actions are required - if (!language.process && !options.postcssConfiguration && !options.tailwindConfiguration) { - return { - name: 'angular-' + language.name, - setup() { }, - }; - } - return { - name: 'angular-' + language.name, - async setup(build) { - // Setup postcss if needed - let postcssProcessor; - build.onStart(async () => { - try { - postcssProcessor = await setupPostcss; - } - catch { - return { - errors: [ - { - text: 'Unable to load the "postcss" stylesheet processor.', - location: null, - notes: [ - { - text: 'Ensure that the "postcss" Node.js package is installed within the project. ' + - "If not present, installation via the project's package manager should resolve the error.", - }, - ], - }, - ], - }; - } - }); - // Add a load callback to support inline Component styles - build.onLoad({ filter: language.componentFilter, namespace: 'angular:styles/component' }, (0, load_result_cache_1.createCachedLoad)(cache, (args) => { - const data = options.inlineComponentData?.[args.path]; - (0, node_assert_1.default)(typeof data === 'string', `component style name should always be found [${args.path}]`); - const [format, , filename] = args.path.split(';', 3); - return processStylesheet(language, data, filename, format, options, build, postcssProcessor); - })); - // Add a load callback to support files from disk - build.onLoad({ filter: language.fileFilter, namespace: 'file' }, (0, load_result_cache_1.createCachedLoad)(cache, async (args) => { - const data = await (0, promises_1.readFile)(args.path, 'utf-8'); - return processStylesheet(language, data, args.path, (0, node_path_1.extname)(args.path).toLowerCase().slice(1), options, build, postcssProcessor); - })); - }, - }; - } - setupPostcssPromise; - get setupPostcss() { - return (this.setupPostcssPromise ??= this.initPostcss()); - } - initPostcssCallCount = 0; - /** - * This method should not be called directly. - * Use {@link setupPostcss} instead. - */ - async initPostcss() { - node_assert_1.default.equal(++this.initPostcssCallCount, 1, '`initPostcss` was called more than once.'); - const { options } = this; - if (options.postcssConfiguration) { - const postCssInstanceKey = JSON.stringify(options.postcssConfiguration); - let postcssProcessor = postcssProcessors.get(postCssInstanceKey)?.deref(); - if (!postcssProcessor) { - postcss ??= (await Promise.resolve().then(() => __importStar(require('postcss')))).default; - postcssProcessor = postcss(); - for (const [pluginName, pluginOptions] of options.postcssConfiguration.plugins) { - const { default: plugin } = await Promise.resolve(`${pluginName}`).then(s => __importStar(require(s))); - if (typeof plugin !== 'function' || plugin.postcss !== true) { - throw new Error(`Attempted to load invalid Postcss plugin: "${pluginName}"`); - } - postcssProcessor.use(plugin(pluginOptions)); - } - postcssProcessors.set(postCssInstanceKey, new WeakRef(postcssProcessor)); - } - return postcssProcessor; - } - else if (options.tailwindConfiguration) { - const { package: tailwindPackage, file: config } = options.tailwindConfiguration; - const postCssInstanceKey = tailwindPackage + ':' + config; - let postcssProcessor = postcssProcessors.get(postCssInstanceKey)?.deref(); - if (!postcssProcessor) { - postcss ??= (await Promise.resolve().then(() => __importStar(require('postcss')))).default; - const tailwind = await Promise.resolve(`${tailwindPackage}`).then(s => __importStar(require(s))); - postcssProcessor = postcss().use(tailwind.default({ config })); - postcssProcessors.set(postCssInstanceKey, new WeakRef(postcssProcessor)); - } - return postcssProcessor; - } - } -} -exports.StylesheetPluginFactory = StylesheetPluginFactory; -async function processStylesheet(language, data, filename, format, options, build, postcssProcessor) { - let result; - // Process the input data if the language requires preprocessing - if (language.process) { - result = await language.process(data, filename, format, options, build); - } - else { - result = { - contents: data, - loader: 'css', - watchFiles: [filename], - }; - } - // Return early if there are no contents to further process or there are errors - if (!result.contents || result.errors?.length) { - return result; - } - // Only use postcss if Tailwind processing is required or custom postcss is present. - if (postcssProcessor && (options.postcssConfiguration || hasTailwindKeywords(result.contents))) { - const postcssResult = await compileString(typeof result.contents === 'string' - ? result.contents - : Buffer.from(result.contents).toString('utf-8'), filename, postcssProcessor, options); - // Merge results - if (postcssResult.errors?.length) { - delete result.contents; - } - if (result.warnings && postcssResult.warnings) { - postcssResult.warnings.unshift(...result.warnings); - } - if (result.watchFiles && postcssResult.watchFiles) { - postcssResult.watchFiles.unshift(...result.watchFiles); - } - if (result.watchDirs && postcssResult.watchDirs) { - postcssResult.watchDirs.unshift(...result.watchDirs); - } - result = { - ...result, - ...postcssResult, - }; - } - return result; -} -/** - * Searches the provided contents for keywords that indicate Tailwind is used - * within a stylesheet. - * @param contents A string or Uint8Array containing UTF-8 text. - * @returns True, if the contents contains tailwind keywords; False, otherwise. - */ -function hasTailwindKeywords(contents) { - // TODO: use better search algorithm for keywords - if (typeof contents === 'string') { - return TAILWIND_KEYWORDS.some((keyword) => contents.includes(keyword)); - } - // Contents is a Uint8Array - const data = contents instanceof Buffer ? contents : Buffer.from(contents); - return TAILWIND_KEYWORDS.some((keyword) => data.includes(keyword)); -} -/** - * Compiles the provided CSS stylesheet data using a provided postcss processor and provides an - * esbuild load result that can be used directly by an esbuild Plugin. - * @param data The stylesheet content to process. - * @param filename The name of the file that contains the data. - * @param postcssProcessor A postcss processor instance to use. - * @param options The plugin options to control the processing. - * @returns An esbuild OnLoaderResult object with the processed content, warnings, and/or errors. - */ -async function compileString(data, filename, postcssProcessor, options) { - try { - const postcssResult = await postcssProcessor.process(data, { - from: filename, - to: filename, - map: options.sourcemap && { - inline: true, - sourcesContent: true, - }, - }); - const loadResult = { - contents: postcssResult.css, - loader: 'css', - }; - const rawWarnings = postcssResult.warnings(); - if (rawWarnings.length > 0) { - const lineMappings = new Map(); - loadResult.warnings = rawWarnings.map((warning) => { - const file = warning.node.source?.input.file; - if (file === undefined) { - return { text: warning.text }; - } - let lines = lineMappings.get(file); - if (lines === undefined) { - lines = warning.node.source?.input.css.split(/\r?\n/); - lineMappings.set(file, lines ?? null); - } - return { - text: warning.text, - location: { - file, - line: warning.line, - column: warning.column - 1, - lineText: lines?.[warning.line - 1], - }, - }; - }); - } - for (const resultMessage of postcssResult.messages) { - if (resultMessage.type === 'dependency' && typeof resultMessage['file'] === 'string') { - loadResult.watchFiles ??= []; - loadResult.watchFiles.push(resultMessage['file']); - } - else if (resultMessage.type === 'dir-dependency' && - typeof resultMessage['dir'] === 'string' && - typeof resultMessage['glob'] === 'string') { - loadResult.watchFiles ??= []; - const dependencies = await (0, tinyglobby_1.glob)(resultMessage['glob'], { - absolute: true, - cwd: resultMessage['dir'], - }); - loadResult.watchFiles.push(...dependencies); - } - } - return loadResult; - } - catch (error) { - postcss ??= (await Promise.resolve().then(() => __importStar(require('postcss')))).default; - if (error instanceof postcss.CssSyntaxError) { - const lines = error.source?.split(/\r?\n/); - return { - errors: [ - { - text: error.reason, - location: { - file: error.file, - line: error.line, - column: error.column && error.column - 1, - lineText: error.line === undefined ? undefined : lines?.[error.line - 1], - }, - }, - ], - }; - } - else { - (0, error_1.assertIsError)(error); - return { - errors: [ - { - text: error.message, - }, - ], - }; - } - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/utils.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/utils.d.ts deleted file mode 100755 index a330608..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/utils.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { BuilderContext } from '@angular-devkit/architect'; -import { BuildOptions, Metafile, OutputFile } from 'esbuild'; -import { NormalizedApplicationBuildOptions } from '../../builders/application/options'; -import { BudgetCalculatorResult } from '../../utils/bundle-calculator'; -import { BuildOutputFile, BuildOutputFileType, InitialFileRecord } from './bundler-context'; -import { BuildOutputAsset, ExecutionResult } from './bundler-execution-result'; -export declare function logBuildStats(metafile: Metafile, outputFiles: BuildOutputFile[], initial: Map, budgetFailures: BudgetCalculatorResult[] | undefined, colors: boolean, changedFiles?: Set, estimatedTransferSizes?: Map, ssrOutputEnabled?: boolean, verbose?: boolean): string; -export declare function getChunkNameFromMetafile(metafile: Metafile, file: string): string | undefined; -export declare function calculateEstimatedTransferSizes(outputFiles: OutputFile[]): Promise>; -export declare function withSpinner(text: string, action: () => T | Promise): Promise; -export declare function withNoProgress(text: string, action: () => T | Promise): Promise; -/** - * Generates a syntax feature object map for Angular applications based on a list of targets. - * A full set of feature names can be found here: https://esbuild.github.io/api/#supported - * @param target An array of browser/engine targets in the format accepted by the esbuild `target` option. - * @param nativeAsyncAwait Indicate whether to support native async/await. - * @returns An object that can be used with the esbuild build `supported` option. - */ -export declare function getFeatureSupport(target: string[], nativeAsyncAwait: boolean): BuildOptions['supported']; -export declare function emitFilesToDisk(files: T[], writeFileCallback: (file: T) => Promise): Promise; -export declare function createOutputFile(path: string, data: string | Uint8Array, type: BuildOutputFileType): BuildOutputFile; -export declare function convertOutputFile(file: OutputFile, type: BuildOutputFileType): BuildOutputFile; -/** - * Transform browserlists result to esbuild target. - * @see https://esbuild.github.io/api/#target - */ -export declare function transformSupportedBrowsersToTargets(supportedBrowsers: string[]): string[]; -/** - * Transform supported Node.js versions to esbuild target. - * @see https://esbuild.github.io/api/#target - */ -export declare function getSupportedNodeTargets(): string[]; -export declare function createJsonBuildManifest(result: ExecutionResult, normalizedOptions: NormalizedApplicationBuildOptions): Promise; -export declare function logMessages(logger: BuilderContext['logger'], executionResult: ExecutionResult, color?: boolean, jsonLogs?: boolean): Promise; -/** - * Ascertain whether the application operates without `zone.js`, we currently rely on the polyfills setting to determine its status. - * If a file with an extension is provided or if `zone.js` is included in the polyfills, the application is deemed as not zoneless. - * @param polyfills An array of polyfills - * @returns true, when the application is considered as zoneless. - */ -export declare function isZonelessApp(polyfills: string[] | undefined): boolean; -export declare function getEntryPointName(entryPoint: string): string; -/** - * A set of server-generated dependencies that are treated as external. - * - * These dependencies are marked as external because they are produced by a - * separate bundling process and are not included in the primary bundle. This - * ensures that these generated files are resolved from an external source rather - * than being part of the main bundle. - */ -export declare const SERVER_GENERATED_EXTERNALS: Set; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/utils.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/utils.js deleted file mode 100755 index d2d4761..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/utils.js +++ /dev/null @@ -1,390 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SERVER_GENERATED_EXTERNALS = void 0; -exports.logBuildStats = logBuildStats; -exports.getChunkNameFromMetafile = getChunkNameFromMetafile; -exports.calculateEstimatedTransferSizes = calculateEstimatedTransferSizes; -exports.withSpinner = withSpinner; -exports.withNoProgress = withNoProgress; -exports.getFeatureSupport = getFeatureSupport; -exports.emitFilesToDisk = emitFilesToDisk; -exports.createOutputFile = createOutputFile; -exports.convertOutputFile = convertOutputFile; -exports.transformSupportedBrowsersToTargets = transformSupportedBrowsersToTargets; -exports.getSupportedNodeTargets = getSupportedNodeTargets; -exports.createJsonBuildManifest = createJsonBuildManifest; -exports.logMessages = logMessages; -exports.isZonelessApp = isZonelessApp; -exports.getEntryPointName = getEntryPointName; -const esbuild_1 = require("esbuild"); -const listr2_1 = require("listr2"); -const node_crypto_1 = require("node:crypto"); -const node_path_1 = require("node:path"); -const node_url_1 = require("node:url"); -const node_zlib_1 = require("node:zlib"); -const semver_1 = require("semver"); -const schema_1 = require("../../builders/application/schema"); -const manifest_1 = require("../../utils/server-rendering/manifest"); -const stats_table_1 = require("../../utils/stats-table"); -const bundler_context_1 = require("./bundler-context"); -function logBuildStats(metafile, outputFiles, initial, budgetFailures, colors, changedFiles, estimatedTransferSizes, ssrOutputEnabled, verbose) { - // Remove the i18n subpath in case the build is using i18n. - // en-US/main.js -> main.js - const normalizedChangedFiles = new Set([...(changedFiles ?? [])].map((f) => (0, node_path_1.basename)(f))); - const browserStats = []; - const serverStats = []; - let unchangedCount = 0; - let componentStyleChange = false; - for (const { path: file, size, type } of outputFiles) { - // Only display JavaScript and CSS files - if (!/\.(?:css|m?js)$/.test(file)) { - continue; - } - // Show only changed files if a changed list is provided - if (normalizedChangedFiles.size && !normalizedChangedFiles.has(file)) { - ++unchangedCount; - continue; - } - const isPlatformServer = type === bundler_context_1.BuildOutputFileType.ServerApplication || type === bundler_context_1.BuildOutputFileType.ServerRoot; - if (isPlatformServer && !ssrOutputEnabled) { - // Only log server build stats when SSR is enabled. - continue; - } - // Skip logging external component stylesheets used for HMR - if (metafile.outputs[file] && 'ng-component' in metafile.outputs[file]) { - componentStyleChange = true; - continue; - } - const name = initial.get(file)?.name ?? getChunkNameFromMetafile(metafile, file); - const stat = { - initial: initial.has(file), - stats: [file, name ?? '-', size, estimatedTransferSizes?.get(file) ?? '-'], - }; - if (isPlatformServer) { - serverStats.push(stat); - } - else { - browserStats.push(stat); - } - } - if (browserStats.length > 0 || serverStats.length > 0) { - const tableText = (0, stats_table_1.generateEsbuildBuildStatsTable)([browserStats, serverStats], colors, unchangedCount === 0, !!estimatedTransferSizes, budgetFailures, verbose); - return tableText + '\n'; - } - else if (changedFiles !== undefined) { - if (componentStyleChange) { - return '\nComponent stylesheet(s) changed.\n'; - } - else { - return '\nNo output file changes.\n'; - } - } - if (unchangedCount > 0) { - return `Unchanged output files: ${unchangedCount}`; - } - return ''; -} -function getChunkNameFromMetafile(metafile, file) { - if (metafile.outputs[file]?.entryPoint) { - return getEntryPointName(metafile.outputs[file].entryPoint); - } -} -async function calculateEstimatedTransferSizes(outputFiles) { - const sizes = new Map(); - if (outputFiles.length <= 0) { - return sizes; - } - return new Promise((resolve, reject) => { - let completeCount = 0; - for (const outputFile of outputFiles) { - // Only calculate JavaScript and CSS files - if (!outputFile.path.endsWith('.js') && !outputFile.path.endsWith('.css')) { - ++completeCount; - continue; - } - // Skip compressing small files which may end being larger once compressed and will most likely not be - // compressed in actual transit. - if (outputFile.contents.byteLength < 1024) { - sizes.set(outputFile.path, outputFile.contents.byteLength); - ++completeCount; - continue; - } - // Directly use the async callback function to minimize the number of Promises that need to be created. - (0, node_zlib_1.brotliCompress)(outputFile.contents, (error, result) => { - if (error) { - reject(error); - return; - } - sizes.set(outputFile.path, result.byteLength); - if (++completeCount >= outputFiles.length) { - resolve(sizes); - } - }); - } - // Covers the case where no files need to be compressed - if (completeCount >= outputFiles.length) { - resolve(sizes); - } - }); -} -async function withSpinner(text, action) { - let result; - const taskList = new listr2_1.Listr([ - { - title: text, - async task() { - result = await action(); - }, - }, - ], { rendererOptions: { clearOutput: true } }); - await taskList.run(); - return result; -} -async function withNoProgress(text, action) { - return action(); -} -/** - * Generates a syntax feature object map for Angular applications based on a list of targets. - * A full set of feature names can be found here: https://esbuild.github.io/api/#supported - * @param target An array of browser/engine targets in the format accepted by the esbuild `target` option. - * @param nativeAsyncAwait Indicate whether to support native async/await. - * @returns An object that can be used with the esbuild build `supported` option. - */ -function getFeatureSupport(target, nativeAsyncAwait) { - return { - // Native async/await is not supported with Zone.js. Disabling support here will cause - // esbuild to downlevel async/await, async generators, and for await...of to a Zone.js supported form. - 'async-await': nativeAsyncAwait, - // V8 currently has a performance defect involving object spread operations that can cause signficant - // degradation in runtime performance. By not supporting the language feature here, a downlevel form - // will be used instead which provides a workaround for the performance issue. - // For more details: https://bugs.chromium.org/p/v8/issues/detail?id=11536 - 'object-rest-spread': false, - }; -} -const MAX_CONCURRENT_WRITES = 64; -async function emitFilesToDisk(files, writeFileCallback) { - // Write files in groups of MAX_CONCURRENT_WRITES to avoid too many open files - for (let fileIndex = 0; fileIndex < files.length;) { - const groupMax = Math.min(fileIndex + MAX_CONCURRENT_WRITES, files.length); - const actions = []; - while (fileIndex < groupMax) { - actions.push(writeFileCallback(files[fileIndex++])); - } - await Promise.all(actions); - } -} -function createOutputFile(path, data, type) { - if (typeof data === 'string') { - let cachedContents = null; - let cachedText = data; - let cachedHash = null; - return { - path, - type, - get contents() { - cachedContents ??= new TextEncoder().encode(data); - return cachedContents; - }, - set contents(value) { - cachedContents = value; - cachedText = null; - }, - get text() { - cachedText ??= new TextDecoder('utf-8').decode(this.contents); - return cachedText; - }, - get size() { - return this.contents.byteLength; - }, - get hash() { - cachedHash ??= (0, node_crypto_1.createHash)('sha256') - .update(cachedText ?? this.contents) - .digest('hex'); - return cachedHash; - }, - clone() { - return createOutputFile(this.path, cachedText ?? this.contents, this.type); - }, - }; - } - else { - let cachedContents = data; - let cachedText = null; - let cachedHash = null; - return { - get contents() { - return cachedContents; - }, - set contents(value) { - cachedContents = value; - cachedText = null; - }, - path, - type, - get size() { - return this.contents.byteLength; - }, - get text() { - cachedText ??= new TextDecoder('utf-8').decode(this.contents); - return cachedText; - }, - get hash() { - cachedHash ??= (0, node_crypto_1.createHash)('sha256').update(this.contents).digest('hex'); - return cachedHash; - }, - clone() { - return createOutputFile(this.path, this.contents, this.type); - }, - }; - } -} -function convertOutputFile(file, type) { - let { contents: cachedContents } = file; - let cachedText = null; - return { - get contents() { - return cachedContents; - }, - set contents(value) { - cachedContents = value; - cachedText = null; - }, - hash: file.hash, - path: file.path, - type, - get size() { - return this.contents.byteLength; - }, - get text() { - cachedText ??= new TextDecoder('utf-8').decode(this.contents); - return cachedText; - }, - clone() { - return convertOutputFile(this, this.type); - }, - }; -} -/** - * Transform browserlists result to esbuild target. - * @see https://esbuild.github.io/api/#target - */ -function transformSupportedBrowsersToTargets(supportedBrowsers) { - const transformed = []; - // https://esbuild.github.io/api/#target - const esBuildSupportedBrowsers = new Set([ - 'chrome', - 'edge', - 'firefox', - 'ie', - 'ios', - 'node', - 'opera', - 'safari', - ]); - for (const browser of supportedBrowsers) { - let [browserName, version] = browser.toLowerCase().split(' '); - // browserslist uses the name `ios_saf` for iOS Safari whereas esbuild uses `ios` - if (browserName === 'ios_saf') { - browserName = 'ios'; - } - // browserslist uses ranges `15.2-15.3` versions but only the lowest is required - // to perform minimum supported feature checks. esbuild also expects a single version. - [version] = version.split('-'); - if (esBuildSupportedBrowsers.has(browserName)) { - if (browserName === 'safari' && version === 'tp') { - // esbuild only supports numeric versions so `TP` is converted to a high number (999) since - // a Technology Preview (TP) of Safari is assumed to support all currently known features. - version = '999'; - } - else if (!version.includes('.')) { - // A lone major version is considered by esbuild to include all minor versions. However, - // browserslist does not and is also inconsistent in its `.0` version naming. For example, - // Safari 15.0 is named `safari 15` but Safari 16.0 is named `safari 16.0`. - version += '.0'; - } - transformed.push(browserName + version); - } - } - return transformed; -} -const SUPPORTED_NODE_VERSIONS = '^20.19.0 || ^22.12.0 || >=24.0.0'; -/** - * Transform supported Node.js versions to esbuild target. - * @see https://esbuild.github.io/api/#target - */ -function getSupportedNodeTargets() { - if (SUPPORTED_NODE_VERSIONS.charAt(0) === '0') { - // Unlike `pkg_npm`, `ts_library` which is used to run unit tests does not support substitutions. - return []; - } - return SUPPORTED_NODE_VERSIONS.split('||').map((v) => 'node' + (0, semver_1.coerce)(v)?.version); -} -async function createJsonBuildManifest(result, normalizedOptions) { - const { colors: color, outputOptions: { base, server, browser }, ssrOptions, outputMode, } = normalizedOptions; - const { warnings, errors, prerenderedRoutes } = result; - const manifest = { - errors: errors.length ? await (0, esbuild_1.formatMessages)(errors, { kind: 'error', color }) : [], - warnings: warnings.length ? await (0, esbuild_1.formatMessages)(warnings, { kind: 'warning', color }) : [], - outputPaths: { - root: (0, node_url_1.pathToFileURL)(base), - browser: (0, node_url_1.pathToFileURL)((0, node_path_1.join)(base, browser)), - server: outputMode !== schema_1.OutputMode.Static && ssrOptions - ? (0, node_url_1.pathToFileURL)((0, node_path_1.join)(base, server)) - : undefined, - }, - prerenderedRoutes, - }; - return JSON.stringify(manifest, undefined, 2); -} -async function logMessages(logger, executionResult, color, jsonLogs) { - const { warnings, errors, logs } = executionResult; - if (logs.length) { - logger.info(logs.join('\n')); - } - if (jsonLogs) { - return; - } - if (warnings.length) { - logger.warn((await (0, esbuild_1.formatMessages)(warnings, { kind: 'warning', color })).join('\n')); - } - if (errors.length) { - logger.error((await (0, esbuild_1.formatMessages)(errors, { kind: 'error', color })).join('\n')); - } -} -/** - * Ascertain whether the application operates without `zone.js`, we currently rely on the polyfills setting to determine its status. - * If a file with an extension is provided or if `zone.js` is included in the polyfills, the application is deemed as not zoneless. - * @param polyfills An array of polyfills - * @returns true, when the application is considered as zoneless. - */ -function isZonelessApp(polyfills) { - // TODO: Instead, we should rely on the presence of zone.js in the polyfills build metadata. - return !polyfills?.some((p) => p === 'zone.js' || /\.[mc]?[jt]s$/.test(p)); -} -function getEntryPointName(entryPoint) { - return (0, node_path_1.basename)(entryPoint) - .replace(/(.*:)/, '') // global:bundle.css -> bundle.css - .replace(/\.[cm]?[jt]s$/, '') - .replace(/[\\/.]/g, '-'); -} -/** - * A set of server-generated dependencies that are treated as external. - * - * These dependencies are marked as external because they are produced by a - * separate bundling process and are not included in the primary bundle. This - * ensures that these generated files are resolved from an external source rather - * than being part of the main bundle. - */ -exports.SERVER_GENERATED_EXTERNALS = new Set([ - './polyfills.server.mjs', - './' + manifest_1.SERVER_APP_MANIFEST_FILENAME, - './' + manifest_1.SERVER_APP_ENGINE_MANIFEST_FILENAME, -]); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/virtual-module-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/virtual-module-plugin.d.ts deleted file mode 100755 index cbf0cbd..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/virtual-module-plugin.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { OnLoadArgs, Plugin, PluginBuild } from 'esbuild'; -import { LoadResultCache } from './load-result-cache'; -/** - * Options for the createVirtualModulePlugin - * @see createVirtualModulePlugin - */ -export interface VirtualModulePluginOptions { - /** Namespace. Example: `angular:polyfills`. */ - namespace: string; - /** If the generated module should be marked as external. */ - external?: boolean; - /** Method to transform the onResolve path. */ - transformPath?: (path: string) => string; - /** Method to provide the module content. */ - loadContent: (args: OnLoadArgs, build: PluginBuild) => ReturnType[1]>; - /** Restrict to only entry points. Defaults to `true`. */ - entryPointOnly?: boolean; - /** Load results cache. */ - cache?: LoadResultCache; -} -/** - * Creates an esbuild plugin that generated virtual modules. - * - * @returns An esbuild plugin. - */ -export declare function createVirtualModulePlugin(options: VirtualModulePluginOptions): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/virtual-module-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/virtual-module-plugin.js deleted file mode 100755 index 3e487b5..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/virtual-module-plugin.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createVirtualModulePlugin = createVirtualModulePlugin; -const load_result_cache_1 = require("./load-result-cache"); -/** - * Creates an esbuild plugin that generated virtual modules. - * - * @returns An esbuild plugin. - */ -function createVirtualModulePlugin(options) { - const { namespace, external, transformPath: pathTransformer, loadContent, cache, entryPointOnly = true, } = options; - return { - name: namespace.replace(/[/:]/g, '-'), - setup(build) { - build.onResolve({ filter: new RegExp('^' + namespace) }, ({ kind, path }) => { - if (entryPointOnly && kind !== 'entry-point') { - return null; - } - return { - path: pathTransformer?.(path) ?? path, - namespace, - }; - }); - if (external) { - build.onResolve({ filter: /./, namespace }, ({ path }) => { - return { - path, - external: true, - }; - }); - } - build.onLoad({ filter: /./, namespace }, (0, load_result_cache_1.createCachedLoad)(cache, (args) => loadContent(args, build))); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm-plugin.d.ts deleted file mode 100755 index 81b2225..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm-plugin.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'esbuild'; -import { LoadResultCache } from './load-result-cache'; -/** - * Options for the Angular WASM esbuild plugin - * @see createWasmPlugin - */ -export interface WasmPluginOptions { - /** Allow generation of async (proposal compliant) WASM imports. This requires zoneless to enable async/await. */ - allowAsync?: boolean; - /** Load results cache. */ - cache?: LoadResultCache; -} -/** - * Creates an esbuild plugin to use WASM files with import statements and expressions. - * The default behavior follows the WebAssembly/ES mode integration proposal found at - * https://github.com/WebAssembly/esm-integration/tree/main/proposals/esm-integration. - * This behavior requires top-level await support which is only available in zoneless - * Angular applications. - * @returns An esbuild plugin. - */ -export declare function createWasmPlugin(options: WasmPluginOptions): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm-plugin.js deleted file mode 100755 index 7a6c0e6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm-plugin.js +++ /dev/null @@ -1,210 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createWasmPlugin = createWasmPlugin; -const node_assert_1 = __importDefault(require("node:assert")); -const node_crypto_1 = require("node:crypto"); -const promises_1 = require("node:fs/promises"); -const node_path_1 = require("node:path"); -const error_1 = require("../../utils/error"); -const load_result_cache_1 = require("./load-result-cache"); -const WASM_INIT_NAMESPACE = 'angular:wasm:init'; -const WASM_CONTENTS_NAMESPACE = 'angular:wasm:contents'; -const WASM_RESOLVE_SYMBOL = Symbol('WASM_RESOLVE_SYMBOL'); -// See: https://github.com/tc39/proposal-regexp-unicode-property-escapes/blob/fe6d07fad74cd0192d154966baa1e95e7cda78a1/README.md#other-examples -const ecmaIdentifierNameRegExp = /^(?:[$_\p{ID_Start}])(?:[$_\u200C\u200D\p{ID_Continue}])*$/u; -/** - * Creates an esbuild plugin to use WASM files with import statements and expressions. - * The default behavior follows the WebAssembly/ES mode integration proposal found at - * https://github.com/WebAssembly/esm-integration/tree/main/proposals/esm-integration. - * This behavior requires top-level await support which is only available in zoneless - * Angular applications. - * @returns An esbuild plugin. - */ -function createWasmPlugin(options) { - const { allowAsync = false, cache } = options; - return { - name: 'angular-wasm', - setup(build) { - build.onResolve({ filter: /\.wasm$/ }, async (args) => { - // Skip if already resolving the WASM file to avoid infinite resolution - if (args.pluginData?.[WASM_RESOLVE_SYMBOL]) { - return; - } - // Skip if not an import statement or expression - if (args.kind !== 'import-statement' && args.kind !== 'dynamic-import') { - return; - } - // When in the initialization namespace, the content has already been resolved - // and only needs to be loaded for use with the initialization code. - if (args.namespace === WASM_INIT_NAMESPACE) { - return { - namespace: WASM_CONTENTS_NAMESPACE, - path: (0, node_path_1.join)(args.resolveDir, args.path), - pluginData: args.pluginData, - }; - } - // Skip if a custom loader is defined - if (build.initialOptions.loader?.['.wasm'] || args.with['loader']) { - return; - } - // Attempt full resolution of the WASM file - const resolveOptions = { - ...args, - pluginData: { [WASM_RESOLVE_SYMBOL]: true }, - }; - // The "path" property will cause an error if used in the resolve call - delete resolveOptions.path; - const result = await build.resolve(args.path, resolveOptions); - // Skip if there are errors, is external, or another plugin resolves to a custom namespace - if (result.errors.length > 0 || result.external || result.namespace !== 'file') { - // Reuse already resolved result - return result; - } - return { - ...result, - namespace: WASM_INIT_NAMESPACE, - }; - }); - build.onLoad({ filter: /\.wasm$/, namespace: WASM_INIT_NAMESPACE }, (0, load_result_cache_1.createCachedLoad)(cache, async (args) => { - // Ensure async mode is supported - if (!allowAsync) { - return { - errors: [ - { - text: 'WASM/ES module integration imports are not supported with Zone.js applications', - notes: [ - { - text: 'Information about zoneless Angular applications can be found here: https://angular.dev/guide/experimental/zoneless', - }, - ], - }, - ], - }; - } - const wasmContents = await (0, promises_1.readFile)(args.path); - // Inline WASM code less than 10kB - const inlineWasm = wasmContents.byteLength < 10_000; - // Add import of WASM contents - let initContents = `import ${inlineWasm ? 'wasmData' : 'wasmPath'} from ${JSON.stringify((0, node_path_1.basename)(args.path))}`; - initContents += inlineWasm ? ' with { loader: "binary" };' : ';\n\n'; - // Read from the file system when on Node.js (SSR) and not inline - if (!inlineWasm && build.initialOptions.platform === 'node') { - initContents += 'import { readFile } from "node:fs/promises";\n'; - initContents += - 'const wasmData = await readFile(new URL(wasmPath, import.meta.url));\n'; - } - // Create initialization function - initContents += generateInitHelper(!inlineWasm && build.initialOptions.platform !== 'node', wasmContents); - // Analyze WASM for imports and exports - let importModuleNames, exportNames; - try { - const wasm = await WebAssembly.compile(wasmContents); - importModuleNames = new Set(WebAssembly.Module.imports(wasm).map((value) => value.module)); - exportNames = WebAssembly.Module.exports(wasm).map((value) => value.name); - } - catch (error) { - (0, error_1.assertIsError)(error); - return { - errors: [{ text: 'Unable to analyze WASM file', notes: [{ text: error.message }] }], - }; - } - // Ensure export names are valid JavaScript identifiers - const invalidExportNames = exportNames.filter((name) => !ecmaIdentifierNameRegExp.test(name)); - if (invalidExportNames.length > 0) { - return { - errors: invalidExportNames.map((name) => ({ - text: 'WASM export names must be valid JavaScript identifiers', - notes: [ - { - text: `The export "${name}" is not valid. The WASM file should be updated to remove this error.`, - }, - ], - })), - }; - } - // Add import statements and setup import object - initContents += 'const importObject = Object.create(null);\n'; - let importIndex = 0; - for (const moduleName of importModuleNames) { - // Add a namespace import for each module name - initContents += `import * as wasm_import_${++importIndex} from ${JSON.stringify(moduleName)};\n`; - // Add the namespace object to the import object - initContents += `importObject[${JSON.stringify(moduleName)}] = wasm_import_${importIndex};\n`; - } - // Instantiate the module - initContents += 'const instance = await init(importObject);\n'; - // Add exports - const exportNameList = exportNames.join(', '); - initContents += `const { ${exportNameList} } = instance.exports;\n`; - initContents += `export { ${exportNameList} }\n`; - return { - contents: initContents, - loader: 'js', - resolveDir: (0, node_path_1.dirname)(args.path), - pluginData: { wasmContents }, - watchFiles: [args.path], - }; - })); - build.onLoad({ filter: /\.wasm$/, namespace: WASM_CONTENTS_NAMESPACE }, async (args) => { - const contents = args.pluginData.wasmContents ?? (await (0, promises_1.readFile)(args.path)); - let loader = 'file'; - if (args.with.loader) { - (0, node_assert_1.default)(args.with.loader === 'binary' || args.with.loader === 'file', 'WASM loader type should only be binary or file.'); - loader = args.with.loader; - } - return { - contents, - loader, - watchFiles: [args.path], - }; - }); - }, - }; -} -/** - * Generates the string content of the WASM initialization helper function. - * This function supports both file fetching and inline byte data depending on - * the preferred option for the WASM file. When fetching, an integrity hash is - * also generated and used with the fetch action. - * - * @param streaming Uses fetch and WebAssembly.instantiateStreaming. - * @param wasmContents The binary contents to generate an integrity hash. - * @returns A string containing the initialization function. - */ -function generateInitHelper(streaming, wasmContents) { - let resultContents; - if (streaming) { - const fetchOptions = { - integrity: 'sha256-' + (0, node_crypto_1.createHash)('sha256').update(wasmContents).digest('base64'), - }; - const fetchContents = `fetch(new URL(wasmPath, import.meta.url), ${JSON.stringify(fetchOptions)})`; - resultContents = `await WebAssembly.instantiateStreaming(${fetchContents}, imports)`; - } - else { - resultContents = 'await WebAssembly.instantiate(wasmData, imports)'; - } - const contents = ` -let mod; -async function init(imports) { - if (mod) { - return await WebAssembly.instantiate(mod, imports); - } - - const result = ${resultContents}; - mod = result.module; - - return result.instance; -} -`; - return contents; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm.d.ts deleted file mode 100755 index e3b4503..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/wasm.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -/** @fileoverview - * TypeScript does not provide a separate lib for WASM types and the Node.js - * types (`@types/node`) does not contain them either. This type definition - * file provides type information for the subset of functionality required - * by the Angular build process. Ideally this can be removed when the WASM - * type situation has improved. - */ - -declare namespace WebAssembly { - class Module { - constructor(data: Uint8Array); - - static imports(mod: Module): { module: string; name: string }[]; - static exports(mode: Module): { name: string }[]; - } - function compile(data: Uint8Array): Promise; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/watcher.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/watcher.d.ts deleted file mode 100755 index c2991eb..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/watcher.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare class ChangedFiles { - readonly added: Set; - readonly modified: Set; - readonly removed: Set; - get all(): string[]; - toDebugString(): string; -} -export interface BuildWatcher extends AsyncIterableIterator { - add(paths: string | readonly string[]): void; - remove(paths: string | readonly string[]): void; - close(): Promise; -} -export declare function createWatcher(options?: { - polling?: boolean; - interval?: number; - ignored?: string[]; - followSymlinks?: boolean; -}): BuildWatcher; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/watcher.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/watcher.js deleted file mode 100755 index 046b6e1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/esbuild/watcher.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ChangedFiles = void 0; -exports.createWatcher = createWatcher; -const watchpack_1 = __importDefault(require("watchpack")); -class ChangedFiles { - added = new Set(); - modified = new Set(); - removed = new Set(); - get all() { - return [...this.added, ...this.modified, ...this.removed]; - } - toDebugString() { - const content = { - added: Array.from(this.added), - modified: Array.from(this.modified), - removed: Array.from(this.removed), - }; - return JSON.stringify(content, null, 2); - } -} -exports.ChangedFiles = ChangedFiles; -function createWatcher(options) { - const watcher = new watchpack_1.default({ - poll: options?.polling ? options?.interval ?? true : false, - ignored: options?.ignored, - followSymlinks: options?.followSymlinks, - aggregateTimeout: 250, - }); - const watchedFiles = new Set(); - const nextQueue = []; - let currentChangedFiles; - watcher.on('aggregated', (changes, removals) => { - const changedFiles = currentChangedFiles ?? new ChangedFiles(); - for (const file of changes) { - changedFiles.modified.add(file); - } - for (const file of removals) { - changedFiles.removed.add(file); - } - const next = nextQueue.shift(); - if (next) { - currentChangedFiles = undefined; - next(changedFiles); - } - else { - currentChangedFiles = changedFiles; - } - }); - return { - [Symbol.asyncIterator]() { - return this; - }, - async next() { - if (currentChangedFiles && nextQueue.length === 0) { - const result = { value: currentChangedFiles }; - currentChangedFiles = undefined; - return result; - } - return new Promise((resolve) => { - nextQueue.push((value) => resolve(value ? { value } : { done: true, value })); - }); - }, - add(paths) { - const previousSize = watchedFiles.size; - if (typeof paths === 'string') { - watchedFiles.add(paths); - } - else { - for (const file of paths) { - watchedFiles.add(file); - } - } - if (previousSize !== watchedFiles.size) { - watcher.watch({ - files: watchedFiles, - }); - } - }, - remove(paths) { - const previousSize = watchedFiles.size; - if (typeof paths === 'string') { - watchedFiles.delete(paths); - } - else { - for (const file of paths) { - watchedFiles.delete(file); - } - } - if (previousSize !== watchedFiles.size) { - watcher.watch({ - files: watchedFiles, - }); - } - }, - async close() { - try { - watcher.close(); - } - finally { - let next; - while ((next = nextQueue.shift()) !== undefined) { - next(); - } - } - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/lexer.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/lexer.d.ts deleted file mode 100755 index 40ce4fa..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/lexer.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -/** - * Scans a CSS or Sass file and locates all valid url function values as defined by the - * syntax specification. - * @param contents A string containing a CSS or Sass file to scan. - * @returns An iterable that yields each CSS url function value found. - */ -export declare function findUrls(contents: string): Iterable<{ - start: number; - end: number; - value: string; -}>; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/lexer.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/lexer.js deleted file mode 100755 index ce2060f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/lexer.js +++ /dev/null @@ -1,171 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.findUrls = findUrls; -// TODO: Combine everything into a single pass lexer -/** - * Determines if a unicode code point is a CSS whitespace character. - * @param code The unicode code point to test. - * @returns true, if the code point is CSS whitespace; false, otherwise. - */ -function isWhitespace(code) { - // Based on https://www.w3.org/TR/css-syntax-3/#whitespace - switch (code) { - case 0x0009: // tab - case 0x0020: // space - case 0x000a: // line feed - case 0x000c: // form feed - case 0x000d: // carriage return - return true; - default: - return false; - } -} -/** - * Scans a CSS or Sass file and locates all valid url function values as defined by the - * syntax specification. - * @param contents A string containing a CSS or Sass file to scan. - * @returns An iterable that yields each CSS url function value found. - */ -function* findUrls(contents) { - let pos = 0; - let width = 1; - let current = -1; - const next = () => { - pos += width; - current = contents.codePointAt(pos) ?? -1; - width = current > 0xffff ? 2 : 1; - return current; - }; - // Based on https://www.w3.org/TR/css-syntax-3/#consume-ident-like-token - while ((pos = contents.indexOf('url(', pos)) !== -1) { - width = 1; - // Ensure whitespace, comma, or colon before `url(` - if (pos > 0) { - pos -= 2; - next(); - if (!isWhitespace(current) && current !== 0x002c && current !== 0x003a) { - // Skip - not a url token - pos += 3; - continue; - } - pos += 1; - } - // Set to position of the ( - pos += 3; - // Consume all leading whitespace - while (isWhitespace(next())) { - /* empty */ - } - // Initialize URL state - const url = { start: pos, end: -1, value: '' }; - let complete = false; - // If " or ', then consume the value as a string - if (current === 0x0022 || current === 0x0027) { - const ending = current; - // Based on https://www.w3.org/TR/css-syntax-3/#consume-string-token - while (!complete) { - switch (next()) { - case -1: // EOF - return; - case 0x000a: // line feed - case 0x000c: // form feed - case 0x000d: // carriage return - // Invalid - complete = true; - break; - case 0x005c: // \ -- character escape - // If not EOF or newline, add the character after the escape - switch (next()) { - case -1: - return; - case 0x000a: // line feed - case 0x000c: // form feed - case 0x000d: // carriage return - // Skip when inside a string - break; - default: - // TODO: Handle hex escape codes - url.value += String.fromCodePoint(current); - break; - } - break; - case ending: - // Full string position should include the quotes for replacement - url.end = pos + 1; - complete = true; - yield url; - break; - default: - url.value += String.fromCodePoint(current); - break; - } - } - next(); - continue; - } - // Based on https://www.w3.org/TR/css-syntax-3/#consume-url-token - while (!complete) { - switch (current) { - case -1: // EOF - return; - case 0x0022: // " - case 0x0027: // ' - case 0x0028: // ( - // Invalid - complete = true; - break; - case 0x0029: // ) - // URL is valid and complete - url.end = pos; - complete = true; - break; - case 0x005c: // \ -- character escape - // If not EOF or newline, add the character after the escape - switch (next()) { - case -1: // EOF - return; - case 0x000a: // line feed - case 0x000c: // form feed - case 0x000d: // carriage return - // Invalid - complete = true; - break; - default: - // TODO: Handle hex escape codes - url.value += String.fromCodePoint(current); - break; - } - break; - default: - if (isWhitespace(current)) { - while (isWhitespace(next())) { - /* empty */ - } - // Unescaped whitespace is only valid before the closing ) - if (current === 0x0029) { - // URL is valid - url.end = pos; - } - complete = true; - } - else { - // Add the character to the url value - url.value += String.fromCodePoint(current); - } - break; - } - next(); - } - // An end position indicates a URL was found - if (url.end !== -1) { - yield url; - } - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/rebasing-importer.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/rebasing-importer.d.ts deleted file mode 100755 index 24eb507..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/rebasing-importer.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { RawSourceMap } from '@ampproject/remapping'; -import type { CanonicalizeContext, Importer, ImporterResult } from 'sass'; -/** - * A preprocessed cache entry for the files and directories within a previously searched - * directory when performing Sass import resolution. - */ -export interface DirectoryEntry { - files: Set; - directories: Set; -} -/** - * A Sass Importer base class that provides the load logic to rebase all `url()` functions - * within a stylesheet. The rebasing will ensure that the URLs in the output of the Sass compiler - * reflect the final filesystem location of the output CSS file. - * - * This class provides the core of the rebasing functionality. To ensure that each file is processed - * by this importer's load implementation, the Sass compiler requires the importer's canonicalize - * function to return a non-null value with the resolved location of the requested stylesheet. - * Concrete implementations of this class must provide this canonicalize functionality for rebasing - * to be effective. - */ -declare abstract class UrlRebasingImporter implements Importer<'sync'> { - private entryDirectory; - private rebaseSourceMaps?; - /** - * @param entryDirectory The directory of the entry stylesheet that was passed to the Sass compiler. - * @param rebaseSourceMaps When provided, rebased files will have an intermediate sourcemap added to the Map - * which can be used to generate a final sourcemap that contains original sources. - */ - constructor(entryDirectory: string, rebaseSourceMaps?: Map | undefined); - abstract canonicalize(url: string, options: { - fromImport: boolean; - }): URL | null; - load(canonicalUrl: URL): ImporterResult | null; -} -/** - * Provides the Sass importer logic to resolve relative stylesheet imports via both import and use rules - * and also rebase any `url()` function usage within those stylesheets. The rebasing will ensure that - * the URLs in the output of the Sass compiler reflect the final filesystem location of the output CSS file. - */ -export declare class RelativeUrlRebasingImporter extends UrlRebasingImporter { - private directoryCache; - constructor(entryDirectory: string, directoryCache?: Map, rebaseSourceMaps?: Map); - canonicalize(url: string, options: { - fromImport: boolean; - }): URL | null; - /** - * Attempts to resolve a provided URL to a stylesheet file using the Sass compiler's resolution algorithm. - * Based on https://github.com/sass/dart-sass/blob/44d6bb6ac72fe6b93f5bfec371a1fffb18e6b76d/lib/src/importer/utils.dart - * @param url The file protocol URL to resolve. - * @param fromImport If true, URL was from an import rule; otherwise from a use rule. - * @param checkDirectory If true, try checking for a directory with the base name containing an index file. - * @returns A full resolved URL of the stylesheet file or `null` if not found. - */ - private resolveImport; - /** - * Checks an array of potential stylesheet files to determine if there is a valid - * stylesheet file. More than one discovered file may indicate an error. - * @param found An array of discovered stylesheet files. - * @returns A fully resolved path for a stylesheet file or `null` if not found. - * @throws If there are ambiguous files discovered. - */ - private checkFound; -} -/** - * Provides the Sass importer logic to resolve module (npm package) stylesheet imports via both import and - * use rules and also rebase any `url()` function usage within those stylesheets. The rebasing will ensure that - * the URLs in the output of the Sass compiler reflect the final filesystem location of the output CSS file. - */ -export declare class ModuleUrlRebasingImporter extends RelativeUrlRebasingImporter { - private finder; - constructor(entryDirectory: string, directoryCache: Map, rebaseSourceMaps: Map | undefined, finder: (specifier: string, options: CanonicalizeContext) => URL | null); - canonicalize(url: string, options: CanonicalizeContext): URL | null; -} -/** - * Provides the Sass importer logic to resolve load paths located stylesheet imports via both import and - * use rules and also rebase any `url()` function usage within those stylesheets. The rebasing will ensure that - * the URLs in the output of the Sass compiler reflect the final filesystem location of the output CSS file. - */ -export declare class LoadPathsUrlRebasingImporter extends RelativeUrlRebasingImporter { - private loadPaths; - constructor(entryDirectory: string, directoryCache: Map, rebaseSourceMaps: Map | undefined, loadPaths: Iterable); - canonicalize(url: string, options: { - fromImport: boolean; - }): URL | null; -} -/** - * Workaround for Sass not calling instance methods with `this`. - * The `canonicalize` and `load` methods will be bound to the class instance. - * @param importer A Sass importer to bind. - * @returns The bound Sass importer. - */ -export declare function sassBindWorkaround(importer: T): T; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/rebasing-importer.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/rebasing-importer.js deleted file mode 100755 index 7dea54a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/rebasing-importer.js +++ /dev/null @@ -1,332 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LoadPathsUrlRebasingImporter = exports.ModuleUrlRebasingImporter = exports.RelativeUrlRebasingImporter = void 0; -exports.sassBindWorkaround = sassBindWorkaround; -const magic_string_1 = __importDefault(require("magic-string")); -const node_fs_1 = require("node:fs"); -const node_path_1 = require("node:path"); -const node_url_1 = require("node:url"); -const error_1 = require("../../utils/error"); -const path_1 = require("../../utils/path"); -const lexer_1 = require("./lexer"); -/** - * A Sass Importer base class that provides the load logic to rebase all `url()` functions - * within a stylesheet. The rebasing will ensure that the URLs in the output of the Sass compiler - * reflect the final filesystem location of the output CSS file. - * - * This class provides the core of the rebasing functionality. To ensure that each file is processed - * by this importer's load implementation, the Sass compiler requires the importer's canonicalize - * function to return a non-null value with the resolved location of the requested stylesheet. - * Concrete implementations of this class must provide this canonicalize functionality for rebasing - * to be effective. - */ -class UrlRebasingImporter { - entryDirectory; - rebaseSourceMaps; - /** - * @param entryDirectory The directory of the entry stylesheet that was passed to the Sass compiler. - * @param rebaseSourceMaps When provided, rebased files will have an intermediate sourcemap added to the Map - * which can be used to generate a final sourcemap that contains original sources. - */ - constructor(entryDirectory, rebaseSourceMaps) { - this.entryDirectory = entryDirectory; - this.rebaseSourceMaps = rebaseSourceMaps; - } - load(canonicalUrl) { - const stylesheetPath = (0, node_url_1.fileURLToPath)(canonicalUrl); - const stylesheetDirectory = (0, node_path_1.dirname)(stylesheetPath); - let contents = (0, node_fs_1.readFileSync)(stylesheetPath, 'utf-8'); - // Rebase any URLs that are found - let updatedContents; - for (const { start, end, value } of (0, lexer_1.findUrls)(contents)) { - // Skip if value is empty or Webpack-specific prefix - if (value.length === 0 || value[0] === '~' || value[0] === '^') { - continue; - } - // Skip if root-relative, absolute or protocol relative url - if (/^((?:\w+:)?\/\/|data:|chrome:|\/)/.test(value)) { - continue; - } - // Skip if a fragment identifier but not a Sass interpolation - if (value[0] === '#' && value[1] !== '{') { - continue; - } - // Skip if value is value contains a function call - if (/#\{.+\(.+\)\}/.test(value)) { - continue; - } - // Sass variable usage either starts with a `$` or contains a namespace and a `.$` - const valueNormalized = value[0] === '$' || /^\w[\w_-]*\.\$/.test(value) ? `#{${value}}` : value; - const rebasedPath = (0, node_path_1.relative)(this.entryDirectory, stylesheetDirectory); - // Normalize path separators and escape characters - // https://developer.mozilla.org/en-US/docs/Web/CSS/url#syntax - const rebasedUrl = (0, path_1.toPosixPath)(rebasedPath).replace(/[()\s'"]/g, '\\$&'); - updatedContents ??= new magic_string_1.default(contents); - // Always quote the URL to avoid potential downstream parsing problems - updatedContents.update(start, end, `"${rebasedUrl}||file:${valueNormalized}"`); - } - if (updatedContents) { - contents = updatedContents.toString(); - if (this.rebaseSourceMaps) { - // Generate an intermediate source map for the rebasing changes - const map = updatedContents.generateMap({ - hires: 'boundary', - includeContent: true, - source: canonicalUrl.href, - }); - this.rebaseSourceMaps.set(canonicalUrl.href, map); - } - } - let syntax; - switch ((0, node_path_1.extname)(stylesheetPath).toLowerCase()) { - case '.css': - syntax = 'css'; - break; - case '.sass': - syntax = 'indented'; - break; - default: - syntax = 'scss'; - break; - } - return { - contents, - syntax, - sourceMapUrl: canonicalUrl, - }; - } -} -/** - * Provides the Sass importer logic to resolve relative stylesheet imports via both import and use rules - * and also rebase any `url()` function usage within those stylesheets. The rebasing will ensure that - * the URLs in the output of the Sass compiler reflect the final filesystem location of the output CSS file. - */ -class RelativeUrlRebasingImporter extends UrlRebasingImporter { - directoryCache; - constructor(entryDirectory, directoryCache = new Map(), rebaseSourceMaps) { - super(entryDirectory, rebaseSourceMaps); - this.directoryCache = directoryCache; - } - canonicalize(url, options) { - return this.resolveImport(url, options.fromImport, true); - } - /** - * Attempts to resolve a provided URL to a stylesheet file using the Sass compiler's resolution algorithm. - * Based on https://github.com/sass/dart-sass/blob/44d6bb6ac72fe6b93f5bfec371a1fffb18e6b76d/lib/src/importer/utils.dart - * @param url The file protocol URL to resolve. - * @param fromImport If true, URL was from an import rule; otherwise from a use rule. - * @param checkDirectory If true, try checking for a directory with the base name containing an index file. - * @returns A full resolved URL of the stylesheet file or `null` if not found. - */ - resolveImport(url, fromImport, checkDirectory) { - let stylesheetPath; - try { - stylesheetPath = (0, node_url_1.fileURLToPath)(url); - } - catch { - // Only file protocol URLs are supported by this importer - return null; - } - const directory = (0, node_path_1.dirname)(stylesheetPath); - const extension = (0, node_path_1.extname)(stylesheetPath); - const hasStyleExtension = extension === '.scss' || extension === '.sass' || extension === '.css'; - // Remove the style extension if present to allow adding the `.import` suffix - const filename = (0, node_path_1.basename)(stylesheetPath, hasStyleExtension ? extension : undefined); - const importPotentials = new Set(); - const defaultPotentials = new Set(); - if (hasStyleExtension) { - if (fromImport) { - importPotentials.add(filename + '.import' + extension); - importPotentials.add('_' + filename + '.import' + extension); - } - defaultPotentials.add(filename + extension); - defaultPotentials.add('_' + filename + extension); - } - else { - if (fromImport) { - importPotentials.add(filename + '.import.scss'); - importPotentials.add(filename + '.import.sass'); - importPotentials.add(filename + '.import.css'); - importPotentials.add('_' + filename + '.import.scss'); - importPotentials.add('_' + filename + '.import.sass'); - importPotentials.add('_' + filename + '.import.css'); - } - defaultPotentials.add(filename + '.scss'); - defaultPotentials.add(filename + '.sass'); - defaultPotentials.add(filename + '.css'); - defaultPotentials.add('_' + filename + '.scss'); - defaultPotentials.add('_' + filename + '.sass'); - defaultPotentials.add('_' + filename + '.css'); - } - let foundDefaults; - let foundImports; - let hasPotentialIndex = false; - let cachedEntries = this.directoryCache.get(directory); - if (cachedEntries) { - // If there is a preprocessed cache of the directory, perform an intersection of the potentials - // and the directory files. - const { files, directories } = cachedEntries; - foundDefaults = [...defaultPotentials].filter((potential) => files.has(potential)); - foundImports = [...importPotentials].filter((potential) => files.has(potential)); - hasPotentialIndex = checkDirectory && !hasStyleExtension && directories.has(filename); - } - else { - // If no preprocessed cache exists, get the entries from the file system and, while searching, - // generate the cache for later requests. - let entries; - try { - entries = (0, node_fs_1.readdirSync)(directory, { withFileTypes: true }); - } - catch (error) { - (0, error_1.assertIsError)(error); - // If the containing directory does not exist return null to indicate it cannot be resolved - if (error.code === 'ENOENT') { - return null; - } - throw new Error(`Error reading directory ["${directory}"] while resolving Sass import`, { - cause: error, - }); - } - foundDefaults = []; - foundImports = []; - cachedEntries = { files: new Set(), directories: new Set() }; - for (const entry of entries) { - let isDirectory; - let isFile; - if (entry.isSymbolicLink()) { - const stats = (0, node_fs_1.statSync)((0, node_path_1.join)(directory, entry.name)); - isDirectory = stats.isDirectory(); - isFile = stats.isFile(); - } - else { - isDirectory = entry.isDirectory(); - isFile = entry.isFile(); - } - if (isDirectory) { - cachedEntries.directories.add(entry.name); - // Record if the name should be checked as a directory with an index file - if (checkDirectory && !hasStyleExtension && entry.name === filename) { - hasPotentialIndex = true; - } - } - if (!isFile) { - continue; - } - cachedEntries.files.add(entry.name); - if (importPotentials.has(entry.name)) { - foundImports.push(entry.name); - } - if (defaultPotentials.has(entry.name)) { - foundDefaults.push(entry.name); - } - } - this.directoryCache.set(directory, cachedEntries); - } - // `foundImports` will only contain elements if `options.fromImport` is true - const result = this.checkFound(foundImports) ?? this.checkFound(foundDefaults); - if (result !== null) { - return (0, node_url_1.pathToFileURL)((0, node_path_1.join)(directory, result)); - } - if (hasPotentialIndex) { - // Check for index files using filename as a directory - return this.resolveImport(url + '/index', fromImport, false); - } - return null; - } - /** - * Checks an array of potential stylesheet files to determine if there is a valid - * stylesheet file. More than one discovered file may indicate an error. - * @param found An array of discovered stylesheet files. - * @returns A fully resolved path for a stylesheet file or `null` if not found. - * @throws If there are ambiguous files discovered. - */ - checkFound(found) { - if (found.length === 0) { - // Not found - return null; - } - // More than one found file may be an error - if (found.length > 1) { - // Presence of CSS files alongside a Sass file does not cause an error - const foundWithoutCss = found.filter((element) => (0, node_path_1.extname)(element) !== '.css'); - // If the length is zero then there are two or more css files - // If the length is more than one than there are two or more sass/scss files - if (foundWithoutCss.length !== 1) { - throw new Error('Ambiguous import detected.'); - } - // Return the non-CSS file (sass/scss files have priority) - // https://github.com/sass/dart-sass/blob/44d6bb6ac72fe6b93f5bfec371a1fffb18e6b76d/lib/src/importer/utils.dart#L44-L47 - return foundWithoutCss[0]; - } - return found[0]; - } -} -exports.RelativeUrlRebasingImporter = RelativeUrlRebasingImporter; -/** - * Provides the Sass importer logic to resolve module (npm package) stylesheet imports via both import and - * use rules and also rebase any `url()` function usage within those stylesheets. The rebasing will ensure that - * the URLs in the output of the Sass compiler reflect the final filesystem location of the output CSS file. - */ -class ModuleUrlRebasingImporter extends RelativeUrlRebasingImporter { - finder; - constructor(entryDirectory, directoryCache, rebaseSourceMaps, finder) { - super(entryDirectory, directoryCache, rebaseSourceMaps); - this.finder = finder; - } - canonicalize(url, options) { - if (url.startsWith('file://')) { - return super.canonicalize(url, options); - } - let result = this.finder(url, options); - result &&= super.canonicalize(result.href, options); - return result; - } -} -exports.ModuleUrlRebasingImporter = ModuleUrlRebasingImporter; -/** - * Provides the Sass importer logic to resolve load paths located stylesheet imports via both import and - * use rules and also rebase any `url()` function usage within those stylesheets. The rebasing will ensure that - * the URLs in the output of the Sass compiler reflect the final filesystem location of the output CSS file. - */ -class LoadPathsUrlRebasingImporter extends RelativeUrlRebasingImporter { - loadPaths; - constructor(entryDirectory, directoryCache, rebaseSourceMaps, loadPaths) { - super(entryDirectory, directoryCache, rebaseSourceMaps); - this.loadPaths = loadPaths; - } - canonicalize(url, options) { - if (url.startsWith('file://')) { - return super.canonicalize(url, options); - } - let result = null; - for (const loadPath of this.loadPaths) { - result = super.canonicalize((0, node_url_1.pathToFileURL)((0, node_path_1.join)(loadPath, url)).href, options); - if (result !== null) { - break; - } - } - return result; - } -} -exports.LoadPathsUrlRebasingImporter = LoadPathsUrlRebasingImporter; -/** - * Workaround for Sass not calling instance methods with `this`. - * The `canonicalize` and `load` methods will be bound to the class instance. - * @param importer A Sass importer to bind. - * @returns The bound Sass importer. - */ -function sassBindWorkaround(importer) { - importer.canonicalize = importer.canonicalize.bind(importer); - importer.load = importer.load.bind(importer); - return importer; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/sass-service.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/sass-service.d.ts deleted file mode 100755 index 6f35a67..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/sass-service.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { CompileResult, Deprecation, SourceSpan, StringOptions } from 'sass'; -export interface SerializableVersion { - major: number; - minor: number; - patch: number; -} -export interface SerializableDeprecation extends Omit { - /** The version this deprecation first became active in. */ - deprecatedIn: SerializableVersion | null; - /** The version this deprecation became obsolete in. */ - obsoleteIn: SerializableVersion | null; -} -export type SerializableWarningMessage = ({ - deprecation: true; - deprecationType: SerializableDeprecation; -} | { - deprecation: false; -}) & { - message: string; - span?: Omit & { - url?: string; - }; - stack?: string; -}; -/** - * A Sass renderer implementation that provides an interface that can be used by Webpack's - * `sass-loader`. The implementation uses a Worker thread to perform the Sass rendering - * with the `dart-sass` package. The `dart-sass` synchronous render function is used within - * the worker which can be up to two times faster than the asynchronous variant. - */ -export declare class SassWorkerImplementation { - #private; - private readonly rebase; - readonly maxThreads: number; - constructor(rebase?: boolean, maxThreads?: number); - /** - * Provides information about the Sass implementation. - * This mimics enough of the `dart-sass` value to be used with the `sass-loader`. - */ - get info(): string; - /** - * The synchronous render function is not used by the `sass-loader`. - */ - compileString(): never; - /** - * Asynchronously request a Sass stylesheet to be renderered. - * - * @param source The contents to compile. - * @param options The `dart-sass` options to use when rendering the stylesheet. - */ - compileStringAsync(source: string, options: StringOptions<'async'>): Promise; - /** - * Shutdown the Sass render worker. - * Executing this method will stop any pending render requests. - * @returns A void promise that resolves when closing is complete. - */ - close(): Promise; - private processImporters; - private isFileImporter; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/sass-service.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/sass-service.js deleted file mode 100755 index 927b565..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/sass-service.js +++ /dev/null @@ -1,241 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -}; -var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) { - return function (env) { - function fail(e) { - env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); - }; -})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SassWorkerImplementation = void 0; -const node_assert_1 = __importDefault(require("node:assert")); -const node_url_1 = require("node:url"); -const node_worker_threads_1 = require("node:worker_threads"); -const environment_options_1 = require("../../utils/environment-options"); -const worker_pool_1 = require("../../utils/worker-pool"); -// Polyfill Symbol.dispose if not present -// eslint-disable-next-line @typescript-eslint/no-explicit-any -Symbol.dispose ??= Symbol('Symbol Dispose'); -/** - * The maximum number of Workers that will be created to execute render requests. - */ -const MAX_RENDER_WORKERS = environment_options_1.maxWorkers; -/** - * A Sass renderer implementation that provides an interface that can be used by Webpack's - * `sass-loader`. The implementation uses a Worker thread to perform the Sass rendering - * with the `dart-sass` package. The `dart-sass` synchronous render function is used within - * the worker which can be up to two times faster than the asynchronous variant. - */ -class SassWorkerImplementation { - rebase; - maxThreads; - #workerPool; - constructor(rebase = false, maxThreads = MAX_RENDER_WORKERS) { - this.rebase = rebase; - this.maxThreads = maxThreads; - } - #ensureWorkerPool() { - this.#workerPool ??= new worker_pool_1.WorkerPool({ - filename: require.resolve('./worker'), - maxThreads: this.maxThreads, - }); - return this.#workerPool; - } - /** - * Provides information about the Sass implementation. - * This mimics enough of the `dart-sass` value to be used with the `sass-loader`. - */ - get info() { - return 'dart-sass\tworker'; - } - /** - * The synchronous render function is not used by the `sass-loader`. - */ - compileString() { - throw new Error('Sass compileString is not supported.'); - } - /** - * Asynchronously request a Sass stylesheet to be renderered. - * - * @param source The contents to compile. - * @param options The `dart-sass` options to use when rendering the stylesheet. - */ - async compileStringAsync(source, options) { - const env_1 = { stack: [], error: void 0, hasError: false }; - try { - // The `functions`, `logger` and `importer` options are JavaScript functions that cannot be transferred. - // If any additional function options are added in the future, they must be excluded as well. - const { functions, importers, url, logger, ...serializableOptions } = options; - // The CLI's configuration does not use or expose the ability to define custom Sass functions - if (functions && Object.keys(functions).length > 0) { - throw new Error('Sass custom functions are not supported.'); - } - const importerChannel = __addDisposableResource(env_1, importers?.length ? this.#createImporterChannel(importers) : undefined, false); - const response = (await this.#ensureWorkerPool().run({ - source, - importerChannel, - hasLogger: !!logger, - rebase: this.rebase, - options: { - ...serializableOptions, - // URL is not serializable so to convert to string here and back to URL in the worker. - url: url ? (0, node_url_1.fileURLToPath)(url) : undefined, - }, - }, { - transferList: importerChannel ? [importerChannel.port] : undefined, - })); - const { result, error, warnings } = response; - if (warnings && logger?.warn) { - for (const { message, span, ...options } of warnings) { - logger.warn(message, { - ...options, - span: span && { - ...span, - url: span.url ? (0, node_url_1.pathToFileURL)(span.url) : undefined, - }, - }); - } - } - if (error) { - // Convert stringified url value required for cloning back to a URL object - const url = error.span?.url; - if (url) { - error.span.url = (0, node_url_1.pathToFileURL)(url); - } - throw error; - } - (0, node_assert_1.default)(result, 'Sass render worker should always return a result or an error'); - return { - ...result, - // URL is not serializable so in the worker we convert to string and here back to URL. - loadedUrls: result.loadedUrls.map((p) => (0, node_url_1.pathToFileURL)(p)), - }; - } - catch (e_1) { - env_1.error = e_1; - env_1.hasError = true; - } - finally { - __disposeResources(env_1); - } - } - /** - * Shutdown the Sass render worker. - * Executing this method will stop any pending render requests. - * @returns A void promise that resolves when closing is complete. - */ - async close() { - if (this.#workerPool) { - try { - await this.#workerPool.destroy(); - } - finally { - this.#workerPool = undefined; - } - } - } - #createImporterChannel(importers) { - const { port1: mainImporterPort, port2: workerImporterPort } = new node_worker_threads_1.MessageChannel(); - const importerSignal = new Int32Array(new SharedArrayBuffer(4)); - mainImporterPort.on('message', ({ url, options }) => { - this.processImporters(importers, url, { - ...options, - // URL is not serializable so in the worker we convert to string and here back to URL. - containingUrl: options.containingUrl - ? (0, node_url_1.pathToFileURL)(options.containingUrl) - : null, - }) - .then((result) => { - mainImporterPort.postMessage(result); - }) - .catch((error) => { - mainImporterPort.postMessage(error); - }) - .finally(() => { - Atomics.store(importerSignal, 0, 1); - Atomics.notify(importerSignal, 0); - }); - }); - mainImporterPort.unref(); - return { - port: workerImporterPort, - signal: importerSignal, - [Symbol.dispose]() { - mainImporterPort.close(); - }, - }; - } - async processImporters(importers, url, options) { - for (const importer of importers) { - if (!this.isFileImporter(importer)) { - // Importer - throw new Error('Only File Importers are supported.'); - } - // File importer (Can be sync or aync). - const result = await importer.findFileUrl(url, options); - if (result) { - return (0, node_url_1.fileURLToPath)(result); - } - } - return null; - } - isFileImporter(value) { - return 'findFileUrl' in value; - } -} -exports.SassWorkerImplementation = SassWorkerImplementation; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/worker.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/worker.d.ts deleted file mode 100755 index 761a788..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/worker.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { RawSourceMap } from '@ampproject/remapping'; -import { MessagePort } from 'node:worker_threads'; -import { SourceSpan, StringOptions } from 'sass'; -import type { SerializableWarningMessage } from './sass-service'; -/** - * A request to render a Sass stylesheet using the supplied options. - */ -interface RenderRequestMessage { - /** - * The contents to compile. - */ - source: string; - /** - * The Sass options to provide to the `dart-sass` compile function. - */ - options: Omit, 'url'> & { - url: string; - }; - /** - * Indicates the request has a custom importer function on the main thread. - */ - importerChannel?: { - port: MessagePort; - signal: Int32Array; - }; - /** - * Indicates the request has a custom logger for warning messages. - */ - hasLogger: boolean; - /** - * Indicates paths within url() CSS functions should be rebased. - */ - rebase: boolean; -} -interface RenderResult { - warnings: SerializableWarningMessage[] | undefined; - result: { - css: string; - loadedUrls: string[]; - sourceMap?: RawSourceMap; - }; -} -interface RenderError { - warnings: SerializableWarningMessage[] | undefined; - error: { - message: string; - stack?: string; - span?: Omit & { - url?: string; - }; - sassMessage?: string; - sassStack?: string; - }; -} -export default function renderSassStylesheet(request: RenderRequestMessage): Promise; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/worker.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/worker.js deleted file mode 100755 index 2247553..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/sass/worker.js +++ /dev/null @@ -1,201 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = renderSassStylesheet; -const remapping_1 = __importDefault(require("@ampproject/remapping")); -const node_path_1 = require("node:path"); -const node_url_1 = require("node:url"); -const node_worker_threads_1 = require("node:worker_threads"); -const sass_1 = require("sass"); -const rebasing_importer_1 = require("./rebasing-importer"); -async function renderSassStylesheet(request) { - const { importerChannel, hasLogger, source, options, rebase } = request; - const entryDirectory = (0, node_path_1.dirname)(options.url); - let warnings; - try { - const directoryCache = new Map(); - const rebaseSourceMaps = options.sourceMap ? new Map() : undefined; - if (importerChannel) { - // When a custom importer function is present, the importer request must be proxied - // back to the main thread where it can be executed. - // This process must be synchronous from the perspective of dart-sass. The `Atomics` - // functions combined with the shared memory `importSignal` and the Node.js - // `receiveMessageOnPort` function are used to ensure synchronous behavior. - const proxyImporter = { - findFileUrl: (url, { fromImport, containingUrl }) => { - Atomics.store(importerChannel.signal, 0, 0); - importerChannel.port.postMessage({ - url, - options: { - fromImport, - containingUrl: containingUrl ? (0, node_url_1.fileURLToPath)(containingUrl) : null, - }, - }); - // Wait for the main thread to set the signal to 1 and notify, which tells - // us that a message can be received on the port. - // If the main thread is fast, the signal will already be set to 1, and no - // sleep/notify is necessary. - // However, there can be a race condition here: - // - the main thread sets the signal to 1, but does not get to the notify instruction yet - // - the worker does not pause because the signal is set to 1 - // - the worker very soon enters this method again - // - this method sets the signal to 0 and sends the message - // - the signal is 0 and so the `Atomics.wait` call blocks - // - only now the main thread runs the `notify` from the first invocation, so the - // worker continues. - // - but there is no message yet in the port, because the thread should not have been - // waken up yet. - // To combat this, wait for a non-0 value _twice_. - // Almost every time, this immediately continues with "not-equal", because - // the signal is still set to 1, except during the race condition, when the second - // wait will wait for the correct notify. - Atomics.wait(importerChannel.signal, 0, 0); - Atomics.wait(importerChannel.signal, 0, 0); - const result = (0, node_worker_threads_1.receiveMessageOnPort)(importerChannel.port)?.message; - return result ? (0, node_url_1.pathToFileURL)(result) : null; - }, - }; - options.importers = [ - rebase - ? (0, rebasing_importer_1.sassBindWorkaround)(new rebasing_importer_1.ModuleUrlRebasingImporter(entryDirectory, directoryCache, rebaseSourceMaps, proxyImporter.findFileUrl)) - : proxyImporter, - ]; - } - if (rebase && options.loadPaths?.length) { - options.importers ??= []; - options.importers.push((0, rebasing_importer_1.sassBindWorkaround)(new rebasing_importer_1.LoadPathsUrlRebasingImporter(entryDirectory, directoryCache, rebaseSourceMaps, options.loadPaths))); - options.loadPaths = undefined; - } - let relativeImporter; - if (rebase) { - relativeImporter = (0, rebasing_importer_1.sassBindWorkaround)(new rebasing_importer_1.RelativeUrlRebasingImporter(entryDirectory, directoryCache, rebaseSourceMaps)); - } - // The synchronous Sass render function can be up to two times faster than the async variant - const result = (0, sass_1.compileString)(source, { - ...options, - // URL is not serializable so to convert to string in the parent and back to URL here. - url: (0, node_url_1.pathToFileURL)(options.url), - // The `importer` option (singular) handles relative imports - importer: relativeImporter, - logger: hasLogger - ? { - warn(message, warnOptions) { - warnings ??= []; - warnings.push({ - ...warnOptions, - message, - span: warnOptions.span && convertSourceSpan(warnOptions.span), - ...convertDeprecation(warnOptions.deprecation, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - warnOptions.deprecationType), - }); - }, - } - : undefined, - }); - if (result.sourceMap && rebaseSourceMaps?.size) { - // Merge the intermediate rebasing source maps into the final Sass generated source map. - // Casting is required due to small but compatible differences in typings between the packages. - result.sourceMap = (0, remapping_1.default)(result.sourceMap, - // To prevent an infinite lookup loop, skip getting the source when the rebasing source map - // is referencing its original self. - (file, context) => (file !== context.importer ? rebaseSourceMaps.get(file) : null)); - } - return { - warnings, - result: { - ...result, - sourceMap: result.sourceMap, - // URL is not serializable so to convert to string here and back to URL in the parent. - loadedUrls: result.loadedUrls.map((p) => (0, node_url_1.fileURLToPath)(p)), - }, - }; - } - catch (error) { - // Needed because V8 will only serialize the message and stack properties of an Error instance. - if (error instanceof sass_1.Exception) { - const { span, message, stack, sassMessage, sassStack } = error; - return { - warnings, - error: { - span: convertSourceSpan(span), - message, - stack, - sassMessage, - sassStack, - }, - }; - } - else if (error instanceof Error) { - const { message, stack } = error; - return { warnings, error: { message, stack } }; - } - else { - return { - warnings, - error: { message: 'An unknown error has occurred.' }, - }; - } - } -} -/** - * Converts a Sass SourceSpan object into a serializable form. - * The SourceSpan object contains a URL property which must be converted into a string. - * Also, most of the interface's properties are get accessors and are not automatically - * serialized when sent back from the worker. - * - * @param span The Sass SourceSpan object to convert. - * @returns A serializable form of the SourceSpan object. - */ -function convertSourceSpan(span) { - return { - text: span.text, - context: span.context, - end: { - column: span.end.column, - offset: span.end.offset, - line: span.end.line, - }, - start: { - column: span.start.column, - offset: span.start.offset, - line: span.start.line, - }, - url: span.url ? (0, node_url_1.fileURLToPath)(span.url) : undefined, - }; -} -function convertDeprecation(deprecation, deprecationType) { - if (!deprecation || !deprecationType) { - return { deprecation: false }; - } - const { obsoleteIn, deprecatedIn, ...rest } = deprecationType; - return { - deprecation: true, - deprecationType: { - ...rest, - obsoleteIn: obsoleteIn - ? { - major: obsoleteIn.major, - minor: obsoleteIn.minor, - patch: obsoleteIn.patch, - } - : null, - deprecatedIn: deprecatedIn - ? { - major: deprecatedIn.major, - minor: deprecatedIn.minor, - patch: deprecatedIn.patch, - } - : null, - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/assets-middleware.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/assets-middleware.d.ts deleted file mode 100755 index 40d5e46..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/assets-middleware.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Connect, ViteDevServer } from 'vite'; -import { AngularMemoryOutputFiles, AngularOutputAssets } from '../utils'; -export interface ComponentStyleRecord { - rawContent: Uint8Array; - used?: Set; - reload?: boolean; -} -export declare function createAngularAssetsMiddleware(server: ViteDevServer, assets: AngularOutputAssets, outputFiles: AngularMemoryOutputFiles, componentStyles: Map, encapsulateStyle: (style: Uint8Array, componentId: string) => string): Connect.NextHandleFunction; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/assets-middleware.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/assets-middleware.js deleted file mode 100755 index d5a8144..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/assets-middleware.js +++ /dev/null @@ -1,173 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularAssetsMiddleware = createAngularAssetsMiddleware; -const mrmime_1 = require("mrmime"); -const node_crypto_1 = require("node:crypto"); -const node_fs_1 = require("node:fs"); -const node_path_1 = require("node:path"); -const utils_1 = require("../utils"); -const CSS_PREPROCESSOR_REGEXP = /\.(?:s[ac]ss|less|css)$/; -const JS_TS_REGEXP = /\.[cm]?[tj]sx?$/; -function createAngularAssetsMiddleware(server, assets, outputFiles, componentStyles, encapsulateStyle) { - return function angularAssetsMiddleware(req, res, next) { - if (req.url === undefined || res.writableEnded) { - return; - } - // Parse the incoming request. - // The base of the URL is unused but required to parse the URL. - const pathname = (0, utils_1.pathnameWithoutBasePath)(req.url, server.config.base); - const extension = (0, node_path_1.extname)(pathname); - const pathnameHasTrailingSlash = pathname[pathname.length - 1] === '/'; - // Rewrite all build assets to a vite raw fs URL - const asset = assets.get(pathname); - if (asset) { - // This is a workaround to serve CSS, JS and TS files without Vite transformations. - if (JS_TS_REGEXP.test(extension) || CSS_PREPROCESSOR_REGEXP.test(extension)) { - const contents = (0, node_fs_1.readFileSync)(asset.source); - const etag = `W/${(0, node_crypto_1.createHash)('sha256').update(contents).digest('hex')}`; - if (checkAndHandleEtag(req, res, etag)) { - return; - } - const mimeType = (0, mrmime_1.lookup)(extension); - if (mimeType) { - res.setHeader('Content-Type', mimeType); - } - res.setHeader('ETag', etag); - res.setHeader('Cache-Control', 'no-cache'); - res.end(contents); - } - else { - // The encoding needs to match what happens in the vite static middleware. - // ref: https://github.com/vitejs/vite/blob/d4f13bd81468961c8c926438e815ab6b1c82735e/packages/vite/src/node/server/middlewares/static.ts#L163 - req.url = `${server.config.base}@fs/${encodeURI(asset.source)}`; - next(); - } - return; - } - // HTML fallbacking - // This matches what happens in the vite html fallback middleware. - // ref: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/middlewares/htmlFallback.ts#L9 - const htmlAssetSourcePath = pathnameHasTrailingSlash - ? // Trailing slash check for `index.html`. - assets.get(pathname + 'index.html') - : // Non-trailing slash check for fallback `.html` - assets.get(pathname + '.html'); - if (htmlAssetSourcePath) { - req.url = `${server.config.base}@fs/${encodeURI(htmlAssetSourcePath.source)}`; - next(); - return; - } - // Support HTTP HEAD requests for the virtual output files from the Angular build - if (req.method === 'HEAD' && outputFiles.get(pathname)?.servable) { - // While a GET will also generate content, the rest of the response is equivalent - req.method = 'GET'; - } - // Resource files are handled directly. - // Global stylesheets (CSS files) are currently considered resources to workaround - // dev server sourcemap issues with stylesheets. - if (extension !== '.js' && extension !== '.html') { - const outputFile = outputFiles.get(pathname); - if (outputFile?.servable) { - let data = outputFile.contents; - const componentStyle = componentStyles.get(pathname); - if (componentStyle) { - // Inject component ID for view encapsulation if requested - const searchParams = new URL(req.url, 'http://localhost').searchParams; - const componentId = searchParams.get('ngcomp'); - if (componentId !== null) { - // Track if the component uses ShadowDOM encapsulation (3 = ViewEncapsulation.ShadowDom) - // Shadow DOM components currently require a full reload. - // Vite's CSS hot replacement does not support shadow root searching. - if (searchParams.get('e') === '3') { - componentStyle.reload = true; - } - // Record the component style usage for HMR updates - if (componentStyle.used === undefined) { - componentStyle.used = new Set([componentId]); - } - else { - componentStyle.used.add(componentId); - } - const etag = `W/"${outputFile.contents.byteLength}-${outputFile.hash}-${componentId}"`; - if (checkAndHandleEtag(req, res, etag)) { - return; - } - // Shim the stylesheet if a component ID is provided - if (componentId.length > 0) { - // Validate component ID - if (!/^[_.\-\p{Letter}\d]+-c\d+$/u.test(componentId)) { - const message = 'Invalid component stylesheet ID request: ' + componentId; - // eslint-disable-next-line no-console - console.error(message); - res.statusCode = 400; - res.end(message); - return; - } - data = encapsulateStyle(data, componentId); - } - res.setHeader('Content-Type', 'text/css'); - res.setHeader('Cache-Control', 'no-cache'); - res.setHeader('ETag', etag); - res.end(data); - return; - } - } - const etag = `W/"${outputFile.contents.byteLength}-${outputFile.hash}"`; - if (checkAndHandleEtag(req, res, etag)) { - return; - } - const mimeType = (0, mrmime_1.lookup)(extension); - if (mimeType) { - res.setHeader('Content-Type', mimeType); - } - res.setHeader('Cache-Control', 'no-cache'); - res.setHeader('ETag', etag); - res.end(data); - return; - } - } - // If the path has no trailing slash and it matches a servable directory redirect to the same path with slash. - // This matches the default express static behaviour. - // See: https://github.com/expressjs/serve-static/blob/89fc94567fae632718a2157206c52654680e9d01/index.js#L182 - if (!pathnameHasTrailingSlash) { - for (const assetPath of assets.keys()) { - if (pathname === assetPath.substring(0, assetPath.lastIndexOf('/'))) { - const { pathname, search, hash } = new URL(req.url, 'http://localhost'); - const location = [pathname, '/', search, hash].join(''); - res.statusCode = 301; - res.setHeader('Content-Type', 'text/html'); - res.setHeader('Location', location); - res.end(` - - - - - Redirecting - - -
Redirecting to ${location}
- - - `); - return; - } - } - } - next(); - }; -} -function checkAndHandleEtag(req, res, etag) { - if (req.headers['if-none-match'] === etag) { - res.statusCode = 304; - res.end(); - return true; - } - return false; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/chrome-devtools-middleware.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/chrome-devtools-middleware.d.ts deleted file mode 100755 index 1d2034d..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/chrome-devtools-middleware.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Connect } from 'vite'; -export declare function createChromeDevtoolsMiddleware(cacheDir: string, projectRoot: string): Connect.NextHandleFunction; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/chrome-devtools-middleware.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/chrome-devtools-middleware.js deleted file mode 100755 index 3798f75..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/chrome-devtools-middleware.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createChromeDevtoolsMiddleware = createChromeDevtoolsMiddleware; -const node_assert_1 = __importDefault(require("node:assert")); -const node_crypto_1 = require("node:crypto"); -const node_fs_1 = require("node:fs"); -const node_path_1 = require("node:path"); -const CHROME_DEVTOOLS_ROUTE = '/.well-known/appspecific/com.chrome.devtools.json'; -function createChromeDevtoolsMiddleware(cacheDir, projectRoot) { - let devtoolsConfig; - const devtoolsConfigPath = (0, node_path_1.join)(cacheDir, 'com.chrome.devtools.json'); - return function chromeDevtoolsMiddleware(req, res, next) { - if (req.url !== CHROME_DEVTOOLS_ROUTE) { - next(); - return; - } - if (!devtoolsConfig) { - // We store the UUID and re-use it to ensure Chrome does not repeatedly ask for permissions when restarting the dev server. - try { - devtoolsConfig = (0, node_fs_1.readFileSync)(devtoolsConfigPath, 'utf-8'); - const devtoolsConfigJson = JSON.parse(devtoolsConfig); - node_assert_1.default.equal(projectRoot, devtoolsConfigJson?.workspace.root); - } - catch { - const devtoolsConfigJson = { - workspace: { - root: projectRoot, - uuid: (0, node_crypto_1.randomUUID)(), - }, - }; - devtoolsConfig = JSON.stringify(devtoolsConfigJson, undefined, 2); - try { - (0, node_fs_1.mkdirSync)(cacheDir, { recursive: true }); - (0, node_fs_1.writeFileSync)(devtoolsConfigPath, devtoolsConfig); - } - catch { } - } - } - res.setHeader('Content-Type', 'application/json'); - res.end(devtoolsConfig); - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/component-middleware.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/component-middleware.d.ts deleted file mode 100755 index 0cafa7e..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/component-middleware.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Connect, ViteDevServer } from 'vite'; -export declare function createAngularComponentMiddleware(server: ViteDevServer, templateUpdates: ReadonlyMap): Connect.NextHandleFunction; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/component-middleware.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/component-middleware.js deleted file mode 100755 index f086fde..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/component-middleware.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularComponentMiddleware = createAngularComponentMiddleware; -const utils_1 = require("../utils"); -const ANGULAR_COMPONENT_PREFIX = '/@ng/component'; -function createAngularComponentMiddleware(server, templateUpdates) { - return function angularComponentMiddleware(req, res, next) { - if (req.url === undefined || res.writableEnded) { - return; - } - const pathname = (0, utils_1.pathnameWithoutBasePath)(req.url, server.config.base); - if (!pathname.includes(ANGULAR_COMPONENT_PREFIX)) { - next(); - return; - } - const requestUrl = new URL(req.url, 'http://localhost'); - const componentId = requestUrl.searchParams.get('c'); - if (!componentId) { - res.statusCode = 400; - res.end(); - return; - } - const updateCode = templateUpdates.get(encodeURIComponent(componentId)) ?? ''; - res.setHeader('Content-Type', 'text/javascript'); - res.setHeader('Cache-Control', 'no-cache'); - res.end(updateCode); - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/headers-middleware.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/headers-middleware.d.ts deleted file mode 100755 index 2835a9a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/headers-middleware.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Connect, ViteDevServer } from 'vite'; -/** - * Creates a middleware for adding custom headers. - * - * This middleware is responsible for setting HTTP headers as configured in the Vite server options. - * If headers are defined in the server configuration, they are applied to the server response. - * - * @param server - The instance of `ViteDevServer` containing the configuration, including custom headers. - * @returns A middleware function that processes the incoming request, sets headers if available, - * and passes control to the next middleware in the chain. - */ -export declare function createAngularHeadersMiddleware(server: ViteDevServer): Connect.NextHandleFunction; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/headers-middleware.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/headers-middleware.js deleted file mode 100755 index 544d257..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/headers-middleware.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularHeadersMiddleware = createAngularHeadersMiddleware; -/** - * Creates a middleware for adding custom headers. - * - * This middleware is responsible for setting HTTP headers as configured in the Vite server options. - * If headers are defined in the server configuration, they are applied to the server response. - * - * @param server - The instance of `ViteDevServer` containing the configuration, including custom headers. - * @returns A middleware function that processes the incoming request, sets headers if available, - * and passes control to the next middleware in the chain. - */ -function createAngularHeadersMiddleware(server) { - return function angularHeadersMiddleware(_req, res, next) { - const headers = server.config.server.headers; - if (!headers) { - return next(); - } - for (const [name, value] of Object.entries(headers)) { - if (value !== undefined) { - res.setHeader(name, value); - } - } - next(); - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/html-fallback-middleware.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/html-fallback-middleware.d.ts deleted file mode 100755 index 6e04ea3..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/html-fallback-middleware.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { ServerResponse } from 'node:http'; -import type { Connect } from 'vite'; -export declare function angularHtmlFallbackMiddleware(req: Connect.IncomingMessage, _res: ServerResponse, next: Connect.NextFunction): void; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/html-fallback-middleware.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/html-fallback-middleware.js deleted file mode 100755 index a2225bb..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/html-fallback-middleware.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.angularHtmlFallbackMiddleware = angularHtmlFallbackMiddleware; -const utils_1 = require("../utils"); -const ALLOWED_FALLBACK_METHODS = Object.freeze(['GET', 'HEAD']); -function angularHtmlFallbackMiddleware(req, _res, next) { - // Similar to how it is handled in vite - // https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/middlewares/htmlFallback.ts#L15C19-L15C45 - if (!req.method || !ALLOWED_FALLBACK_METHODS.includes(req.method)) { - // No fallback for unsupported request methods - next(); - return; - } - if (req.url) { - const mimeType = (0, utils_1.lookupMimeTypeFromRequest)(req.url); - if ((mimeType === 'text/html' || mimeType === 'application/xhtml+xml') && - !/^\/index\.(?:csr\.)?html/.test(req.url)) { - // eslint-disable-next-line no-console - console.warn(`Request for HTML file "${req.url}" was received but no asset found. Asset may be missing from build.`); - } - else if (mimeType) { - // No fallback for request of asset-like files - next(); - return; - } - } - if (!req.headers.accept || - req.headers.accept.includes('text/html') || - req.headers.accept.includes('text/*') || - req.headers.accept.includes('*/*')) { - req.url = '/index.html'; - } - next(); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index-html-middleware.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index-html-middleware.d.ts deleted file mode 100755 index 5b21e65..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index-html-middleware.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Connect, ViteDevServer } from 'vite'; -import { AngularMemoryOutputFiles } from '../utils'; -export declare function createAngularIndexHtmlMiddleware(server: ViteDevServer, outputFiles: AngularMemoryOutputFiles, resetComponentUpdates: () => void, indexHtmlTransformer: ((content: string) => Promise) | undefined): Connect.NextHandleFunction; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index-html-middleware.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index-html-middleware.js deleted file mode 100755 index 7e5914b..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index-html-middleware.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularIndexHtmlMiddleware = createAngularIndexHtmlMiddleware; -const node_path_1 = require("node:path"); -const utils_1 = require("../utils"); -function createAngularIndexHtmlMiddleware(server, outputFiles, resetComponentUpdates, indexHtmlTransformer) { - return function angularIndexHtmlMiddleware(req, res, next) { - if (!req.url) { - next(); - return; - } - // Parse the incoming request. - // The base of the URL is unused but required to parse the URL. - const pathname = (0, utils_1.pathnameWithoutBasePath)(req.url, server.config.base); - const extension = (0, node_path_1.extname)(pathname); - if (extension !== '.html') { - next(); - return; - } - const rawHtml = outputFiles.get(pathname)?.contents; - if (!rawHtml) { - next(); - return; - } - // A request for the index indicates a full page reload request. - resetComponentUpdates(); - server - .transformIndexHtml(req.url, Buffer.from(rawHtml).toString('utf-8')) - .then(async (processedHtml) => { - if (indexHtmlTransformer) { - processedHtml = await indexHtmlTransformer(processedHtml); - } - res.setHeader('Content-Type', 'text/html'); - res.setHeader('Cache-Control', 'no-cache'); - res.end(processedHtml); - }) - .catch((error) => next(error)); - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index.d.ts deleted file mode 100755 index e37bdc5..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export { type ComponentStyleRecord, createAngularAssetsMiddleware } from './assets-middleware'; -export { angularHtmlFallbackMiddleware } from './html-fallback-middleware'; -export { createAngularIndexHtmlMiddleware } from './index-html-middleware'; -export { createAngularSsrExternalMiddleware, createAngularSsrInternalMiddleware, } from './ssr-middleware'; -export { createAngularHeadersMiddleware } from './headers-middleware'; -export { createAngularComponentMiddleware } from './component-middleware'; -export { createChromeDevtoolsMiddleware } from './chrome-devtools-middleware'; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index.js deleted file mode 100755 index b242858..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/index.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createChromeDevtoolsMiddleware = exports.createAngularComponentMiddleware = exports.createAngularHeadersMiddleware = exports.createAngularSsrInternalMiddleware = exports.createAngularSsrExternalMiddleware = exports.createAngularIndexHtmlMiddleware = exports.angularHtmlFallbackMiddleware = exports.createAngularAssetsMiddleware = void 0; -var assets_middleware_1 = require("./assets-middleware"); -Object.defineProperty(exports, "createAngularAssetsMiddleware", { enumerable: true, get: function () { return assets_middleware_1.createAngularAssetsMiddleware; } }); -var html_fallback_middleware_1 = require("./html-fallback-middleware"); -Object.defineProperty(exports, "angularHtmlFallbackMiddleware", { enumerable: true, get: function () { return html_fallback_middleware_1.angularHtmlFallbackMiddleware; } }); -var index_html_middleware_1 = require("./index-html-middleware"); -Object.defineProperty(exports, "createAngularIndexHtmlMiddleware", { enumerable: true, get: function () { return index_html_middleware_1.createAngularIndexHtmlMiddleware; } }); -var ssr_middleware_1 = require("./ssr-middleware"); -Object.defineProperty(exports, "createAngularSsrExternalMiddleware", { enumerable: true, get: function () { return ssr_middleware_1.createAngularSsrExternalMiddleware; } }); -Object.defineProperty(exports, "createAngularSsrInternalMiddleware", { enumerable: true, get: function () { return ssr_middleware_1.createAngularSsrInternalMiddleware; } }); -var headers_middleware_1 = require("./headers-middleware"); -Object.defineProperty(exports, "createAngularHeadersMiddleware", { enumerable: true, get: function () { return headers_middleware_1.createAngularHeadersMiddleware; } }); -var component_middleware_1 = require("./component-middleware"); -Object.defineProperty(exports, "createAngularComponentMiddleware", { enumerable: true, get: function () { return component_middleware_1.createAngularComponentMiddleware; } }); -var chrome_devtools_middleware_1 = require("./chrome-devtools-middleware"); -Object.defineProperty(exports, "createChromeDevtoolsMiddleware", { enumerable: true, get: function () { return chrome_devtools_middleware_1.createChromeDevtoolsMiddleware; } }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/ssr-middleware.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/ssr-middleware.d.ts deleted file mode 100755 index 0797d19..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/ssr-middleware.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Connect, ViteDevServer } from 'vite'; -export declare function createAngularSsrInternalMiddleware(server: ViteDevServer, indexHtmlTransformer?: (content: string) => Promise): Connect.NextHandleFunction; -export declare function createAngularSsrExternalMiddleware(server: ViteDevServer, indexHtmlTransformer?: (content: string) => Promise): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/ssr-middleware.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/ssr-middleware.js deleted file mode 100755 index 270dfc6..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/middlewares/ssr-middleware.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularSsrInternalMiddleware = createAngularSsrInternalMiddleware; -exports.createAngularSsrExternalMiddleware = createAngularSsrExternalMiddleware; -const load_esm_1 = require("../../../utils/load-esm"); -const utils_1 = require("../../../utils/server-rendering/utils"); -function createAngularSsrInternalMiddleware(server, indexHtmlTransformer) { - let cachedAngularServerApp; - return function angularSsrMiddleware(req, res, next) { - if (req.url === undefined) { - return next(); - } - (async () => { - // Load the compiler because `@angular/ssr/node` depends on `@angular/` packages, - // which must be processed by the runtime linker, even if they are not used. - await (0, load_esm_1.loadEsmModule)('@angular/compiler'); - const { writeResponseToNodeResponse, createWebRequestFromNodeRequest } = await (0, load_esm_1.loadEsmModule)('@angular/ssr/node'); - const { ɵgetOrCreateAngularServerApp } = (await server.ssrLoadModule('/main.server.mjs')); - // `ɵgetOrCreateAngularServerApp` can be undefined right after an error. - // See: https://github.com/angular/angular-cli/issues/29907 - if (!ɵgetOrCreateAngularServerApp) { - return next(); - } - const angularServerApp = ɵgetOrCreateAngularServerApp({ - allowStaticRouteRender: true, - }); - // Only Add the transform hook only if it's a different instance. - if (cachedAngularServerApp !== angularServerApp) { - angularServerApp.hooks.on('html:transform:pre', async ({ html, url }) => { - const processedHtml = await server.transformIndexHtml(url.pathname, html); - return indexHtmlTransformer?.(processedHtml) ?? processedHtml; - }); - cachedAngularServerApp = angularServerApp; - } - const webReq = new Request(createWebRequestFromNodeRequest(req), { - signal: AbortSignal.timeout(30_000), - }); - const webRes = await angularServerApp.handle(webReq); - if (!webRes) { - return next(); - } - return writeResponseToNodeResponse(webRes, res); - })().catch(next); - }; -} -async function createAngularSsrExternalMiddleware(server, indexHtmlTransformer) { - let fallbackWarningShown = false; - let cachedAngularAppEngine; - let angularSsrInternalMiddleware; - // Load the compiler because `@angular/ssr/node` depends on `@angular/` packages, - // which must be processed by the runtime linker, even if they are not used. - await (0, load_esm_1.loadEsmModule)('@angular/compiler'); - const { createWebRequestFromNodeRequest, writeResponseToNodeResponse } = await (0, load_esm_1.loadEsmModule)('@angular/ssr/node'); - return function angularSsrExternalMiddleware(req, res, next) { - (async () => { - const { reqHandler, AngularAppEngine } = (await server.ssrLoadModule('./server.mjs')); - if (!(0, utils_1.isSsrNodeRequestHandler)(reqHandler) && !(0, utils_1.isSsrRequestHandler)(reqHandler)) { - if (!fallbackWarningShown) { - // eslint-disable-next-line no-console - console.warn(`The 'reqHandler' export in 'server.ts' is either undefined or does not provide a recognized request handler. ` + - 'Using the internal SSR middleware instead.'); - fallbackWarningShown = true; - } - angularSsrInternalMiddleware ??= createAngularSsrInternalMiddleware(server, indexHtmlTransformer); - angularSsrInternalMiddleware(req, res, next); - return; - } - if (cachedAngularAppEngine !== AngularAppEngine) { - AngularAppEngine.ɵallowStaticRouteRender = true; - AngularAppEngine.ɵhooks.on('html:transform:pre', async ({ html, url }) => { - const processedHtml = await server.transformIndexHtml(url.pathname, html); - return indexHtmlTransformer?.(processedHtml) ?? processedHtml; - }); - cachedAngularAppEngine = AngularAppEngine; - } - // Forward the request to the middleware in server.ts - if ((0, utils_1.isSsrNodeRequestHandler)(reqHandler)) { - await reqHandler(req, res, next); - } - else { - const webRes = await reqHandler(createWebRequestFromNodeRequest(req)); - if (!webRes) { - next(); - return; - } - await writeResponseToNodeResponse(webRes, res); - } - })().catch(next); - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/angular-memory-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/angular-memory-plugin.d.ts deleted file mode 100755 index a1c6932..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/angular-memory-plugin.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'vite'; -import { AngularMemoryOutputFiles } from '../utils'; -interface AngularMemoryPluginOptions { - virtualProjectRoot: string; - outputFiles: AngularMemoryOutputFiles; - templateUpdates?: ReadonlyMap; - external?: string[]; - disableViteTransport?: boolean; -} -export declare function createAngularMemoryPlugin(options: AngularMemoryPluginOptions): Promise; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/angular-memory-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/angular-memory-plugin.js deleted file mode 100755 index 18732e0..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/angular-memory-plugin.js +++ /dev/null @@ -1,116 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularMemoryPlugin = createAngularMemoryPlugin; -const node_assert_1 = __importDefault(require("node:assert")); -const promises_1 = require("node:fs/promises"); -const node_path_1 = require("node:path"); -const node_url_1 = require("node:url"); -const load_esm_1 = require("../../../utils/load-esm"); -const ANGULAR_PREFIX = '/@ng/'; -const VITE_FS_PREFIX = '/@fs/'; -const FILE_PROTOCOL = 'file:'; -async function createAngularMemoryPlugin(options) { - const { virtualProjectRoot, outputFiles, external } = options; - const { normalizePath } = await (0, load_esm_1.loadEsmModule)('vite'); - return { - name: 'vite:angular-memory', - // Ensures plugin hooks run before built-in Vite hooks - enforce: 'pre', - async resolveId(source, importer, { ssr }) { - if (source.startsWith(VITE_FS_PREFIX)) { - return; - } - // For SSR with component HMR, pass through as a virtual module - if (ssr && source.startsWith(FILE_PROTOCOL) && source.includes(ANGULAR_PREFIX)) { - // Vite will resolve these these files example: - // `file:///@ng/component?c=src%2Fapp%2Fapp.component.ts%40AppComponent&t=1737017253850` - const sourcePath = (0, node_url_1.fileURLToPath)(source); - const sourceWithoutRoot = normalizePath('/' + (0, node_path_1.relative)(virtualProjectRoot, sourcePath)); - if (sourceWithoutRoot.startsWith(ANGULAR_PREFIX)) { - const [, query] = source.split('?', 2); - return `\0${sourceWithoutRoot}?${query}`; - } - } - // Prevent vite from resolving an explicit external dependency (`externalDependencies` option) - if (external?.includes(source)) { - // This is still not ideal since Vite will still transform the import specifier to - // `/@id/${source}` but is currently closer to a raw external than a resolved file path. - return source; - } - if (importer && source[0] === '.') { - const normalizedImporter = normalizePath(importer); - if (normalizedImporter.startsWith(virtualProjectRoot)) { - // Remove query if present - const [importerFile] = normalizedImporter.split('?', 1); - source = '/' + (0, node_path_1.join)((0, node_path_1.dirname)((0, node_path_1.relative)(virtualProjectRoot, importerFile)), source); - } - } - const [file] = source.split('?', 1); - if (outputFiles.has(normalizePath(file))) { - return (0, node_path_1.join)(virtualProjectRoot, source); - } - }, - load(id, loadOptions) { - // For SSR component updates, return the component update module or empty if none - if (loadOptions?.ssr && id.startsWith(`\0${ANGULAR_PREFIX}`)) { - // Extract component identifier (first character is rollup virtual module null) - const requestUrl = new URL(id.slice(1), 'http://localhost'); - const componentId = requestUrl.searchParams.get('c'); - return (componentId && options.templateUpdates?.get(encodeURIComponent(componentId))) ?? ''; - } - const [file] = id.split('?', 1); - const relativeFile = '/' + normalizePath((0, node_path_1.relative)(virtualProjectRoot, file)); - const codeContents = outputFiles.get(relativeFile)?.contents; - if (codeContents === undefined) { - if (relativeFile.endsWith('/node_modules/vite/dist/client/client.mjs')) { - return loadViteClientCode(file, options.disableViteTransport); - } - return undefined; - } - const code = Buffer.from(codeContents).toString('utf-8'); - const mapContents = outputFiles.get(relativeFile + '.map')?.contents; - return { - // Remove source map URL comments from the code if a sourcemap is present. - // Vite will inline and add an additional sourcemap URL for the sourcemap. - code: mapContents ? code.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, '') : code, - map: mapContents && Buffer.from(mapContents).toString('utf-8'), - }; - }, - }; -} -/** - * Reads the resolved Vite client code from disk and updates the content to remove - * an unactionable suggestion to update the Vite configuration file to disable the - * error overlay. The Vite configuration file is not present when used in the Angular - * CLI. - * @param file The absolute path to the Vite client code. - * @returns - */ -async function loadViteClientCode(file, disableViteTransport = false) { - const originalContents = await (0, promises_1.readFile)(file, 'utf-8'); - let updatedContents = originalContents.replace('"You can also disable this overlay by setting ", ' + - 'h("code", { part: "config-option-name" }, "server.hmr.overlay"), ' + - '" to ", ' + - 'h("code", { part: "config-option-value" }, "false"), ' + - '" in ", ' + - 'h("code", { part: "config-file-name" }, hmrConfigName), ' + - '"."', ''); - (0, node_assert_1.default)(originalContents !== updatedContents, 'Failed to update Vite client error overlay text.'); - if (disableViteTransport) { - const previousUpdatedContents = updatedContents; - updatedContents = updatedContents.replace('transport.connect(createHMRHandler(handleMessage));', ''); - (0, node_assert_1.default)(previousUpdatedContents !== updatedContents, 'Failed to update Vite client WebSocket disable.'); - updatedContents = updatedContents.replace('console.debug("[vite] connecting...")', ''); - } - return updatedContents; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/id-prefix-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/id-prefix-plugin.d.ts deleted file mode 100755 index 1228152..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/id-prefix-plugin.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'vite'; -export declare function createRemoveIdPrefixPlugin(externals: string[]): Plugin; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/id-prefix-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/id-prefix-plugin.js deleted file mode 100755 index 5ef5357..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/id-prefix-plugin.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createRemoveIdPrefixPlugin = createRemoveIdPrefixPlugin; -// NOTE: the implementation for this Vite plugin is roughly based on: -// https://github.com/MilanKovacic/vite-plugin-externalize-dependencies -const VITE_ID_PREFIX = '@id/'; -const escapeRegexSpecialChars = (inputString) => { - return inputString.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string -}; -function createRemoveIdPrefixPlugin(externals) { - return { - name: 'angular-plugin-remove-id-prefix', - apply: 'serve', - configResolved: (resolvedConfig) => { - // don't do anything when the list of externals is empty - if (externals.length === 0) { - return; - } - const escapedExternals = externals.map((e) => escapeRegexSpecialChars(e) + '(?:/.+)?'); - const prefixedExternalRegex = new RegExp(`${resolvedConfig.base}${VITE_ID_PREFIX}(${escapedExternals.join('|')})`, 'g'); - // @ts-expect-error: Property 'push' does not exist on type 'readonly Plugin[]' - // Reasoning: - // since the /@id/ prefix is added by Vite's import-analysis plugin, - // we must add our actual plugin dynamically, to ensure that it will run - // AFTER the import-analysis. - resolvedConfig.plugins.push({ - name: 'angular-plugin-remove-id-prefix-transform', - transform: (code) => { - // don't do anything when code does not contain the Vite prefix - if (!code.includes(VITE_ID_PREFIX)) { - return code; - } - return code.replace(prefixedExternalRegex, (_, externalName) => externalName); - }, - }); - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/index.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/index.d.ts deleted file mode 100755 index 2c15782..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export { createAngularMemoryPlugin } from './angular-memory-plugin'; -export { createRemoveIdPrefixPlugin } from './id-prefix-plugin'; -export { createAngularSetupMiddlewaresPlugin, ServerSsrMode } from './setup-middlewares-plugin'; -export { createAngularSsrTransformPlugin } from './ssr-transform-plugin'; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/index.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/index.js deleted file mode 100755 index 3746350..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularSsrTransformPlugin = exports.ServerSsrMode = exports.createAngularSetupMiddlewaresPlugin = exports.createRemoveIdPrefixPlugin = exports.createAngularMemoryPlugin = void 0; -var angular_memory_plugin_1 = require("./angular-memory-plugin"); -Object.defineProperty(exports, "createAngularMemoryPlugin", { enumerable: true, get: function () { return angular_memory_plugin_1.createAngularMemoryPlugin; } }); -var id_prefix_plugin_1 = require("./id-prefix-plugin"); -Object.defineProperty(exports, "createRemoveIdPrefixPlugin", { enumerable: true, get: function () { return id_prefix_plugin_1.createRemoveIdPrefixPlugin; } }); -var setup_middlewares_plugin_1 = require("./setup-middlewares-plugin"); -Object.defineProperty(exports, "createAngularSetupMiddlewaresPlugin", { enumerable: true, get: function () { return setup_middlewares_plugin_1.createAngularSetupMiddlewaresPlugin; } }); -Object.defineProperty(exports, "ServerSsrMode", { enumerable: true, get: function () { return setup_middlewares_plugin_1.ServerSsrMode; } }); -var ssr_transform_plugin_1 = require("./ssr-transform-plugin"); -Object.defineProperty(exports, "createAngularSsrTransformPlugin", { enumerable: true, get: function () { return ssr_transform_plugin_1.createAngularSsrTransformPlugin; } }); diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/setup-middlewares-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/setup-middlewares-plugin.d.ts deleted file mode 100755 index 98667b5..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/setup-middlewares-plugin.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Connect, Plugin } from 'vite'; -import { ComponentStyleRecord } from '../middlewares'; -import { AngularMemoryOutputFiles, AngularOutputAssets } from '../utils'; -export declare enum ServerSsrMode { - /** - * No SSR - */ - NoSsr = 0, - /** - * Internal server-side rendering (SSR) is handled through the built-in middleware. - * - * In this mode, the SSR process is managed internally by the dev-server's middleware. - * The server automatically renders pages on the server without requiring external - * middleware or additional configuration from the developer. - */ - InternalSsrMiddleware = 1, - /** - * External server-side rendering (SSR) is handled by a custom middleware defined in server.ts. - * - * This mode allows developers to define custom SSR behavior by providing a middleware in the - * `server.ts` file. It gives more flexibility for handling SSR, such as integrating with other - * frameworks or customizing the rendering pipeline. - */ - ExternalSsrMiddleware = 2 -} -interface AngularSetupMiddlewaresPluginOptions { - outputFiles: AngularMemoryOutputFiles; - assets: AngularOutputAssets; - extensionMiddleware?: Connect.NextHandleFunction[]; - indexHtmlTransformer?: (content: string) => Promise; - componentStyles: Map; - templateUpdates: Map; - ssrMode: ServerSsrMode; - resetComponentUpdates: () => void; - projectRoot: string; -} -export declare function createAngularSetupMiddlewaresPlugin(options: AngularSetupMiddlewaresPluginOptions): Plugin; -export {}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/setup-middlewares-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/setup-middlewares-plugin.js deleted file mode 100755 index 72b85bd..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/setup-middlewares-plugin.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ServerSsrMode = void 0; -exports.createAngularSetupMiddlewaresPlugin = createAngularSetupMiddlewaresPlugin; -const load_esm_1 = require("../../../utils/load-esm"); -const middlewares_1 = require("../middlewares"); -var ServerSsrMode; -(function (ServerSsrMode) { - /** - * No SSR - */ - ServerSsrMode[ServerSsrMode["NoSsr"] = 0] = "NoSsr"; - /** - * Internal server-side rendering (SSR) is handled through the built-in middleware. - * - * In this mode, the SSR process is managed internally by the dev-server's middleware. - * The server automatically renders pages on the server without requiring external - * middleware or additional configuration from the developer. - */ - ServerSsrMode[ServerSsrMode["InternalSsrMiddleware"] = 1] = "InternalSsrMiddleware"; - /** - * External server-side rendering (SSR) is handled by a custom middleware defined in server.ts. - * - * This mode allows developers to define custom SSR behavior by providing a middleware in the - * `server.ts` file. It gives more flexibility for handling SSR, such as integrating with other - * frameworks or customizing the rendering pipeline. - */ - ServerSsrMode[ServerSsrMode["ExternalSsrMiddleware"] = 2] = "ExternalSsrMiddleware"; -})(ServerSsrMode || (exports.ServerSsrMode = ServerSsrMode = {})); -async function createEncapsulateStyle() { - const { encapsulateStyle } = await (0, load_esm_1.loadEsmModule)('@angular/compiler'); - const decoder = new TextDecoder('utf-8'); - return (style, componentId) => { - return encapsulateStyle(decoder.decode(style), componentId); - }; -} -function createAngularSetupMiddlewaresPlugin(options) { - return { - name: 'vite:angular-setup-middlewares', - enforce: 'pre', - async configureServer(server) { - const { indexHtmlTransformer, outputFiles, extensionMiddleware, assets, componentStyles, templateUpdates, ssrMode, resetComponentUpdates, } = options; - // Headers, assets and resources get handled first - server.middlewares.use((0, middlewares_1.createAngularHeadersMiddleware)(server)); - server.middlewares.use((0, middlewares_1.createAngularComponentMiddleware)(server, templateUpdates)); - server.middlewares.use((0, middlewares_1.createAngularAssetsMiddleware)(server, assets, outputFiles, componentStyles, await createEncapsulateStyle())); - server.middlewares.use((0, middlewares_1.createChromeDevtoolsMiddleware)(server.config.cacheDir, options.projectRoot)); - extensionMiddleware?.forEach((middleware) => server.middlewares.use(middleware)); - // Returning a function, installs middleware after the main transform middleware but - // before the built-in HTML middleware - // eslint-disable-next-line @typescript-eslint/no-misused-promises - return async () => { - if (ssrMode === ServerSsrMode.ExternalSsrMiddleware) { - server.middlewares.use(await (0, middlewares_1.createAngularSsrExternalMiddleware)(server, indexHtmlTransformer)); - return; - } - if (ssrMode === ServerSsrMode.InternalSsrMiddleware) { - server.middlewares.use((0, middlewares_1.createAngularSsrInternalMiddleware)(server, indexHtmlTransformer)); - } - server.middlewares.use(middlewares_1.angularHtmlFallbackMiddleware); - server.middlewares.use((0, middlewares_1.createAngularIndexHtmlMiddleware)(server, outputFiles, resetComponentUpdates, indexHtmlTransformer)); - }; - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/ssr-transform-plugin.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/ssr-transform-plugin.d.ts deleted file mode 100755 index a1c8867..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/ssr-transform-plugin.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { Plugin } from 'vite'; -export declare function createAngularSsrTransformPlugin(workspaceRoot: string): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/ssr-transform-plugin.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/ssr-transform-plugin.js deleted file mode 100755 index 7322015..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/plugins/ssr-transform-plugin.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAngularSsrTransformPlugin = createAngularSsrTransformPlugin; -const remapping_1 = __importDefault(require("@ampproject/remapping")); -const load_esm_1 = require("../../../utils/load-esm"); -async function createAngularSsrTransformPlugin(workspaceRoot) { - const { normalizePath } = await (0, load_esm_1.loadEsmModule)('vite'); - return { - name: 'vite:angular-ssr-transform', - enforce: 'post', - transform(code, _id, { ssr, inMap } = {}) { - if (!ssr || !inMap) { - return null; - } - const remappedMap = (0, remapping_1.default)([inMap], () => null); - // Set the sourcemap root to the workspace root. This is needed since we set a virtual path as root. - remappedMap.sourceRoot = normalizePath(workspaceRoot) + '/'; - return { - code, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - map: remappedMap, - }; - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/utils.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/utils.d.ts deleted file mode 100755 index 8cedb73..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/utils.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { DepOptimizationConfig } from 'vite'; -import { JavaScriptTransformer } from '../esbuild/javascript-transformer'; -export type AngularMemoryOutputFiles = Map; -export type AngularOutputAssets = Map; -export declare function pathnameWithoutBasePath(url: string, basePath: string): string; -export declare function lookupMimeTypeFromRequest(url: string): string | undefined; -export type EsbuildLoaderOption = Exclude['loader']; -export declare function getDepOptimizationConfig({ disabled, exclude, include, target, zoneless, prebundleTransformer, ssr, loader, thirdPartySourcemaps, define, }: { - disabled: boolean; - exclude: string[]; - include: string[]; - target: string[]; - prebundleTransformer: JavaScriptTransformer; - ssr: boolean; - zoneless: boolean; - loader?: EsbuildLoaderOption; - thirdPartySourcemaps: boolean; - define: Record | undefined; -}): DepOptimizationConfig; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/utils.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/utils.js deleted file mode 100755 index 57d2891..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/tools/vite/utils.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.pathnameWithoutBasePath = pathnameWithoutBasePath; -exports.lookupMimeTypeFromRequest = lookupMimeTypeFromRequest; -exports.getDepOptimizationConfig = getDepOptimizationConfig; -const mrmime_1 = require("mrmime"); -const node_path_1 = require("node:path"); -const utils_1 = require("../esbuild/utils"); -function pathnameWithoutBasePath(url, basePath) { - const parsedUrl = new URL(url, 'http://localhost'); - const pathname = decodeURIComponent(parsedUrl.pathname); - // slice(basePath.length - 1) to retain the trailing slash - return basePath !== '/' && pathname.startsWith(basePath) - ? pathname.slice(basePath.length - 1) - : pathname; -} -function lookupMimeTypeFromRequest(url) { - const extension = (0, node_path_1.extname)(url.split('?')[0]); - if (extension === '.ico') { - return 'image/x-icon'; - } - return extension && (0, mrmime_1.lookup)(extension); -} -function getDepOptimizationConfig({ disabled, exclude, include, target, zoneless, prebundleTransformer, ssr, loader, thirdPartySourcemaps, define = {}, }) { - const plugins = [ - { - name: `angular-vite-optimize-deps${ssr ? '-ssr' : ''}${thirdPartySourcemaps ? '-vendor-sourcemap' : ''}`, - setup(build) { - build.onLoad({ filter: /\.[cm]?js$/ }, async (args) => { - return { - contents: await prebundleTransformer.transformFile(args.path), - loader: 'js', - }; - }); - }, - }, - ]; - return { - // Exclude any explicitly defined dependencies (currently build defined externals) - exclude, - // NB: to disable the deps optimizer, set optimizeDeps.noDiscovery to true and optimizeDeps.include as undefined. - // Include all implict dependencies from the external packages internal option - include: disabled ? undefined : include, - noDiscovery: disabled, - // Add an esbuild plugin to run the Angular linker on dependencies - esbuildOptions: { - // Set esbuild supported targets. - target, - supported: (0, utils_1.getFeatureSupport)(target, zoneless), - plugins, - loader, - define: { - ...define, - 'ngServerMode': `${ssr}`, - }, - resolveExtensions: ['.mjs', '.js', '.cjs'], - }, - }; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/typings.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/typings.d.ts deleted file mode 100755 index a219622..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/typings.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ - -// The `bundled_beasties` causes issues with module mappings in Bazel, -// leading to unexpected behavior with esbuild. Specifically, the problem occurs -// when esbuild resolves to a different module or version than expected, due to -// how Bazel handles module mappings. -// -// This change aims to resolve esbuild types correctly and maintain consistency -// in the Bazel build process. - -declare module 'esbuild' { - export * from 'esbuild-wasm'; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/bundle-calculator.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/bundle-calculator.d.ts deleted file mode 100755 index a0c3d8a..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/bundle-calculator.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import { Budget as BudgetEntry, Type as BudgetType } from '../builders/application/schema'; -export { type BudgetEntry, BudgetType }; -export declare const BYTES_IN_KILOBYTE = 1000; -export interface Threshold { - limit: number; - type: ThresholdType; - severity: ThresholdSeverity; -} -declare enum ThresholdType { - Max = "maximum", - Min = "minimum" -} -export declare enum ThresholdSeverity { - Warning = "warning", - Error = "error" -} -export interface BudgetCalculatorResult { - severity: ThresholdSeverity; - message: string; - label?: string; -} -export interface BudgetChunk { - files?: string[]; - names?: string[]; - initial?: boolean; -} -export interface BudgetAsset { - name: string; - size: number; - componentStyle?: boolean; -} -export interface BudgetStats { - chunks?: BudgetChunk[]; - assets?: BudgetAsset[]; -} -export declare function calculateThresholds(budget: BudgetEntry): IterableIterator; -export declare function checkBudgets(budgets: BudgetEntry[], stats: BudgetStats, checkComponentStyles?: boolean): IterableIterator; -export declare function checkThresholds(thresholds: Iterable, size: number, label?: string): IterableIterator; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/bundle-calculator.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/bundle-calculator.js deleted file mode 100755 index f99ae75..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/bundle-calculator.js +++ /dev/null @@ -1,304 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ThresholdSeverity = exports.BYTES_IN_KILOBYTE = exports.BudgetType = void 0; -exports.calculateThresholds = calculateThresholds; -exports.checkBudgets = checkBudgets; -exports.checkThresholds = checkThresholds; -const schema_1 = require("../builders/application/schema"); -Object.defineProperty(exports, "BudgetType", { enumerable: true, get: function () { return schema_1.Type; } }); -const format_bytes_1 = require("./format-bytes"); -exports.BYTES_IN_KILOBYTE = 1000; -var ThresholdType; -(function (ThresholdType) { - ThresholdType["Max"] = "maximum"; - ThresholdType["Min"] = "minimum"; -})(ThresholdType || (ThresholdType = {})); -var ThresholdSeverity; -(function (ThresholdSeverity) { - ThresholdSeverity["Warning"] = "warning"; - ThresholdSeverity["Error"] = "error"; -})(ThresholdSeverity || (exports.ThresholdSeverity = ThresholdSeverity = {})); -function* calculateThresholds(budget) { - if (budget.maximumWarning) { - yield { - limit: calculateBytes(budget.maximumWarning, budget.baseline, 1), - type: ThresholdType.Max, - severity: ThresholdSeverity.Warning, - }; - } - if (budget.maximumError) { - yield { - limit: calculateBytes(budget.maximumError, budget.baseline, 1), - type: ThresholdType.Max, - severity: ThresholdSeverity.Error, - }; - } - if (budget.minimumWarning) { - yield { - limit: calculateBytes(budget.minimumWarning, budget.baseline, -1), - type: ThresholdType.Min, - severity: ThresholdSeverity.Warning, - }; - } - if (budget.minimumError) { - yield { - limit: calculateBytes(budget.minimumError, budget.baseline, -1), - type: ThresholdType.Min, - severity: ThresholdSeverity.Error, - }; - } - if (budget.warning) { - yield { - limit: calculateBytes(budget.warning, budget.baseline, -1), - type: ThresholdType.Min, - severity: ThresholdSeverity.Warning, - }; - yield { - limit: calculateBytes(budget.warning, budget.baseline, 1), - type: ThresholdType.Max, - severity: ThresholdSeverity.Warning, - }; - } - if (budget.error) { - yield { - limit: calculateBytes(budget.error, budget.baseline, -1), - type: ThresholdType.Min, - severity: ThresholdSeverity.Error, - }; - yield { - limit: calculateBytes(budget.error, budget.baseline, 1), - type: ThresholdType.Max, - severity: ThresholdSeverity.Error, - }; - } -} -/** - * Calculates the sizes for bundles in the budget type provided. - */ -function calculateSizes(budget, stats) { - const calculatorMap = { - all: AllCalculator, - allScript: AllScriptCalculator, - any: AnyCalculator, - anyScript: AnyScriptCalculator, - anyComponentStyle: AnyComponentStyleCalculator, - bundle: BundleCalculator, - initial: InitialCalculator, - }; - const ctor = calculatorMap[budget.type]; - const { chunks, assets } = stats; - if (!chunks) { - throw new Error('Webpack stats output did not include chunk information.'); - } - if (!assets) { - throw new Error('Webpack stats output did not include asset information.'); - } - const calculator = new ctor(budget, chunks, assets); - return calculator.calculate(); -} -class Calculator { - budget; - chunks; - assets; - constructor(budget, chunks, assets) { - this.budget = budget; - this.chunks = chunks; - this.assets = assets; - } - /** Calculates the size of the given chunk for the provided build type. */ - calculateChunkSize(chunk) { - // No differential builds, get the chunk size by summing its assets. - if (!chunk.files) { - return 0; - } - return chunk.files - .filter((file) => !file.endsWith('.map')) - .map((file) => { - const asset = this.assets.find((asset) => asset.name === file); - if (!asset) { - throw new Error(`Could not find asset for file: ${file}`); - } - return asset.size; - }) - .reduce((l, r) => l + r, 0); - } - getAssetSize(asset) { - return asset.size; - } -} -/** - * A named bundle. - */ -class BundleCalculator extends Calculator { - calculate() { - const budgetName = this.budget.name; - if (!budgetName) { - return []; - } - const size = this.chunks - .filter((chunk) => chunk?.names?.includes(budgetName)) - .map((chunk) => this.calculateChunkSize(chunk)) - .reduce((l, r) => l + r, 0); - return [{ size, label: this.budget.name }]; - } -} -/** - * The sum of all initial chunks (marked as initial). - */ -class InitialCalculator extends Calculator { - calculate() { - return [ - { - label: `bundle initial`, - size: this.chunks - .filter((chunk) => chunk.initial) - .map((chunk) => this.calculateChunkSize(chunk)) - .reduce((l, r) => l + r, 0), - }, - ]; - } -} -/** - * The sum of all the scripts portions. - */ -class AllScriptCalculator extends Calculator { - calculate() { - const size = this.assets - .filter((asset) => asset.name.endsWith('.js')) - .map((asset) => this.getAssetSize(asset)) - .reduce((total, size) => total + size, 0); - return [{ size, label: 'total scripts' }]; - } -} -/** - * All scripts and assets added together. - */ -class AllCalculator extends Calculator { - calculate() { - const size = this.assets - .filter((asset) => !asset.name.endsWith('.map') && !asset.componentStyle) - .map((asset) => this.getAssetSize(asset)) - .reduce((total, size) => total + size, 0); - return [{ size, label: 'total' }]; - } -} -/** - * Any script, individually. - */ -class AnyScriptCalculator extends Calculator { - calculate() { - return this.assets - .filter((asset) => asset.name.endsWith('.js')) - .map((asset) => ({ - size: this.getAssetSize(asset), - label: asset.name, - })); - } -} -/** - * Any script or asset (images, css, etc). - */ -class AnyCalculator extends Calculator { - calculate() { - return this.assets - .filter((asset) => !asset.name.endsWith('.map') && !asset.componentStyle) - .map((asset) => ({ - size: this.getAssetSize(asset), - label: asset.name, - })); - } -} -/** - * Any compoonent stylesheet - */ -class AnyComponentStyleCalculator extends Calculator { - calculate() { - return this.assets - .filter((asset) => asset.componentStyle) - .map((asset) => ({ - size: this.getAssetSize(asset), - label: asset.name, - })); - } -} -/** - * Calculate the bytes given a string value. - */ -function calculateBytes(input, baseline, factor = 1) { - const matches = input.trim().match(/^(\d+(?:\.\d+)?)[ \t]*(%|[kmg]?b)?$/i); - if (!matches) { - return NaN; - } - const baselineBytes = (baseline && calculateBytes(baseline)) || 0; - let value = Number(matches[1]); - switch (matches[2] && matches[2].toLowerCase()) { - case '%': - value = (baselineBytes * value) / 100; - break; - case 'kb': - value *= exports.BYTES_IN_KILOBYTE; - break; - case 'mb': - value *= exports.BYTES_IN_KILOBYTE * exports.BYTES_IN_KILOBYTE; - break; - case 'gb': - value *= exports.BYTES_IN_KILOBYTE * exports.BYTES_IN_KILOBYTE * exports.BYTES_IN_KILOBYTE; - break; - } - if (baselineBytes === 0) { - return value; - } - return baselineBytes + value * factor; -} -function* checkBudgets(budgets, stats, checkComponentStyles) { - // Ignore AnyComponentStyle budgets as these are handled in `AnyComponentStyleBudgetChecker` unless requested - const computableBudgets = checkComponentStyles - ? budgets - : budgets.filter((budget) => budget.type !== schema_1.Type.AnyComponentStyle); - for (const budget of computableBudgets) { - const sizes = calculateSizes(budget, stats); - for (const { size, label } of sizes) { - yield* checkThresholds(calculateThresholds(budget), size, label); - } - } -} -function* checkThresholds(thresholds, size, label) { - for (const threshold of thresholds) { - switch (threshold.type) { - case ThresholdType.Max: { - if (size <= threshold.limit) { - continue; - } - const sizeDifference = (0, format_bytes_1.formatSize)(size - threshold.limit); - yield { - severity: threshold.severity, - label, - message: `${label} exceeded maximum budget. Budget ${(0, format_bytes_1.formatSize)(threshold.limit)} was not met by ${sizeDifference} with a total of ${(0, format_bytes_1.formatSize)(size)}.`, - }; - break; - } - case ThresholdType.Min: { - if (size >= threshold.limit) { - continue; - } - const sizeDifference = (0, format_bytes_1.formatSize)(threshold.limit - size); - yield { - severity: threshold.severity, - label, - message: `${label} failed to meet minimum budget. Budget ${(0, format_bytes_1.formatSize)(threshold.limit)} was not met by ${sizeDifference} with a total of ${(0, format_bytes_1.formatSize)(size)}.`, - }; - break; - } - default: { - throw new Error(`Unexpected threshold type: ${ThresholdType[threshold.type]}`); - } - } - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/check-port.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/check-port.d.ts deleted file mode 100755 index c0354fe..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/check-port.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare function checkPort(port: number, host: string): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/check-port.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/check-port.js deleted file mode 100755 index 06b56ff..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/check-port.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkPort = checkPort; -const node_assert_1 = __importDefault(require("node:assert")); -const node_net_1 = require("node:net"); -const tty_1 = require("./tty"); -function createInUseError(port) { - return new Error(`Port ${port} is already in use. Use '--port' to specify a different port.`); -} -async function checkPort(port, host) { - // Disabled due to Vite not handling port 0 and instead always using the default value (5173) - // TODO: Enable this again once Vite is fixed - // if (port === 0) { - // return 0; - // } - return new Promise((resolve, reject) => { - const server = (0, node_net_1.createServer)(); - server - .once('error', (err) => { - if (err.code !== 'EADDRINUSE') { - reject(err); - return; - } - if (!tty_1.isTTY) { - reject(createInUseError(port)); - return; - } - Promise.resolve().then(() => __importStar(require('@inquirer/confirm'))).then(({ default: confirm }) => confirm({ - message: `Port ${port} is already in use.\nWould you like to use a different port?`, - default: true, - theme: { prefix: '' }, - })) - .then((answer) => (answer ? resolve(checkPort(0, host)) : reject(createInUseError(port))), () => reject(createInUseError(port))); - }) - .once('listening', () => { - // Get the actual address from the listening server instance - const address = server.address(); - (0, node_assert_1.default)(address && typeof address !== 'string', 'Port check server address should always be an object.'); - server.close(); - resolve(address.port); - }) - .listen(port, host); - }); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/color.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/color.d.ts deleted file mode 100755 index 4170315..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/color.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export { color as colors, figures } from 'listr2'; -export declare function supportColor(stream?: NodeJS.WritableStream): boolean; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/color.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/color.js deleted file mode 100755 index 8c44583..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/color.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.figures = exports.colors = void 0; -exports.supportColor = supportColor; -const node_tty_1 = require("node:tty"); -var listr2_1 = require("listr2"); -Object.defineProperty(exports, "colors", { enumerable: true, get: function () { return listr2_1.color; } }); -Object.defineProperty(exports, "figures", { enumerable: true, get: function () { return listr2_1.figures; } }); -function supportColor(stream = process.stdout) { - if (stream instanceof node_tty_1.WriteStream) { - return stream.hasColors(); - } - try { - // The hasColors function does not rely on any instance state and should ideally be static - return node_tty_1.WriteStream.prototype.hasColors(); - } - catch { - return process.env['FORCE_COLOR'] !== undefined && process.env['FORCE_COLOR'] !== '0'; - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/delete-output-dir.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/delete-output-dir.d.ts deleted file mode 100755 index 3de641f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/delete-output-dir.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -/** - * Delete an output directory, but error out if it's the root of the project. - */ -export declare function deleteOutputDir(root: string, outputPath: string, emptyOnlyDirectories?: string[]): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/delete-output-dir.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/delete-output-dir.js deleted file mode 100755 index 2f2735f..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/delete-output-dir.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.deleteOutputDir = deleteOutputDir; -const promises_1 = require("node:fs/promises"); -const node_path_1 = require("node:path"); -/** - * Delete an output directory, but error out if it's the root of the project. - */ -async function deleteOutputDir(root, outputPath, emptyOnlyDirectories) { - const resolvedOutputPath = (0, node_path_1.resolve)(root, outputPath); - if (resolvedOutputPath === root) { - throw new Error('Output path MUST not be project root directory!'); - } - const directoriesToEmpty = emptyOnlyDirectories - ? new Set(emptyOnlyDirectories.map((directory) => (0, node_path_1.join)(resolvedOutputPath, directory))) - : undefined; - // Avoid removing the actual directory to avoid errors in cases where the output - // directory is mounted or symlinked. Instead the contents are removed. - let entries; - try { - entries = await (0, promises_1.readdir)(resolvedOutputPath); - } - catch (error) { - if (error instanceof Error && 'code' in error && error.code === 'ENOENT') { - return; - } - throw error; - } - for (const entry of entries) { - const fullEntry = (0, node_path_1.join)(resolvedOutputPath, entry); - // Leave requested directories. This allows symlinks to continue to function. - if (directoriesToEmpty?.has(fullEntry)) { - await deleteOutputDir(resolvedOutputPath, fullEntry); - continue; - } - await (0, promises_1.rm)(fullEntry, { force: true, recursive: true, maxRetries: 3 }); - } -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/environment-options.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/environment-options.d.ts deleted file mode 100755 index 2c80ed4..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/environment-options.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare const allowMangle: boolean; -export declare const shouldBeautify: boolean; -export declare const allowMinify: boolean; -export declare const maxWorkers: number; -export declare const useParallelTs: boolean; -export declare const debugPerformance: boolean; -export declare const shouldWatchRoot: boolean; -export declare const useTypeChecking: boolean; -export declare const useJSONBuildLogs: boolean; -export declare const shouldOptimizeChunks: boolean; -export declare const useComponentStyleHmr: boolean; -export declare const useComponentTemplateHmr: boolean; -export declare const usePartialSsrBuild: boolean; -export declare const bazelEsbuildPluginPath: string | undefined; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/environment-options.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/environment-options.js deleted file mode 100755 index 339a754..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/environment-options.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bazelEsbuildPluginPath = exports.usePartialSsrBuild = exports.useComponentTemplateHmr = exports.useComponentStyleHmr = exports.shouldOptimizeChunks = exports.useJSONBuildLogs = exports.useTypeChecking = exports.shouldWatchRoot = exports.debugPerformance = exports.useParallelTs = exports.maxWorkers = exports.allowMinify = exports.shouldBeautify = exports.allowMangle = void 0; -const node_os_1 = require("node:os"); -function isDisabled(variable) { - return variable === '0' || variable.toLowerCase() === 'false'; -} -function isEnabled(variable) { - return variable === '1' || variable.toLowerCase() === 'true'; -} -function isPresent(variable) { - return typeof variable === 'string' && variable !== ''; -} -// Optimization and mangling -const debugOptimizeVariable = process.env['NG_BUILD_DEBUG_OPTIMIZE']; -const debugOptimize = (() => { - if (!isPresent(debugOptimizeVariable) || isDisabled(debugOptimizeVariable)) { - return { - mangle: true, - minify: true, - beautify: false, - }; - } - const debugValue = { - mangle: false, - minify: false, - beautify: true, - }; - if (isEnabled(debugOptimizeVariable)) { - return debugValue; - } - for (const part of debugOptimizeVariable.split(',')) { - switch (part.trim().toLowerCase()) { - case 'mangle': - debugValue.mangle = true; - break; - case 'minify': - debugValue.minify = true; - break; - case 'beautify': - debugValue.beautify = true; - break; - } - } - return debugValue; -})(); -const mangleVariable = process.env['NG_BUILD_MANGLE']; -exports.allowMangle = isPresent(mangleVariable) - ? !isDisabled(mangleVariable) - : debugOptimize.mangle; -exports.shouldBeautify = debugOptimize.beautify; -exports.allowMinify = debugOptimize.minify; -/** - * Some environments, like CircleCI which use Docker report a number of CPUs by the host and not the count of available. - * This cause `Error: Call retries were exceeded` errors when trying to use them. - * - * @see https://github.com/nodejs/node/issues/28762 - * @see https://github.com/webpack-contrib/terser-webpack-plugin/issues/143 - * @see https://ithub.com/angular/angular-cli/issues/16860#issuecomment-588828079 - * - */ -const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS']; -exports.maxWorkers = isPresent(maxWorkersVariable) - ? +maxWorkersVariable - : Math.min(4, Math.max((0, node_os_1.availableParallelism)() - 1, 1)); -const parallelTsVariable = process.env['NG_BUILD_PARALLEL_TS']; -exports.useParallelTs = !isPresent(parallelTsVariable) || !isDisabled(parallelTsVariable); -const debugPerfVariable = process.env['NG_BUILD_DEBUG_PERF']; -exports.debugPerformance = isPresent(debugPerfVariable) && isEnabled(debugPerfVariable); -const watchRootVariable = process.env['NG_BUILD_WATCH_ROOT']; -exports.shouldWatchRoot = isPresent(watchRootVariable) && isEnabled(watchRootVariable); -const typeCheckingVariable = process.env['NG_BUILD_TYPE_CHECK']; -exports.useTypeChecking = !isPresent(typeCheckingVariable) || !isDisabled(typeCheckingVariable); -const buildLogsJsonVariable = process.env['NG_BUILD_LOGS_JSON']; -exports.useJSONBuildLogs = isPresent(buildLogsJsonVariable) && isEnabled(buildLogsJsonVariable); -const optimizeChunksVariable = process.env['NG_BUILD_OPTIMIZE_CHUNKS']; -exports.shouldOptimizeChunks = isPresent(optimizeChunksVariable) && isEnabled(optimizeChunksVariable); -const hmrComponentStylesVariable = process.env['NG_HMR_CSTYLES']; -exports.useComponentStyleHmr = isPresent(hmrComponentStylesVariable) && isEnabled(hmrComponentStylesVariable); -const hmrComponentTemplateVariable = process.env['NG_HMR_TEMPLATES']; -exports.useComponentTemplateHmr = !isPresent(hmrComponentTemplateVariable) || !isDisabled(hmrComponentTemplateVariable); -const partialSsrBuildVariable = process.env['NG_BUILD_PARTIAL_SSR']; -exports.usePartialSsrBuild = isPresent(partialSsrBuildVariable) && isEnabled(partialSsrBuildVariable); -const bazelBinDirectory = process.env['BAZEL_BINDIR']; -const bazelExecRoot = process.env['JS_BINARY__EXECROOT']; -exports.bazelEsbuildPluginPath = bazelBinDirectory && bazelExecRoot - ? process.env['NG_INTERNAL_ESBUILD_PLUGINS_DO_NOT_USE'] - : undefined; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/error.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/error.d.ts deleted file mode 100755 index 5f48146..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/error.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare function assertIsError(value: unknown): asserts value is Error & { - code?: string; -}; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/error.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/error.js deleted file mode 100755 index 7e10321..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/error.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.assertIsError = assertIsError; -const node_assert_1 = __importDefault(require("node:assert")); -function assertIsError(value) { - const isError = value instanceof Error || - // The following is needing to identify errors coming from RxJs. - (typeof value === 'object' && value && 'name' in value && 'message' in value); - (0, node_assert_1.default)(isError, 'catch clause variable is not an Error instance'); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/format-bytes.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/format-bytes.d.ts deleted file mode 100755 index c3091ef..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/format-bytes.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare function formatSize(size: number): string; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/format-bytes.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/format-bytes.js deleted file mode 100755 index a26dbc3..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/format-bytes.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.formatSize = formatSize; -function formatSize(size) { - if (size <= 0) { - return '0 bytes'; - } - const abbreviations = ['bytes', 'kB', 'MB', 'GB']; - const index = Math.floor(Math.log(size) / Math.log(1000)); - const roundedSize = size / Math.pow(1000, index); - // bytes don't have a fraction - const fractionDigits = index === 0 ? 0 : 2; - return `${roundedSize.toFixed(fractionDigits)} ${abbreviations[index]}`; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/i18n-options.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/i18n-options.d.ts deleted file mode 100755 index 481a322..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/i18n-options.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -import type { TranslationLoader } from './load-translations'; -export interface LocaleDescription { - files: { - path: string; - integrity?: string; - format?: string; - }[]; - translation?: Record; - dataPath?: string; - baseHref?: string; - subPath: string; -} -export interface I18nOptions { - inlineLocales: Set; - sourceLocale: string; - locales: Record; - flatOutput?: boolean; - readonly shouldInline: boolean; - hasDefinedSourceLocale?: boolean; -} -export declare function createI18nOptions(projectMetadata: { - i18n?: unknown; -}, inline?: boolean | string[], logger?: { - warn(message: string): void; -}, ssrEnabled?: boolean): I18nOptions; -export declare function loadTranslations(locale: string, desc: LocaleDescription, workspaceRoot: string, loader: TranslationLoader, logger: { - warn: (message: string) => void; - error: (message: string) => void; -}, usedFormats?: Set, duplicateTranslation?: 'ignore' | 'error' | 'warning'): void; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/i18n-options.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/i18n-options.js deleted file mode 100755 index 2303b19..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/i18n-options.js +++ /dev/null @@ -1,207 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createI18nOptions = createI18nOptions; -exports.loadTranslations = loadTranslations; -const node_path_1 = __importDefault(require("node:path")); -function normalizeTranslationFileOption(option, locale, expectObjectInError) { - if (typeof option === 'string') { - return [option]; - } - if (Array.isArray(option) && option.every((element) => typeof element === 'string')) { - return option; - } - let errorMessage = `Project i18n locales translation field value for '${locale}' is malformed. `; - if (expectObjectInError) { - errorMessage += 'Expected a string, array of strings, or object.'; - } - else { - errorMessage += 'Expected a string or array of strings.'; - } - throw new Error(errorMessage); -} -function ensureObject(value, name) { - if (!value || typeof value !== 'object' || Array.isArray(value)) { - throw new Error(`Project field '${name}' is malformed. Expected an object.`); - } -} -function ensureString(value, name) { - if (typeof value !== 'string') { - throw new Error(`Project field '${name}' is malformed. Expected a string.`); - } -} -function ensureValidSubPath(value, name) { - ensureString(value, name); - if (!/^[\w-]*$/.test(value)) { - throw new Error(`Project field '${name}' is invalid. It can only contain letters, numbers, hyphens, and underscores.`); - } -} -function createI18nOptions(projectMetadata, inline, logger, ssrEnabled) { - const { i18n: metadata = {} } = projectMetadata; - ensureObject(metadata, 'i18n'); - const i18n = { - inlineLocales: new Set(), - // en-US is the default locale added to Angular applications (https://angular.dev/guide/i18n/format-data-locale) - sourceLocale: 'en-US', - locales: {}, - get shouldInline() { - return this.inlineLocales.size > 0; - }, - }; - let rawSourceLocale; - let rawSourceLocaleBaseHref; - let rawsubPath; - if (typeof metadata.sourceLocale === 'string') { - rawSourceLocale = metadata.sourceLocale; - } - else if (metadata.sourceLocale !== undefined) { - ensureObject(metadata.sourceLocale, 'i18n.sourceLocale'); - if (metadata.sourceLocale.code !== undefined) { - ensureString(metadata.sourceLocale.code, 'i18n.sourceLocale.code'); - rawSourceLocale = metadata.sourceLocale.code; - } - if (metadata.sourceLocale.baseHref !== undefined) { - ensureString(metadata.sourceLocale.baseHref, 'i18n.sourceLocale.baseHref'); - if (ssrEnabled) { - logger?.warn(`'baseHref' in 'i18n.sourceLocale' may lead to undefined behavior when used with SSR. ` + - `Consider using 'subPath' instead.\n\n` + - `Note: 'subPath' specifies the URL segment for the locale, serving as both the HTML base HREF ` + - `and the output directory name.\nBy default, if not explicitly set, 'subPath' defaults to the locale code.`); - } - rawSourceLocaleBaseHref = metadata.sourceLocale.baseHref; - } - if (metadata.sourceLocale.subPath !== undefined) { - ensureValidSubPath(metadata.sourceLocale.subPath, 'i18n.sourceLocale.subPath'); - rawsubPath = metadata.sourceLocale.subPath; - } - if (rawsubPath !== undefined && rawSourceLocaleBaseHref !== undefined) { - throw new Error(`'i18n.sourceLocale.subPath' and 'i18n.sourceLocale.baseHref' cannot be used together.`); - } - } - if (rawSourceLocale !== undefined) { - i18n.sourceLocale = rawSourceLocale; - i18n.hasDefinedSourceLocale = true; - } - i18n.locales[i18n.sourceLocale] = { - files: [], - baseHref: rawSourceLocaleBaseHref, - subPath: rawsubPath ?? i18n.sourceLocale, - }; - if (metadata.locales !== undefined) { - ensureObject(metadata.locales, 'i18n locales'); - for (const [locale, options] of Object.entries(metadata.locales)) { - let translationFiles; - let baseHref; - let subPath; - if (options && typeof options === 'object' && 'translation' in options) { - translationFiles = normalizeTranslationFileOption(options.translation, locale, false); - if ('baseHref' in options) { - ensureString(options.baseHref, `i18n.locales.${locale}.baseHref`); - if (ssrEnabled) { - logger?.warn(`'baseHref' in 'i18n.locales.${locale}' may lead to undefined behavior when used with SSR. ` + - `Consider using 'subPath' instead.\n\n` + - `Note: 'subPath' specifies the URL segment for the locale, serving as both the HTML base HREF ` + - `and the output directory name.\nBy default, if not explicitly set, 'subPath' defaults to the locale code.`); - } - baseHref = options.baseHref; - } - if ('subPath' in options) { - ensureValidSubPath(options.subPath, `i18n.locales.${locale}.subPath`); - subPath = options.subPath; - } - if (subPath !== undefined && baseHref !== undefined) { - throw new Error(`'i18n.locales.${locale}.subPath' and 'i18n.locales.${locale}.baseHref' cannot be used together.`); - } - } - else { - translationFiles = normalizeTranslationFileOption(options, locale, true); - } - if (locale === i18n.sourceLocale) { - throw new Error(`An i18n locale ('${locale}') cannot both be a source locale and provide a translation.`); - } - i18n.locales[locale] = { - files: translationFiles.map((file) => ({ path: file })), - baseHref, - subPath: subPath ?? locale, - }; - } - } - if (inline === true) { - i18n.inlineLocales.add(i18n.sourceLocale); - Object.keys(i18n.locales).forEach((locale) => i18n.inlineLocales.add(locale)); - } - else if (inline) { - for (const locale of inline) { - if (!i18n.locales[locale] && i18n.sourceLocale !== locale) { - throw new Error(`Requested locale '${locale}' is not defined for the project.`); - } - i18n.inlineLocales.add(locale); - } - } - // Check that subPaths are unique only the locales that we are inlining. - const localesData = Object.entries(i18n.locales).filter(([locale]) => i18n.inlineLocales.has(locale)); - for (let i = 0; i < localesData.length; i++) { - const [localeA, { subPath: subPathA }] = localesData[i]; - for (let j = i + 1; j < localesData.length; j++) { - const [localeB, { subPath: subPathB }] = localesData[j]; - if (subPathA === subPathB) { - throw new Error(`Invalid i18n configuration: Locales '${localeA}' and '${localeB}' cannot have the same subPath: '${subPathB}'.`); - } - } - } - return i18n; -} -function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedFormats, duplicateTranslation) { - let translations = undefined; - for (const file of desc.files) { - const loadResult = loader(node_path_1.default.join(workspaceRoot, file.path)); - for (const diagnostics of loadResult.diagnostics.messages) { - if (diagnostics.type === 'error') { - logger.error(`Error parsing translation file '${file.path}': ${diagnostics.message}`); - } - else { - logger.warn(`WARNING [${file.path}]: ${diagnostics.message}`); - } - } - if (loadResult.locale !== undefined && loadResult.locale !== locale) { - logger.warn(`WARNING [${file.path}]: File target locale ('${loadResult.locale}') does not match configured locale ('${locale}')`); - } - usedFormats?.add(loadResult.format); - file.format = loadResult.format; - file.integrity = loadResult.integrity; - if (translations) { - // Merge translations - for (const [id, message] of Object.entries(loadResult.translations)) { - if (translations[id] !== undefined) { - const duplicateTranslationMessage = `[${file.path}]: Duplicate translations for message '${id}' when merging.`; - switch (duplicateTranslation) { - case 'ignore': - break; - case 'error': - logger.error(`ERROR ${duplicateTranslationMessage}`); - break; - case 'warning': - default: - logger.warn(`WARNING ${duplicateTranslationMessage}`); - break; - } - } - translations[id] = message; - } - } - else { - // First or only translation file - translations = loadResult.translations; - } - } - desc.translation = translations; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/add-event-dispatch-contract.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/add-event-dispatch-contract.d.ts deleted file mode 100755 index a7c0927..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/add-event-dispatch-contract.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export declare function addEventDispatchContract(html: string): Promise; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/add-event-dispatch-contract.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/add-event-dispatch-contract.js deleted file mode 100755 index 43d9994..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/add-event-dispatch-contract.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.addEventDispatchContract = addEventDispatchContract; -const promises_1 = require("node:fs/promises"); -const html_rewriting_stream_1 = require("./html-rewriting-stream"); -let jsActionContractScript; -async function addEventDispatchContract(html) { - const { rewriter, transformedContent } = await (0, html_rewriting_stream_1.htmlRewritingStream)(html); - jsActionContractScript ??= - ''; - rewriter.on('startTag', (tag) => { - rewriter.emitStartTag(tag); - if (tag.tagName === 'body') { - rewriter.emitRaw(jsActionContractScript); - } - }); - return transformedContent(); -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/augment-index-html.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/augment-index-html.d.ts deleted file mode 100755 index 45feac1..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/augment-index-html.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -export type LoadOutputFileFunctionType = (file: string) => Promise; -export type CrossOriginValue = 'none' | 'anonymous' | 'use-credentials'; -export type Entrypoint = [name: string, isModule: boolean]; -export interface AugmentIndexHtmlOptions { - html: string; - baseHref?: string; - deployUrl?: string; - sri: boolean; - /** crossorigin attribute setting of elements that provide CORS support */ - crossOrigin?: CrossOriginValue; - files: FileInfo[]; - loadOutputFile: LoadOutputFileFunctionType; - /** Used to sort the inseration of files in the HTML file */ - entrypoints: Entrypoint[]; - /** Used to set the document default locale */ - lang?: string; - hints?: { - url: string; - mode: string; - as?: string; - }[]; - imageDomains?: string[]; -} -export interface FileInfo { - file: string; - name?: string; - extension: string; -} -export declare function augmentIndexHtml(params: AugmentIndexHtmlOptions): Promise<{ - content: string; - warnings: string[]; - errors: string[]; -}>; diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/augment-index-html.js b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/augment-index-html.js deleted file mode 100755 index 1cf3365..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/augment-index-html.js +++ /dev/null @@ -1,267 +0,0 @@ -"use strict"; -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.augmentIndexHtml = augmentIndexHtml; -const node_crypto_1 = require("node:crypto"); -const node_path_1 = require("node:path"); -const load_esm_1 = require("../load-esm"); -const html_rewriting_stream_1 = require("./html-rewriting-stream"); -const valid_self_closing_tags_1 = require("./valid-self-closing-tags"); -/* - * Helper function used by the IndexHtmlWebpackPlugin. - * Can also be directly used by builder, e. g. in order to generate an index.html - * after processing several configurations in order to build different sets of - * bundles for differential serving. - */ -// eslint-disable-next-line max-lines-per-function -async function augmentIndexHtml(params) { - const { loadOutputFile, files, entrypoints, sri, deployUrl, lang, baseHref, html, imageDomains } = params; - const warnings = []; - const errors = []; - let { crossOrigin = 'none' } = params; - if (sri && crossOrigin === 'none') { - crossOrigin = 'anonymous'; - } - const stylesheets = new Set(); - const scripts = new Map(); - // Sort files in the order we want to insert them by entrypoint - for (const [entrypoint, isModule] of entrypoints) { - for (const { extension, file, name } of files) { - if (name !== entrypoint || scripts.has(file) || stylesheets.has(file)) { - continue; - } - switch (extension) { - case '.js': - // Also, non entrypoints need to be loaded as no module as they can contain problematic code. - scripts.set(file, isModule); - break; - case '.mjs': - if (!isModule) { - // It would be very confusing to link an `*.mjs` file in a non-module script context, - // so we disallow it entirely. - throw new Error('`.mjs` files *must* set `isModule` to `true`.'); - } - scripts.set(file, true /* isModule */); - break; - case '.css': - stylesheets.add(file); - break; - } - } - } - let scriptTags = []; - for (const [src, isModule] of scripts) { - const attrs = [`src="${generateUrl(src, deployUrl)}"`]; - // This is also need for non entry-points as they may contain problematic code. - if (isModule) { - attrs.push('type="module"'); - } - else { - attrs.push('defer'); - } - if (crossOrigin !== 'none') { - attrs.push(`crossorigin="${crossOrigin}"`); - } - if (sri) { - const content = await loadOutputFile(src); - attrs.push(generateSriAttributes(content)); - } - scriptTags.push(``); - } - let headerLinkTags = []; - let bodyLinkTags = []; - for (const src of stylesheets) { - const attrs = [`rel="stylesheet"`, `href="${generateUrl(src, deployUrl)}"`]; - if (crossOrigin !== 'none') { - attrs.push(`crossorigin="${crossOrigin}"`); - } - if (sri) { - const content = await loadOutputFile(src); - attrs.push(generateSriAttributes(content)); - } - headerLinkTags.push(``); - } - if (params.hints?.length) { - for (const hint of params.hints) { - const attrs = [`rel="${hint.mode}"`, `href="${generateUrl(hint.url, deployUrl)}"`]; - if (hint.mode !== 'modulepreload' && crossOrigin !== 'none') { - // Value is considered anonymous by the browser when not present or empty - attrs.push(crossOrigin === 'anonymous' ? 'crossorigin' : `crossorigin="${crossOrigin}"`); - } - if (hint.mode === 'preload' || hint.mode === 'prefetch') { - switch ((0, node_path_1.extname)(hint.url)) { - case '.js': - attrs.push('as="script"'); - break; - case '.css': - attrs.push('as="style"'); - break; - default: - if (hint.as) { - attrs.push(`as="${hint.as}"`); - } - break; - } - } - if (sri && - (hint.mode === 'preload' || hint.mode === 'prefetch' || hint.mode === 'modulepreload')) { - const content = await loadOutputFile(hint.url); - attrs.push(generateSriAttributes(content)); - } - const tag = ``; - if (hint.mode === 'modulepreload') { - // Module preloads should be placed by the inserted script elements in the body since - // they are only useful in combination with the scripts. - bodyLinkTags.push(tag); - } - else { - headerLinkTags.push(tag); - } - } - } - const dir = lang ? await getLanguageDirection(lang, warnings) : undefined; - const { rewriter, transformedContent } = await (0, html_rewriting_stream_1.htmlRewritingStream)(html); - const baseTagExists = html.includes(' { - switch (tag.tagName) { - case 'html': - // Adjust document locale if specified - if (isString(lang)) { - updateAttribute(tag, 'lang', lang); - } - if (dir) { - updateAttribute(tag, 'dir', dir); - } - break; - case 'head': - // Base href should be added before any link, meta tags - if (!baseTagExists && isString(baseHref)) { - rewriter.emitStartTag(tag); - rewriter.emitRaw(``); - return; - } - break; - case 'base': - // Adjust base href if specified - if (isString(baseHref)) { - updateAttribute(tag, 'href', baseHref); - } - break; - case 'link': - if (readAttribute(tag, 'rel') === 'preconnect') { - const href = readAttribute(tag, 'href'); - if (href) { - foundPreconnects.add(href); - } - } - break; - default: - if (tag.selfClosing && !valid_self_closing_tags_1.VALID_SELF_CLOSING_TAGS.has(tag.tagName)) { - errors.push(`Invalid self-closing element in index HTML file: '${rawTagHtml}'.`); - return; - } - } - rewriter.emitStartTag(tag); - }) - .on('endTag', (tag) => { - switch (tag.tagName) { - case 'head': - for (const linkTag of headerLinkTags) { - rewriter.emitRaw(linkTag); - } - if (imageDomains) { - for (const imageDomain of imageDomains) { - if (!foundPreconnects.has(imageDomain)) { - rewriter.emitRaw(``); - } - } - } - headerLinkTags = []; - break; - case 'body': - for (const linkTag of bodyLinkTags) { - rewriter.emitRaw(linkTag); - } - bodyLinkTags = []; - // Add script tags - for (const scriptTag of scriptTags) { - rewriter.emitRaw(scriptTag); - } - scriptTags = []; - break; - } - rewriter.emitEndTag(tag); - }); - const content = await transformedContent(); - return { - content: headerLinkTags.length || scriptTags.length - ? // In case no body/head tags are not present (dotnet partial templates) - headerLinkTags.join('') + scriptTags.join('') + content - : content, - warnings, - errors, - }; -} -function generateSriAttributes(content) { - const algo = 'sha384'; - const hash = (0, node_crypto_1.createHash)(algo).update(content, 'utf8').digest('base64'); - return `integrity="${algo}-${hash}"`; -} -function generateUrl(value, deployUrl) { - if (!deployUrl) { - return value; - } - // Skip if root-relative, absolute or protocol relative url - if (/^((?:\w+:)?\/\/|data:|chrome:|\/)/.test(value)) { - return value; - } - return `${deployUrl}${value}`; -} -function updateAttribute(tag, name, value) { - const index = tag.attrs.findIndex((a) => a.name === name); - const newValue = { name, value }; - if (index === -1) { - tag.attrs.push(newValue); - } - else { - tag.attrs[index] = newValue; - } -} -function readAttribute(tag, name) { - const targetAttr = tag.attrs.find((attr) => attr.name === name); - return targetAttr ? targetAttr.value : undefined; -} -function isString(value) { - return typeof value === 'string'; -} -async function getLanguageDirection(locale, warnings) { - const dir = await getLanguageDirectionFromLocales(locale); - if (!dir) { - warnings.push(`Locale data for '${locale}' cannot be found. 'dir' attribute will not be set for this locale.`); - } - return dir; -} -async function getLanguageDirectionFromLocales(locale) { - try { - const localeData = (await (0, load_esm_1.loadEsmModule)(`@angular/common/locales/${locale}`)).default; - const dir = localeData[localeData.length - 2]; - return isString(dir) ? dir : undefined; - } - catch { - // In some cases certain locales might map to files which are named only with language id. - // Example: `en-US` -> `en`. - const [languageId] = locale.split('-', 1); - if (languageId !== locale) { - return getLanguageDirectionFromLocales(languageId); - } - } - return undefined; -} diff --git a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/auto-csp.d.ts b/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/auto-csp.d.ts deleted file mode 100755 index f7b6a74..0000000 --- a/go/display/webkit/ui/node_modules.bak/@angular/build/src/utils/index-file/auto-csp.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.dev/license - */ -/** - * Calculates a CSP compatible hash of an inline script. - * @param scriptText Text between opening and closing script tag. Has to - * include whitespaces and newlines! - * @returns The hash of the text formatted appropriately for CSP. - */ -export declare function hashTextContent(scriptText: string): string; -/** - * Finds all ``); - scriptContent = []; - } - rewriter.on('startTag', (tag) => { - if (tag.tagName === 'script') { - openedScriptTag = tag; - const src = getScriptAttributeValue(tag, 'src'); - if (src) { - // If there are any interesting attributes, note them down. - const scriptType = getScriptAttributeValue(tag, 'type'); - if (shouldDynamicallyLoadScriptTagBasedOnType(scriptType)) { - scriptContent.push({ - src: src, - type: scriptType, - async: getScriptAttributeValue(tag, 'async') !== undefined, - defer: getScriptAttributeValue(tag, 'defer') !== undefined, - }); - return; // Skip writing my script tag until we've read it all. - } - } - } - // We are encountering the first start tag that's not tag if it's a part of the - // dynamic loader script. - if (src && shouldDynamicallyLoadScriptTagBasedOnType(scriptType)) { - return; - } - } - if (tag.tagName === 'head' || tag.tagName === 'body' || tag.tagName === 'html') { - // Write the loader script if a string of