@analogjs/platform 3.0.0-alpha.2 → 3.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +16 -18
- package/src/index.d.ts +5 -2
- package/src/index.js +9 -3
- package/src/index.js.map +1 -0
- package/src/lib/clear-client-page-endpoint.d.ts +2 -2
- package/src/lib/clear-client-page-endpoint.js +22 -32
- package/src/lib/clear-client-page-endpoint.js.map +1 -0
- package/src/lib/content/marked/index.d.ts +5 -5
- package/src/lib/content/marked/index.js +10 -6
- package/src/lib/content/marked/index.js.map +1 -0
- package/src/lib/content/marked/marked-content-highlighter.d.ts +2 -4
- package/src/lib/content/marked/marked-content-highlighter.js +6 -3
- package/src/lib/content/marked/marked-content-highlighter.js.map +1 -0
- package/src/lib/content/marked/marked-setup.service.d.ts +8 -8
- package/src/lib/content/marked/marked-setup.service.js +44 -54
- package/src/lib/content/marked/marked-setup.service.js.map +1 -0
- package/src/lib/content/prism/angular.d.ts +1 -0
- package/src/lib/content/prism/angular.js +18 -19
- package/src/lib/content/prism/angular.js.map +1 -0
- package/src/lib/content/prism/index.d.ts +1 -1
- package/src/lib/content/prism/index.js +10 -7
- package/src/lib/content/prism/index.js.map +1 -0
- package/src/lib/content/prism/options.d.ts +1 -1
- package/src/lib/content/prism/prism-highlighter.d.ts +5 -5
- package/src/lib/content/prism/prism-highlighter.js +33 -33
- package/src/lib/content/prism/prism-highlighter.js.map +1 -0
- package/src/lib/content/shiki/index.d.ts +3 -3
- package/src/lib/content/shiki/index.js +19 -28
- package/src/lib/content/shiki/index.js.map +1 -0
- package/src/lib/content/shiki/options.d.ts +7 -7
- package/src/lib/content/shiki/shiki-highlighter.d.ts +13 -13
- package/src/lib/content/shiki/shiki-highlighter.js +45 -44
- package/src/lib/content/shiki/shiki-highlighter.js.map +1 -0
- package/src/lib/content-plugin.d.ts +19 -19
- package/src/lib/content-plugin.js +178 -196
- package/src/lib/content-plugin.js.map +1 -0
- package/src/lib/deps-plugin.d.ts +2 -2
- package/src/lib/deps-plugin.js +73 -82
- package/src/lib/deps-plugin.js.map +1 -0
- package/src/lib/json-ld-manifest-plugin.d.ts +41 -0
- package/src/lib/json-ld-manifest-plugin.js +84 -0
- package/src/lib/json-ld-manifest-plugin.js.map +1 -0
- package/src/lib/nx-plugin/builders.json +7 -0
- package/src/lib/nx-plugin/executors.json +5 -0
- package/src/lib/nx-plugin/generators.json +25 -0
- package/src/lib/nx-plugin/package.json +1 -5
- package/src/lib/nx-plugin/src/executors/vite/compat.d.ts +3 -2
- package/src/lib/nx-plugin/src/executors/vite/compat.js +6 -6
- package/src/lib/nx-plugin/src/executors/vite/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vite/schema.d.ts +1 -1
- package/src/lib/nx-plugin/src/executors/vite/vite.impl.d.ts +1 -1
- package/src/lib/nx-plugin/src/executors/vite/vite.impl.js +5 -4
- package/src/lib/nx-plugin/src/executors/vite/vite.impl.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.d.ts +3 -2
- package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js +6 -6
- package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vite-dev-server/schema.d.ts +1 -1
- package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.d.ts +1 -1
- package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js +5 -4
- package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vitest/compat.d.ts +3 -2
- package/src/lib/nx-plugin/src/executors/vitest/compat.js +6 -6
- package/src/lib/nx-plugin/src/executors/vitest/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vitest/schema.d.ts +1 -1
- package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.d.ts +1 -1
- package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js +5 -4
- package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/compat.d.ts +9 -2
- package/src/lib/nx-plugin/src/generators/app/compat.js +17 -6
- package/src/lib/nx-plugin/src/generators/app/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/files/root/tsconfig.base.json +3 -6
- package/src/lib/nx-plugin/src/generators/app/files/template-angular/src/test-setup.ts__template__ +1 -0
- package/src/lib/nx-plugin/src/generators/app/files/template-angular/tsconfig.app.json__template__ +1 -3
- package/src/lib/nx-plugin/src/generators/app/files/template-angular/tsconfig.json__template__ +2 -1
- package/src/lib/nx-plugin/src/generators/app/files/template-angular/vite.config.ts__template__ +6 -0
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/src/app/app.config.ts__template__ +0 -6
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/tsconfig.json__template__ +4 -2
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/vite.config.ts__template__ +0 -18
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/src/app/app.config.ts__template__ +0 -6
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/tsconfig.json__template__ +4 -2
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/vite.config.ts__template__ +0 -18
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/src/app/app.config.ts__template__ +0 -6
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/tsconfig.app.json__template__ +1 -3
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/tsconfig.json__template__ +4 -2
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/vite.config.ts__template__ +0 -9
- package/src/lib/nx-plugin/src/generators/app/generator.d.ts +11 -11
- package/src/lib/nx-plugin/src/generators/app/generator.js +78 -88
- package/src/lib/nx-plugin/src/generators/app/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.d.ts +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.d.ts +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.js +72 -89
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.js +24 -58
- package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/app/lib/add-files.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/app/lib/add-files.js +15 -16
- package/src/lib/nx-plugin/src/generators/app/lib/add-files.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.js +14 -13
- package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.d.ts +7 -7
- package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.js +15 -30
- package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.d.ts +3 -5
- package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.js +49 -147
- package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.d.ts +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.js +17 -20
- package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.d.ts +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.js +14 -12
- package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.d.ts +4 -5
- package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js +6 -10
- package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.d.ts +0 -3
- package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.d.ts +0 -5
- package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.d.ts +9 -16
- package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.js +7 -37
- package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.d.ts +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.js +9 -15
- package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions.d.ts +0 -28
- package/src/lib/nx-plugin/src/generators/init/compat.d.ts +9 -2
- package/src/lib/nx-plugin/src/generators/init/compat.js +17 -6
- package/src/lib/nx-plugin/src/generators/init/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/generator.d.ts +3 -3
- package/src/lib/nx-plugin/src/generators/init/generator.js +54 -55
- package/src/lib/nx-plugin/src/generators/init/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.d.ts +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.js +19 -20
- package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.js +20 -18
- package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.js +56 -57
- package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.d.ts +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.js +12 -11
- package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.js +17 -15
- package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-main.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/init/lib/update-main.js +12 -12
- package/src/lib/nx-plugin/src/generators/init/lib/update-main.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.js +19 -25
- package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.js +43 -45
- package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.js +27 -28
- package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.js +19 -17
- package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/test-files/src/test-setup.ts__template__ +1 -0
- package/src/lib/nx-plugin/src/generators/page/compat.d.ts +9 -0
- package/src/lib/nx-plugin/src/generators/page/compat.js +18 -0
- package/src/lib/nx-plugin/src/generators/page/compat.js.map +1 -0
- package/src/lib/nx-plugin/src/generators/page/generator.d.ts +3 -4
- package/src/lib/nx-plugin/src/generators/page/generator.js +33 -44
- package/src/lib/nx-plugin/src/generators/page/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/preset/__snapshots__/generator.spec.ts.snap +5 -3
- package/src/lib/nx-plugin/src/generators/preset/generator.d.ts +3 -3
- package/src/lib/nx-plugin/src/generators/preset/generator.js +17 -43
- package/src/lib/nx-plugin/src/generators/preset/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/compat.d.ts +9 -2
- package/src/lib/nx-plugin/src/generators/setup-vitest/compat.js +17 -6
- package/src/lib/nx-plugin/src/generators/setup-vitest/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/files/src/test-setup.ts__template__ +1 -0
- package/src/lib/nx-plugin/src/generators/setup-vitest/generator.d.ts +3 -3
- package/src/lib/nx-plugin/src/generators/setup-vitest/generator.js +35 -32
- package/src/lib/nx-plugin/src/generators/setup-vitest/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.d.ts +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.js +7 -7
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.js +20 -21
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.d.ts +2 -2
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.js +19 -19
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.js.map +1 -1
- package/src/lib/nx-plugin/src/index.js +0 -1
- package/src/lib/nx-plugin/src/utils/version-utils.d.ts +1 -1
- package/src/lib/nx-plugin/src/utils/version-utils.js +20 -18
- package/src/lib/nx-plugin/src/utils/version-utils.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/dependencies.js +42 -62
- package/src/lib/nx-plugin/src/utils/versions/dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js +49 -83
- package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/ng_17_X/versions.js +33 -20
- package/src/lib/nx-plugin/src/utils/versions/ng_17_X/versions.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/ng_18_X/versions.js +33 -20
- package/src/lib/nx-plugin/src/utils/versions/ng_18_X/versions.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.d.ts +7 -7
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js +37 -23
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js.map +1 -1
- package/src/lib/options.d.ts +158 -80
- package/src/lib/platform-plugin.d.ts +2 -2
- package/src/lib/platform-plugin.js +67 -61
- package/src/lib/platform-plugin.js.map +1 -0
- package/src/lib/route-file-discovery.d.ts +23 -0
- package/src/lib/route-file-discovery.js +114 -0
- package/src/lib/route-file-discovery.js.map +1 -0
- package/src/lib/route-generation-plugin.d.ts +3 -0
- package/src/lib/route-generation-plugin.js +34 -0
- package/src/lib/route-generation-plugin.js.map +1 -0
- package/src/lib/route-manifest.d.ts +120 -0
- package/src/lib/route-manifest.js +411 -0
- package/src/lib/route-manifest.js.map +1 -0
- package/src/lib/router-plugin.d.ts +19 -19
- package/src/lib/router-plugin.js +193 -150
- package/src/lib/router-plugin.js.map +1 -0
- package/src/lib/ssr/inject-html-plugin.d.ts +1 -1
- package/src/lib/ssr/inject-html-plugin.js +25 -25
- package/src/lib/ssr/inject-html-plugin.js.map +1 -0
- package/src/lib/ssr/ssr-build-plugin.d.ts +18 -2
- package/src/lib/ssr/ssr-build-plugin.js +54 -30
- package/src/lib/ssr/ssr-build-plugin.js.map +1 -0
- package/src/lib/tailwind-preprocessor.d.ts +23 -0
- package/src/lib/tailwind-preprocessor.js +33 -0
- package/src/lib/tailwind-preprocessor.js.map +1 -0
- package/src/lib/typed-routes-plugin.d.ts +50 -0
- package/src/lib/typed-routes-plugin.js +204 -0
- package/src/lib/typed-routes-plugin.js.map +1 -0
- package/src/lib/utils/rolldown.d.ts +3 -0
- package/src/lib/utils/rolldown.js +15 -0
- package/src/lib/utils/rolldown.js.map +1 -0
- package/src/server-mode-plugin.d.ts +6 -6
- package/src/server-mode-plugin.js +16 -18
- package/src/server-mode-plugin.js.map +1 -0
- package/README.md +0 -5
- package/src/lib/content/prism/options.js +0 -1
- package/src/lib/content/shiki/options.js +0 -1
- package/src/lib/nx-plugin/README.md +0 -23
- package/src/lib/nx-plugin/src/generators/app/files/tailwind/v2/postcss.config.cjs__template__ +0 -10
- package/src/lib/nx-plugin/src/generators/app/files/tailwind/v2/tailwind.config.cjs__template__ +0 -14
- package/src/lib/nx-plugin/src/generators/app/files/tailwind/v3/postcss.config.cjs__template__ +0 -10
- package/src/lib/nx-plugin/src/generators/app/files/tailwind/v3/tailwind.config.ts__template__ +0 -14
- package/src/lib/nx-plugin/src/generators/app/files/tailwind/v4/.postcssrc.json +0 -5
- package/src/lib/nx-plugin/src/generators/app/files/tailwind/v4/tailwind.config.ts__template__ +0 -14
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/index.html__template__ +0 -15
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/app/app.component.spec.ts__template__ +0 -17
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/app/app.component.ts__template__ +0 -10
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/favicon.ico__template__ +0 -0
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.providers.ts__template__ +0 -5
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.server.ts__template__ +0 -23
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.ts__template__ +0 -17
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/public/assets/.gitkeep__template__ +0 -0
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/public/assets/analog.svg__template__ +0 -1
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/public/assets/vite.svg__template__ +0 -1
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/server/routes/v1/hello.ts__template__ +0 -3
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/styles.css__template__ +0 -4
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/test-setup.ts__template__ +0 -12
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/vite-env.d.ts__template__ +0 -1
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.app.json__template__ +0 -16
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.editor.json__template__ +0 -7
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.json__template__ +0 -32
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.spec.json__template__ +0 -14
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/vite.config.ts__template__ +0 -69
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.js +0 -15
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.js.map +0 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.js +0 -58
- package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.js.map +0 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.js +0 -47
- package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.js.map +0 -1
- package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.js +0 -107
- package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.js.map +0 -1
- package/src/lib/nx-plugin/src/generators/app/versions/dependencies.js +0 -56
- package/src/lib/nx-plugin/src/generators/app/versions/dependencies.js.map +0 -1
- package/src/lib/nx-plugin/src/generators/app/versions/dev-dependencies.js +0 -72
- package/src/lib/nx-plugin/src/generators/app/versions/dev-dependencies.js.map +0 -1
- package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.js +0 -46
- package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.js.map +0 -1
- package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.js +0 -37
- package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.js.map +0 -1
- package/src/lib/nx-plugin/src/generators/app/versions.js +0 -43
- package/src/lib/nx-plugin/src/generators/app/versions.js.map +0 -1
- package/src/lib/nx-plugin/src/index.d.ts +0 -0
- package/src/lib/nx-plugin/src/index.js.map +0 -1
- package/src/lib/options.js +0 -1
- package/src/lib/ssr/ssr-xhr-plugin.d.ts +0 -2
- package/src/lib/ssr/ssr-xhr-plugin.js +0 -28
|
@@ -1,61 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.addAngularApp = addAngularApp;
|
|
37
|
-
const devkit_1 = require("@nx/devkit");
|
|
1
|
+
let _nx_devkit = require("@nx/devkit");
|
|
2
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-angular-app.ts
|
|
38
3
|
async function addAngularApp(tree, options) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
directory: `${appsDir}/${options.analogAppName}`,
|
|
59
|
-
});
|
|
4
|
+
const isNx = tree.exists("/nx.json");
|
|
5
|
+
const appsDir = isNx ? (0, _nx_devkit.getWorkspaceLayout)(tree).appsDir : "projects";
|
|
6
|
+
const appOptions = {
|
|
7
|
+
name: options.analogAppName,
|
|
8
|
+
directory: `${appsDir}/${options.analogAppName}`,
|
|
9
|
+
linter: !isNx || process.env.NODE_ENV === "test" ? "none" : "eslint",
|
|
10
|
+
e2eTestRunner: "none",
|
|
11
|
+
unitTestRunner: "vitest",
|
|
12
|
+
standalone: true,
|
|
13
|
+
ssr: false,
|
|
14
|
+
bundler: "esbuild",
|
|
15
|
+
serverRouting: false,
|
|
16
|
+
skipFormat: true,
|
|
17
|
+
tags: options.tags
|
|
18
|
+
};
|
|
19
|
+
await (await import("@nx/angular/generators")).applicationGenerator(tree, {
|
|
20
|
+
...appOptions,
|
|
21
|
+
directory: `${appsDir}/${options.analogAppName}`
|
|
22
|
+
});
|
|
60
23
|
}
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.addAngularApp = addAngularApp;
|
|
26
|
+
|
|
61
27
|
//# sourceMappingURL=add-angular-app.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-angular-app.js","
|
|
1
|
+
{"version":3,"file":"add-angular-app.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-angular-app.ts"],"sourcesContent":["import { getWorkspaceLayout, Tree } from '@nx/devkit';\nimport { NormalizedOptions } from '../generator';\n\nexport async function addAngularApp(\n tree: Tree,\n options: NormalizedOptions,\n): Promise<void> {\n const isNx = tree.exists('/nx.json');\n const appsDir = isNx ? getWorkspaceLayout(tree).appsDir : 'projects';\n\n const appOptions: typeof import('@nx/angular/src/generators/application/schema') =\n {\n name: options.analogAppName,\n directory: `${appsDir}/${options.analogAppName}`,\n linter: !isNx || process.env['NODE_ENV'] === 'test' ? 'none' : 'eslint',\n e2eTestRunner: 'none',\n unitTestRunner: 'vitest',\n standalone: true,\n ssr: false,\n bundler: 'esbuild',\n serverRouting: false,\n skipFormat: true,\n tags: options.tags,\n };\n\n await (\n await import(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n '@nx/angular/generators'\n )\n ).applicationGenerator(tree, {\n ...appOptions,\n directory: `${appsDir}/${options.analogAppName}`,\n });\n}\n"],"mappings":";;AAGA,eAAsB,cACpB,MACA,SACe;CACf,MAAM,OAAO,KAAK,OAAO,WAAW;CACpC,MAAM,UAAU,QAAA,GAAA,WAAA,oBAA0B,KAAK,CAAC,UAAU;CAE1D,MAAM,aACJ;EACE,MAAM,QAAQ;EACd,WAAW,GAAG,QAAQ,GAAG,QAAQ;EACjC,QAAQ,CAAC,QAAA,QAAA,IAAA,aAAoC,SAAS,SAAS;EAC/D,eAAe;EACf,gBAAgB;EAChB,YAAY;EACZ,KAAK;EACL,SAAS;EACT,eAAe;EACf,YAAY;EACZ,MAAM,QAAQ;EACf;AAEH,QACE,MAAM,OAGJ,2BAEF,qBAAqB,MAAM;EAC3B,GAAG;EACH,WAAW,GAAG,QAAQ,GAAG,QAAQ;EAClC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Tree } from
|
|
2
|
-
import { NormalizedOptions } from
|
|
1
|
+
import { Tree } from "@nx/devkit";
|
|
2
|
+
import { NormalizedOptions } from "../generator";
|
|
3
3
|
export declare function addEslint(tree: Tree, majorNxVersion: number, options: NormalizedOptions): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Tree } from
|
|
2
|
-
import { NormalizedOptions } from
|
|
1
|
+
import { Tree } from "@nx/devkit";
|
|
2
|
+
import { NormalizedOptions } from "../generator";
|
|
3
3
|
export declare function addFiles(tree: Tree, options: NormalizedOptions, majorAngularVersion: number): void;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
1
|
+
let _nx_devkit = require("@nx/devkit");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-files.ts
|
|
6
4
|
function addFiles(tree, options, majorAngularVersion) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(0, devkit_1.generateFiles)(tree, (0, node_path_1.join)(__dirname, '..', 'files', 'root'), '.', templateOptions);
|
|
17
|
-
}
|
|
5
|
+
const isNx = tree.exists("/nx.json");
|
|
6
|
+
const templateOptions = {
|
|
7
|
+
...options,
|
|
8
|
+
template: "",
|
|
9
|
+
tsconfig: isNx ? "tsconfig.base.json" : "tsconfig.json",
|
|
10
|
+
majorAngularVersion
|
|
11
|
+
};
|
|
12
|
+
(0, _nx_devkit.generateFiles)(tree, (0, node_path.join)(__dirname, "..", "files", "template-angular"), options.projectRoot, templateOptions);
|
|
13
|
+
if (!tree.exists("/angular.json") && !tree.exists("/tsconfig.base.json")) (0, _nx_devkit.generateFiles)(tree, (0, node_path.join)(__dirname, "..", "files", "root"), ".", templateOptions);
|
|
18
14
|
}
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.addFiles = addFiles;
|
|
17
|
+
|
|
19
18
|
//# sourceMappingURL=add-files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-files.js","
|
|
1
|
+
{"version":3,"file":"add-files.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-files.ts"],"sourcesContent":["import { generateFiles, Tree } from '@nx/devkit';\nimport { join } from 'node:path';\nimport { NormalizedOptions } from '../generator';\n\nexport function addFiles(\n tree: Tree,\n options: NormalizedOptions,\n majorAngularVersion: number,\n): void {\n const isNx = tree.exists('/nx.json');\n const templateOptions = {\n ...options,\n template: '',\n tsconfig: isNx ? 'tsconfig.base.json' : 'tsconfig.json',\n majorAngularVersion,\n };\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'template-angular'),\n options.projectRoot,\n templateOptions,\n );\n\n if (!tree.exists('/angular.json') && !tree.exists('/tsconfig.base.json')) {\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'root'),\n '.',\n templateOptions,\n );\n }\n}\n"],"mappings":";;;AAIA,SAAgB,SACd,MACA,SACA,qBACM;CACN,MAAM,OAAO,KAAK,OAAO,WAAW;CACpC,MAAM,kBAAkB;EACtB,GAAG;EACH,UAAU;EACV,UAAU,OAAO,uBAAuB;EACxC;EACD;AACD,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,mBAAmB,EAClD,QAAQ,aACR,gBACD;AAED,KAAI,CAAC,KAAK,OAAO,gBAAgB,IAAI,CAAC,KAAK,OAAO,sBAAsB,CACtE,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,OAAO,EACtC,KACA,gBACD"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Tree } from
|
|
2
|
-
import { NormalizedOptions } from
|
|
1
|
+
import { Tree } from "@nx/devkit";
|
|
2
|
+
import { NormalizedOptions } from "../generator";
|
|
3
3
|
export declare function addHomePage(tree: Tree, options: NormalizedOptions, majorAngularVersion: number): void;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
1
|
+
let _nx_devkit = require("@nx/devkit");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-home-page.ts
|
|
6
4
|
function addHomePage(tree, options, majorAngularVersion) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
const templateOptions = {
|
|
6
|
+
...options,
|
|
7
|
+
template: "",
|
|
8
|
+
majorAngularVersion
|
|
9
|
+
};
|
|
10
|
+
(0, _nx_devkit.generateFiles)(tree, (0, node_path.join)(__dirname, "..", "files", "index-page"), options.projectRoot, templateOptions);
|
|
11
|
+
const pageDirectory = options.addTailwind ? "tailwind" : "css";
|
|
12
|
+
(0, _nx_devkit.generateFiles)(tree, (0, node_path.join)(__dirname, "..", "files", "welcome-components", pageDirectory), options.projectRoot, templateOptions);
|
|
15
13
|
}
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.addHomePage = addHomePage;
|
|
16
|
+
|
|
16
17
|
//# sourceMappingURL=add-home-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-home-page.js","
|
|
1
|
+
{"version":3,"file":"add-home-page.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-home-page.ts"],"sourcesContent":["import { generateFiles, Tree } from '@nx/devkit';\nimport { join } from 'node:path';\nimport { NormalizedOptions } from '../generator';\n\nexport function addHomePage(\n tree: Tree,\n options: NormalizedOptions,\n majorAngularVersion: number,\n): void {\n const templateOptions = {\n ...options,\n template: '',\n majorAngularVersion,\n };\n\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'index-page'),\n options.projectRoot,\n templateOptions,\n );\n\n const pageDirectory = options.addTailwind ? 'tailwind' : 'css';\n\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'welcome-components', pageDirectory),\n options.projectRoot,\n templateOptions,\n );\n}\n"],"mappings":";;;AAIA,SAAgB,YACd,MACA,SACA,qBACM;CACN,MAAM,kBAAkB;EACtB,GAAG;EACH,UAAU;EACV;EACD;AAED,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,aAAa,EAC5C,QAAQ,aACR,gBACD;CAED,MAAM,gBAAgB,QAAQ,cAAc,aAAa;AAEzD,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,sBAAsB,cAAc,EACnE,QAAQ,aACR,gBACD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { GeneratorCallback, Tree } from
|
|
1
|
+
import { GeneratorCallback, Tree } from "@nx/devkit";
|
|
2
2
|
export declare function addTailwindConfig(tree: Tree, projectName: string): Promise<void>;
|
|
3
3
|
export interface GeneratorOptions {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
project: string;
|
|
5
|
+
buildTarget?: string;
|
|
6
|
+
skipFormat?: boolean;
|
|
7
|
+
stylesEntryPoint?: string;
|
|
8
|
+
skipPackageJson?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export interface NormalizedGeneratorOptions extends GeneratorOptions {
|
|
11
|
-
|
|
11
|
+
buildTarget: string;
|
|
12
12
|
}
|
|
13
13
|
export declare function setupTailwindGenerator(tree: Tree, rawOptions: GeneratorOptions): Promise<GeneratorCallback>;
|
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.setupTailwindGenerator = setupTailwindGenerator;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const add_tailwind_helpers_1 = require("./add-tailwind-helpers");
|
|
1
|
+
const require_add_tailwind_helpers = require("./add-tailwind-helpers.js");
|
|
2
|
+
let _nx_devkit = require("@nx/devkit");
|
|
3
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-tailwind-config.ts
|
|
7
4
|
async function addTailwindConfig(tree, projectName) {
|
|
8
|
-
|
|
9
|
-
project: projectName,
|
|
10
|
-
});
|
|
5
|
+
await setupTailwindGenerator(tree, { project: projectName });
|
|
11
6
|
}
|
|
12
7
|
async function setupTailwindGenerator(tree, rawOptions) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
(0, add_tailwind_helpers_1.addTailwindConfigFile)(tree, options, project);
|
|
24
|
-
if (project.projectType === 'application') {
|
|
25
|
-
(0, add_tailwind_helpers_1.updateApplicationStyles)(tree, options, project);
|
|
26
|
-
}
|
|
27
|
-
else if (project.projectType === 'library') {
|
|
28
|
-
(0, add_tailwind_helpers_1.addTailwindConfigPathToProject)(tree, options, project);
|
|
29
|
-
}
|
|
30
|
-
if (!options.skipFormat) {
|
|
31
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
32
|
-
}
|
|
33
|
-
return installTask;
|
|
8
|
+
const options = require_add_tailwind_helpers.normalizeOptions(rawOptions);
|
|
9
|
+
const project = (0, _nx_devkit.readProjectConfiguration)(tree, options.project);
|
|
10
|
+
require_add_tailwind_helpers.detectTailwindInstalledVersion(tree);
|
|
11
|
+
let installTask = () => {};
|
|
12
|
+
if (!options.skipPackageJson) installTask = require_add_tailwind_helpers.addTailwindRequiredPackages(tree);
|
|
13
|
+
if (project.projectType === "application") require_add_tailwind_helpers.updateApplicationStyles(tree, options, project);
|
|
14
|
+
if (!options.skipFormat) await (0, _nx_devkit.formatFiles)(tree);
|
|
15
|
+
return installTask;
|
|
34
16
|
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.addTailwindConfig = addTailwindConfig;
|
|
19
|
+
|
|
35
20
|
//# sourceMappingURL=add-tailwind-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-tailwind-config.js","
|
|
1
|
+
{"version":3,"file":"add-tailwind-config.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-tailwind-config.ts"],"sourcesContent":["import {\n formatFiles,\n GeneratorCallback,\n readProjectConfiguration,\n Tree,\n} from '@nx/devkit';\nimport {\n addTailwindRequiredPackages,\n detectTailwindInstalledVersion,\n normalizeOptions,\n updateApplicationStyles,\n} from './add-tailwind-helpers';\n\nexport async function addTailwindConfig(\n tree: Tree,\n projectName: string,\n): Promise<void> {\n await setupTailwindGenerator(tree, {\n project: projectName,\n });\n}\n\nexport interface GeneratorOptions {\n project: string;\n buildTarget?: string;\n skipFormat?: boolean;\n stylesEntryPoint?: string;\n skipPackageJson?: boolean;\n}\n\nexport interface NormalizedGeneratorOptions extends GeneratorOptions {\n buildTarget: string;\n}\n\nexport async function setupTailwindGenerator(\n tree: Tree,\n rawOptions: GeneratorOptions,\n): Promise<GeneratorCallback> {\n const options = normalizeOptions(rawOptions);\n const project = readProjectConfiguration(tree, options.project);\n\n // TODO: use return value for v5+ branching when needed\n detectTailwindInstalledVersion(tree);\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n let installTask: GeneratorCallback = () => {};\n if (!options.skipPackageJson) {\n installTask = addTailwindRequiredPackages(tree);\n }\n\n if (project.projectType === 'application') {\n updateApplicationStyles(tree, options, project);\n }\n\n if (!options.skipFormat) {\n await formatFiles(tree);\n }\n\n return installTask;\n}\n"],"mappings":";;;AAaA,eAAsB,kBACpB,MACA,aACe;AACf,OAAM,uBAAuB,MAAM,EACjC,SAAS,aACV,CAAC;;AAeJ,eAAsB,uBACpB,MACA,YAC4B;CAC5B,MAAM,UAAU,6BAAA,iBAAiB,WAAW;CAC5C,MAAM,WAAA,GAAA,WAAA,0BAAmC,MAAM,QAAQ,QAAQ;AAG/D,8BAAA,+BAA+B,KAAK;CAGpC,IAAI,oBAAuC;AAC3C,KAAI,CAAC,QAAQ,gBACX,eAAc,6BAAA,4BAA4B,KAAK;AAGjD,KAAI,QAAQ,gBAAgB,cAC1B,8BAAA,wBAAwB,MAAM,SAAS,QAAQ;AAGjD,KAAI,CAAC,QAAQ,WACX,QAAA,GAAA,WAAA,aAAkB,KAAK;AAGzB,QAAO"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Tree, GeneratorCallback, ProjectConfiguration } from
|
|
2
|
-
import { GeneratorOptions, NormalizedGeneratorOptions } from
|
|
1
|
+
import { Tree, GeneratorCallback, ProjectConfiguration } from "@nx/devkit";
|
|
2
|
+
import { GeneratorOptions, NormalizedGeneratorOptions } from "./add-tailwind-config";
|
|
3
3
|
export declare function normalizeOptions(options: GeneratorOptions): NormalizedGeneratorOptions;
|
|
4
|
-
export declare function detectTailwindInstalledVersion(tree: Tree):
|
|
4
|
+
export declare function detectTailwindInstalledVersion(tree: Tree): "4" | "5" | undefined;
|
|
5
5
|
export declare function addTailwindRequiredPackages(tree: Tree): GeneratorCallback;
|
|
6
6
|
export declare function updateApplicationStyles(tree: Tree, options: NormalizedGeneratorOptions, project: ProjectConfiguration): void;
|
|
7
|
-
export declare function addTailwindConfigPathToProject(tree: Tree, options: NormalizedGeneratorOptions, project: ProjectConfiguration): void;
|
|
8
|
-
export declare function addTailwindConfigFile(tree: Tree, options: GeneratorOptions, project: ProjectConfiguration): void;
|
|
@@ -1,160 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.updateApplicationStyles = updateApplicationStyles;
|
|
7
|
-
exports.addTailwindConfigPathToProject = addTailwindConfigPathToProject;
|
|
8
|
-
exports.addTailwindConfigFile = addTailwindConfigFile;
|
|
9
|
-
const semver_1 = require("@nx/devkit/src/utils/semver");
|
|
10
|
-
const tailwind_dependencies_1 = require("../versions/tailwind-dependencies");
|
|
11
|
-
const semver_2 = require("semver");
|
|
12
|
-
const devkit_1 = require("@nx/devkit");
|
|
13
|
-
const node_path_1 = require("node:path");
|
|
1
|
+
const require_tailwind_dependencies = require("../versions/tailwind-dependencies.js");
|
|
2
|
+
let _nx_devkit = require("@nx/devkit");
|
|
3
|
+
let semver = require("semver");
|
|
4
|
+
let _nx_devkit_src_utils_semver = require("@nx/devkit/src/utils/semver");
|
|
5
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-tailwind-helpers.ts
|
|
14
6
|
function normalizeOptions(options) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
return {
|
|
8
|
+
...options,
|
|
9
|
+
buildTarget: options.buildTarget || "build"
|
|
10
|
+
};
|
|
19
11
|
}
|
|
20
12
|
function detectTailwindInstalledVersion(tree) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if ((0, semver_2.lt)(version, '2.0.0')) {
|
|
28
|
-
throw new Error(`The Tailwind CSS version "${tailwindVersion}" is not supported. Please upgrade to v2.0.0 or higher.`);
|
|
29
|
-
}
|
|
30
|
-
if ((0, semver_2.lt)(version, '3.0.0')) {
|
|
31
|
-
return '2';
|
|
32
|
-
}
|
|
33
|
-
return (0, semver_2.lt)(version, '4.0.0') ? '3' : '4';
|
|
13
|
+
const { dependencies, devDependencies } = (0, _nx_devkit.readJson)(tree, "package.json");
|
|
14
|
+
const tailwindVersion = dependencies?.tailwindcss ?? devDependencies?.tailwindcss;
|
|
15
|
+
if (!tailwindVersion) return;
|
|
16
|
+
const version = (0, _nx_devkit_src_utils_semver.checkAndCleanWithSemver)("tailwindcss", tailwindVersion);
|
|
17
|
+
if ((0, semver.lt)(version, "4.0.0")) throw new Error(`The Tailwind CSS version "${tailwindVersion}" is not supported. Please upgrade to v4.0.0 or higher.`);
|
|
18
|
+
return (0, semver.lt)(version, "5.0.0") ? "4" : "5";
|
|
34
19
|
}
|
|
35
20
|
function addTailwindRequiredPackages(tree) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, {});
|
|
21
|
+
const pkgVersions = require_tailwind_dependencies.getTailwindDependencies();
|
|
22
|
+
return (0, _nx_devkit.addDependenciesToPackageJson)(tree, {
|
|
23
|
+
tailwindcss: pkgVersions.tailwindcss,
|
|
24
|
+
"@tailwindcss/vite": pkgVersions["@tailwindcss/vite"]
|
|
25
|
+
}, {});
|
|
42
26
|
}
|
|
43
27
|
function updateApplicationStyles(tree, options, project) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!stylesEntryPoint) {
|
|
50
|
-
stylesEntryPoint = findStylesEntryPoint(tree, options, project);
|
|
51
|
-
if (!stylesEntryPoint) {
|
|
52
|
-
throw new Error((0, devkit_1.stripIndents) `Could not find a styles entry point for project "${options.project}".
|
|
28
|
+
let stylesEntryPoint = options.stylesEntryPoint;
|
|
29
|
+
if (stylesEntryPoint && !tree.exists(stylesEntryPoint)) throw new Error(`The provided styles entry point "${stylesEntryPoint}" could not be found.`);
|
|
30
|
+
if (!stylesEntryPoint) {
|
|
31
|
+
stylesEntryPoint = findStylesEntryPoint(tree, options, project);
|
|
32
|
+
if (!stylesEntryPoint) throw new Error(_nx_devkit.stripIndents`Could not find a styles entry point for project "${options.project}".
|
|
53
33
|
Please specify a styles entry point using the "--stylesEntryPoint" option.`);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
tree.write(stylesEntryPoint, (0, devkit_1.stripIndents) `@tailwind base;
|
|
59
|
-
@tailwind components;
|
|
60
|
-
@tailwind utilities;
|
|
34
|
+
}
|
|
35
|
+
if (!stylesEntryPoint.endsWith(".css")) throw new Error(`Tailwind CSS v4 is not compatible with any css preprocessors like sass or less. Please use a css file as the styles entry point.`);
|
|
36
|
+
const stylesEntryPointContent = tree.read(stylesEntryPoint, "utf-8");
|
|
37
|
+
tree.write(stylesEntryPoint, _nx_devkit.stripIndents`@import "tailwindcss";
|
|
61
38
|
|
|
62
|
-
${stylesEntryPointContent}`);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
if (!isStyleEntryPointCss(stylesEntryPoint)) {
|
|
66
|
-
throw new Error(`Tailwind CSS v4 is not compatible with any css preprocessors like sass or less. Please use a css file as the styles entry point.`);
|
|
67
|
-
}
|
|
68
|
-
tree.write(stylesEntryPoint, (0, devkit_1.stripIndents) `@import "tailwindcss";
|
|
69
39
|
|
|
70
|
-
|
|
71
|
-
${stylesEntryPointContent}`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function isStyleEntryPointCss(stylesEntryPoint) {
|
|
75
|
-
return stylesEntryPoint.endsWith('.css');
|
|
40
|
+
${stylesEntryPointContent}`);
|
|
76
41
|
}
|
|
77
42
|
function findStylesEntryPoint(tree, options, project) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
: s.input.startsWith(project.root) &&
|
|
98
|
-
s.inject !== false &&
|
|
99
|
-
tree.exists(s.input));
|
|
100
|
-
if (!style) {
|
|
101
|
-
return undefined;
|
|
102
|
-
}
|
|
103
|
-
return typeof style === 'string' ? style : style.input;
|
|
104
|
-
}
|
|
105
|
-
function addTailwindConfigPathToProject(tree, options, project) {
|
|
106
|
-
const buildTarget = project.targets?.[options.buildTarget];
|
|
107
|
-
if (!buildTarget) {
|
|
108
|
-
throw new Error((0, devkit_1.stripIndents) `The target "${options.buildTarget}" was not found for project "${options.project}".
|
|
109
|
-
If you are using a different build target, please provide it using the "--buildTarget" option.
|
|
110
|
-
If the project is not a buildable or publishable library, you don't need to setup TailwindCSS for it.`);
|
|
111
|
-
}
|
|
112
|
-
if (buildTarget.options?.tailwindConfig &&
|
|
113
|
-
tree.exists(buildTarget.options.tailwindConfig)) {
|
|
114
|
-
throw new Error((0, devkit_1.stripIndents) `The "${buildTarget.options.tailwindConfig}" file is already configured for the project "${options.project}". Are you sure this is the right project to set up Tailwind?
|
|
115
|
-
If you are sure, you can remove the configuration and re-run the generator.`);
|
|
116
|
-
}
|
|
117
|
-
const tailwindInstalledVersion = detectTailwindInstalledVersion(tree);
|
|
118
|
-
if (tailwindInstalledVersion === '2') {
|
|
119
|
-
buildTarget.options = {
|
|
120
|
-
...buildTarget.options,
|
|
121
|
-
tailwindConfig: (0, devkit_1.joinPathFragments)(project.root, 'tailwind.config.js'),
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
buildTarget.options = {
|
|
126
|
-
...buildTarget.options,
|
|
127
|
-
tailwindConfig: (0, devkit_1.joinPathFragments)(project.root, 'tailwind.config.ts'),
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
(0, devkit_1.updateProjectConfiguration)(tree, options.project, project);
|
|
131
|
-
}
|
|
132
|
-
function addTailwindConfigFile(tree, options, project) {
|
|
133
|
-
if (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'tailwind.config.js'))) {
|
|
134
|
-
throw new Error((0, devkit_1.stripIndents) `The "tailwind.config" file already exists in the project "${options.project}". Are you sure this is the right project to set up Tailwind?
|
|
135
|
-
If you are sure, you can remove the existing file and re-run the generator.`);
|
|
136
|
-
}
|
|
137
|
-
const tailwindInstalledVersion = detectTailwindInstalledVersion(tree);
|
|
138
|
-
if (tailwindInstalledVersion === '2') {
|
|
139
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'tailwind/v2'), project.root, {
|
|
140
|
-
relativeSourceRoot: (0, node_path_1.relative)(project.root, project.sourceRoot),
|
|
141
|
-
template: '',
|
|
142
|
-
});
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
if (tailwindInstalledVersion === '3') {
|
|
146
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'tailwind/v3'), project.root, {
|
|
147
|
-
relativeSourceRoot: (0, node_path_1.relative)(project.root, project.sourceRoot),
|
|
148
|
-
template: '',
|
|
149
|
-
});
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
if (tailwindInstalledVersion === '4') {
|
|
153
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'tailwind/v4'), project.root, {
|
|
154
|
-
relativeSourceRoot: (0, node_path_1.relative)(project.root, project.sourceRoot),
|
|
155
|
-
template: '',
|
|
156
|
-
});
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
43
|
+
const stylesEntryPoint = [
|
|
44
|
+
(0, _nx_devkit.joinPathFragments)(project.sourceRoot ?? project.root, "styles.css"),
|
|
45
|
+
(0, _nx_devkit.joinPathFragments)(project.sourceRoot ?? project.root, "styles.scss"),
|
|
46
|
+
(0, _nx_devkit.joinPathFragments)(project.sourceRoot ?? project.root, "styles.sass"),
|
|
47
|
+
(0, _nx_devkit.joinPathFragments)(project.sourceRoot ?? project.root, "styles.less")
|
|
48
|
+
].find((s) => tree.exists(s));
|
|
49
|
+
if (stylesEntryPoint) return stylesEntryPoint;
|
|
50
|
+
const styles = project.targets?.[options.buildTarget].options?.styles;
|
|
51
|
+
if (!styles) return;
|
|
52
|
+
const style = styles.find((s) => typeof s === "string" ? s.startsWith(project.root) && tree.exists(s) : s.input.startsWith(project.root) && s.inject !== false && tree.exists(s.input));
|
|
53
|
+
if (!style) return;
|
|
54
|
+
return typeof style === "string" ? style : style.input;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
exports.addTailwindRequiredPackages = addTailwindRequiredPackages;
|
|
58
|
+
exports.detectTailwindInstalledVersion = detectTailwindInstalledVersion;
|
|
59
|
+
exports.normalizeOptions = normalizeOptions;
|
|
60
|
+
exports.updateApplicationStyles = updateApplicationStyles;
|
|
61
|
+
|
|
160
62
|
//# sourceMappingURL=add-tailwind-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-tailwind-helpers.js","
|
|
1
|
+
{"version":3,"file":"add-tailwind-helpers.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-tailwind-helpers.ts"],"sourcesContent":["import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver';\nimport { getTailwindDependencies } from '../versions/tailwind-dependencies';\nimport { lt } from 'semver';\nimport {\n Tree,\n readJson,\n addDependenciesToPackageJson,\n GeneratorCallback,\n ProjectConfiguration,\n joinPathFragments,\n stripIndents,\n} from '@nx/devkit';\nimport {\n GeneratorOptions,\n NormalizedGeneratorOptions,\n} from './add-tailwind-config';\n\nexport function normalizeOptions(\n options: GeneratorOptions,\n): NormalizedGeneratorOptions {\n return {\n ...options,\n buildTarget: options.buildTarget || 'build',\n };\n}\n\nexport function detectTailwindInstalledVersion(\n tree: Tree,\n): '4' | '5' | undefined {\n const { dependencies, devDependencies } = readJson(tree, 'package.json');\n const tailwindVersion =\n dependencies?.tailwindcss ?? devDependencies?.tailwindcss;\n\n if (!tailwindVersion) {\n return undefined;\n }\n\n const version = checkAndCleanWithSemver('tailwindcss', tailwindVersion);\n if (lt(version, '4.0.0')) {\n throw new Error(\n `The Tailwind CSS version \"${tailwindVersion}\" is not supported. Please upgrade to v4.0.0 or higher.`,\n );\n }\n return lt(version, '5.0.0') ? '4' : '5';\n}\n\nexport function addTailwindRequiredPackages(tree: Tree): GeneratorCallback {\n const pkgVersions = getTailwindDependencies();\n return addDependenciesToPackageJson(\n tree,\n {\n tailwindcss: pkgVersions.tailwindcss,\n '@tailwindcss/vite': pkgVersions['@tailwindcss/vite'],\n },\n {},\n );\n}\n\nexport function updateApplicationStyles(\n tree: Tree,\n options: NormalizedGeneratorOptions,\n project: ProjectConfiguration,\n): void {\n let stylesEntryPoint = options.stylesEntryPoint;\n\n if (stylesEntryPoint && !tree.exists(stylesEntryPoint)) {\n throw new Error(\n `The provided styles entry point \"${stylesEntryPoint}\" could not be found.`,\n );\n }\n\n if (!stylesEntryPoint) {\n stylesEntryPoint = findStylesEntryPoint(tree, options, project);\n\n if (!stylesEntryPoint) {\n throw new Error(\n stripIndents`Could not find a styles entry point for project \"${options.project}\".\n Please specify a styles entry point using the \"--stylesEntryPoint\" option.`,\n );\n }\n }\n\n if (!stylesEntryPoint.endsWith('.css')) {\n throw new Error(\n `Tailwind CSS v4 is not compatible with any css preprocessors like sass or less. Please use a css file as the styles entry point.`,\n );\n }\n\n const stylesEntryPointContent = tree.read(stylesEntryPoint, 'utf-8');\n\n tree.write(\n stylesEntryPoint,\n stripIndents`@import \"tailwindcss\";\n\n\n ${stylesEntryPointContent}`,\n );\n}\n\nfunction findStylesEntryPoint(\n tree: Tree,\n options: NormalizedGeneratorOptions,\n project: ProjectConfiguration,\n): string | undefined {\n // first check for common names\n const possibleStylesEntryPoints = [\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.css'),\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.scss'),\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.sass'),\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.less'),\n ];\n\n const stylesEntryPoint = possibleStylesEntryPoints.find((s) =>\n tree.exists(s),\n );\n if (stylesEntryPoint) {\n return stylesEntryPoint;\n }\n\n // then check for the specified styles in the build configuration if it exists\n const styles: Array<string | { input: string; inject: boolean }> =\n project.targets?.[options.buildTarget].options?.styles;\n\n if (!styles) {\n return undefined;\n }\n\n // find the first style that belongs to the project source\n const style = styles.find((s) =>\n typeof s === 'string'\n ? s.startsWith(project.root) && tree.exists(s)\n : s.input.startsWith(project.root) &&\n s.inject !== false &&\n tree.exists(s.input),\n );\n\n if (!style) {\n return undefined;\n }\n\n return typeof style === 'string' ? style : style.input;\n}\n"],"mappings":";;;;;AAiBA,SAAgB,iBACd,SAC4B;AAC5B,QAAO;EACL,GAAG;EACH,aAAa,QAAQ,eAAe;EACrC;;AAGH,SAAgB,+BACd,MACuB;CACvB,MAAM,EAAE,cAAc,qBAAA,GAAA,WAAA,UAA6B,MAAM,eAAe;CACxE,MAAM,kBACJ,cAAc,eAAe,iBAAiB;AAEhD,KAAI,CAAC,gBACH;CAGF,MAAM,WAAA,GAAA,4BAAA,yBAAkC,eAAe,gBAAgB;AACvE,MAAA,GAAA,OAAA,IAAO,SAAS,QAAQ,CACtB,OAAM,IAAI,MACR,6BAA6B,gBAAgB,yDAC9C;AAEH,SAAA,GAAA,OAAA,IAAU,SAAS,QAAQ,GAAG,MAAM;;AAGtC,SAAgB,4BAA4B,MAA+B;CACzE,MAAM,cAAc,8BAAA,yBAAyB;AAC7C,SAAA,GAAA,WAAA,8BACE,MACA;EACE,aAAa,YAAY;EACzB,qBAAqB,YAAY;EAClC,EACD,EAAE,CACH;;AAGH,SAAgB,wBACd,MACA,SACA,SACM;CACN,IAAI,mBAAmB,QAAQ;AAE/B,KAAI,oBAAoB,CAAC,KAAK,OAAO,iBAAiB,CACpD,OAAM,IAAI,MACR,oCAAoC,iBAAiB,uBACtD;AAGH,KAAI,CAAC,kBAAkB;AACrB,qBAAmB,qBAAqB,MAAM,SAAS,QAAQ;AAE/D,MAAI,CAAC,iBACH,OAAM,IAAI,MACR,WAAA,YAAY,oDAAoD,QAAQ,QAAQ;oFAEjF;;AAIL,KAAI,CAAC,iBAAiB,SAAS,OAAO,CACpC,OAAM,IAAI,MACR,mIACD;CAGH,MAAM,0BAA0B,KAAK,KAAK,kBAAkB,QAAQ;AAEpE,MAAK,MACH,kBACA,WAAA,YAAY;;;MAGV,0BACH;;AAGH,SAAS,qBACP,MACA,SACA,SACoB;CASpB,MAAM,mBAP4B;oCACd,QAAQ,cAAc,QAAQ,MAAM,aAAa;oCACjD,QAAQ,cAAc,QAAQ,MAAM,cAAc;oCAClD,QAAQ,cAAc,QAAQ,MAAM,cAAc;oCAClD,QAAQ,cAAc,QAAQ,MAAM,cAAc;EACrE,CAEkD,MAAM,MACvD,KAAK,OAAO,EAAE,CACf;AACD,KAAI,iBACF,QAAO;CAIT,MAAM,SACJ,QAAQ,UAAU,QAAQ,aAAa,SAAS;AAElD,KAAI,CAAC,OACH;CAIF,MAAM,QAAQ,OAAO,MAAM,MACzB,OAAO,MAAM,WACT,EAAE,WAAW,QAAQ,KAAK,IAAI,KAAK,OAAO,EAAE,GAC5C,EAAE,MAAM,WAAW,QAAQ,KAAK,IAChC,EAAE,WAAW,SACb,KAAK,OAAO,EAAE,MAAM,CACzB;AAED,KAAI,CAAC,MACH;AAGF,QAAO,OAAO,UAAU,WAAW,QAAQ,MAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Tree } from
|
|
1
|
+
import { Tree } from "@nx/devkit";
|
|
2
2
|
export declare function initVite(tree: Tree): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Tree } from
|
|
2
|
-
import { NormalizedOptions } from
|
|
1
|
+
import { Tree } from "@nx/devkit";
|
|
2
|
+
import { NormalizedOptions } from "../generator";
|
|
3
3
|
export declare function cleanupFiles(tree: Tree, options: NormalizedOptions): void;
|