@bleedingdev/modern-js-app-tools 3.8.3-ultramodern.1 → 3.8.3-ultramodern.2
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/bin/modern-bundle-docs.js +11 -0
- package/bin/modern.js +11 -0
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +13 -241
- package/dist/cjs/builder/generator/index.js +0 -1
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +37 -9
- package/dist/cjs/builder/shared/builderPlugins/index.js +6 -13
- package/dist/cjs/builder/shared/bundlerPlugins/index.js +6 -13
- package/dist/cjs/builder/shared/lazyCompilation.js +9 -9
- package/dist/cjs/bundleDocs.js +1 -1
- package/dist/cjs/index.js +59 -60
- package/dist/cjs/plugins/analyze/getServerRoutes.js +1 -1
- package/dist/cjs/plugins/analyze/isDefaultExportFunction.js +1 -9
- package/dist/cjs/plugins/backend-federation/codegen.js +2 -1
- package/dist/cjs/plugins/backend-federation/config.js +2 -2
- package/dist/cjs/plugins/backend-federation/emit.js +6 -4
- package/dist/cjs/plugins/deploy/index.js +4 -4
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +23 -149
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.cjs +41 -62
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.mjs +41 -63
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.cjs +35 -52
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.mjs +35 -53
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.cjs +41 -61
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.mjs +40 -61
- package/dist/cjs/plugins/ultramodernReleaseEnvelope.js +3 -59
- package/dist/cjs/presetUltramodern.js +9 -4
- package/dist/cjs/run/index.js +9 -9
- package/dist/cjs/utils/register.js +6 -3
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +12 -231
- package/dist/esm/builder/generator/index.mjs +1 -2
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +34 -9
- package/dist/esm/builder/shared/builderPlugins/index.mjs +0 -1
- package/dist/esm/builder/shared/bundlerPlugins/index.mjs +0 -1
- package/dist/esm/builder/shared/lazyCompilation.mjs +4 -4
- package/dist/esm/bundleDocs.mjs +1 -1
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/plugins/analyze/getServerRoutes.mjs +1 -1
- package/dist/esm/plugins/analyze/isDefaultExportFunction.mjs +1 -9
- package/dist/esm/plugins/backend-federation/codegen.mjs +2 -1
- package/dist/esm/plugins/backend-federation/config.mjs +1 -1
- package/dist/esm/plugins/backend-federation/emit.mjs +5 -3
- package/dist/esm/plugins/deploy/index.mjs +1 -1
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -133
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.cjs +41 -62
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.mjs +41 -63
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.cjs +35 -52
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.mjs +35 -53
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.cjs +41 -61
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.mjs +40 -61
- package/dist/esm/plugins/ultramodernReleaseEnvelope.mjs +3 -49
- package/dist/esm/presetUltramodern.mjs +2 -1
- package/dist/esm/run/index.mjs +9 -9
- package/dist/esm/utils/register.mjs +6 -3
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +12 -234
- package/dist/esm-node/builder/generator/index.mjs +1 -2
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +34 -9
- package/dist/esm-node/builder/shared/builderPlugins/index.mjs +0 -1
- package/dist/esm-node/builder/shared/bundlerPlugins/index.mjs +0 -1
- package/dist/esm-node/builder/shared/lazyCompilation.mjs +4 -4
- package/dist/esm-node/bundleDocs.mjs +1 -1
- package/dist/esm-node/index.mjs +3 -3
- package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +1 -1
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +1 -9
- package/dist/esm-node/plugins/backend-federation/codegen.mjs +2 -1
- package/dist/esm-node/plugins/backend-federation/config.mjs +1 -1
- package/dist/esm-node/plugins/backend-federation/emit.mjs +5 -3
- package/dist/esm-node/plugins/deploy/index.mjs +1 -1
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -133
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.cjs +41 -62
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.mjs +41 -63
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.cjs +35 -52
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.mjs +35 -53
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.cjs +41 -61
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.mjs +40 -61
- package/dist/esm-node/plugins/ultramodernReleaseEnvelope.mjs +3 -49
- package/dist/esm-node/presetUltramodern.mjs +2 -1
- package/dist/esm-node/run/index.mjs +9 -9
- package/dist/esm-node/utils/register.mjs +6 -3
- package/dist/types/builder/generator/getBuilderEnvironments.d.ts +0 -29
- package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +11 -0
- package/dist/types/builder/shared/builderPlugins/index.d.ts +0 -1
- package/dist/types/builder/shared/bundlerPlugins/index.d.ts +0 -1
- package/dist/types/builder/shared/lazyCompilation.d.ts +7 -7
- package/dist/types/plugins/analyze/getServerRoutes.d.ts +1 -1
- package/dist/types/plugins/backend-federation/codegen.d.ts +4 -1
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/index.d.ts +1 -18
- package/dist/types/presetUltramodern.d.ts +1 -0
- package/dist/types/types/config/deploy.d.ts +2 -2
- package/docs/community/showcase.md +3 -5
- package/docs/guides/advanced-features/bff/frameworks.md +1 -1
- package/docs/guides/basic-features/deploy.md +2 -2
- package/docs/guides/get-started/quick-start.md +9 -8
- package/docs/guides/get-started/tech-stack.md +1 -1
- package/docs/guides/get-started/ultramodern.md +18 -18
- package/docs/guides/troubleshooting/cli.md +1 -1
- package/docs/llms.txt +2 -2
- package/docs/tutorials/examples/csr-auth.md +1 -1
- package/package.json +15 -27
- package/rslib.config.mts +4 -7
- package/dist/cjs/builder/shared/builderPlugins/adapterLazyCompilation.js +0 -74
- package/dist/cjs/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.js +0 -72
- package/dist/cjs/plugins/deploy/platforms/cloudflare/artifacts.js +0 -127
- package/dist/cjs/plugins/deploy/platforms/cloudflare/constants.js +0 -141
- package/dist/cjs/plugins/deploy/platforms/cloudflare/delivery-unit.js +0 -139
- package/dist/cjs/plugins/deploy/platforms/cloudflare/i18n-worker.js +0 -135
- package/dist/cjs/plugins/deploy/platforms/cloudflare/index.js +0 -150
- package/dist/cjs/plugins/deploy/platforms/cloudflare/security-policies.js +0 -205
- package/dist/cjs/plugins/deploy/platforms/cloudflare/types.js +0 -18
- package/dist/cjs/plugins/deploy/platforms/cloudflare/utils.js +0 -66
- package/dist/cjs/plugins/deploy/platforms/cloudflare/worker-manifest.js +0 -208
- package/dist/cjs/plugins/deploy/platforms/cloudflare/wrangler-config.js +0 -204
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-contract.js +0 -108
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-plan.js +0 -93
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/identity.js +0 -83
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/issues.js +0 -54
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/manifest.js +0 -89
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.js +0 -151
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +0 -378
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -251
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -191
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -514
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -1012
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -363
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +0 -93
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +0 -98
- package/dist/cjs/types/config/cloudflareDeploy.js +0 -18
- package/dist/cjs/ultramodern-release-envelope/canonical.js +0 -68
- package/dist/cjs/ultramodern-release-envelope/framework-output.js +0 -649
- package/dist/cjs/ultramodern-release-envelope/index.js +0 -399
- package/dist/cjs/ultramodern-release-envelope/types.js +0 -51
- package/dist/cjs/ultramodern-release-identity.js +0 -110
- package/dist/esm/builder/shared/builderPlugins/adapterLazyCompilation.mjs +0 -36
- package/dist/esm/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +0 -30
- package/dist/esm/plugins/deploy/platforms/cloudflare/artifacts.mjs +0 -64
- package/dist/esm/plugins/deploy/platforms/cloudflare/constants.mjs +0 -34
- package/dist/esm/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +0 -88
- package/dist/esm/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +0 -97
- package/dist/esm/plugins/deploy/platforms/cloudflare/index.mjs +0 -102
- package/dist/esm/plugins/deploy/platforms/cloudflare/security-policies.mjs +0 -167
- package/dist/esm/plugins/deploy/platforms/cloudflare/types.mjs +0 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/utils.mjs +0 -12
- package/dist/esm/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +0 -148
- package/dist/esm/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +0 -150
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-contract.mjs +0 -31
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-plan.mjs +0 -45
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +0 -45
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +0 -10
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +0 -51
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +0 -99
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +0 -313
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -251
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -191
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -514
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -1012
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -363
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +0 -93
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +0 -98
- package/dist/esm/types/config/cloudflareDeploy.mjs +0 -0
- package/dist/esm/ultramodern-release-envelope/canonical.mjs +0 -21
- package/dist/esm/ultramodern-release-envelope/framework-output.mjs +0 -573
- package/dist/esm/ultramodern-release-envelope/index.mjs +0 -335
- package/dist/esm/ultramodern-release-envelope/types.mjs +0 -7
- package/dist/esm/ultramodern-release-identity.mjs +0 -66
- package/dist/esm-node/builder/shared/builderPlugins/adapterLazyCompilation.mjs +0 -37
- package/dist/esm-node/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +0 -31
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/artifacts.mjs +0 -65
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/constants.mjs +0 -35
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +0 -89
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +0 -98
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/index.mjs +0 -103
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/security-policies.mjs +0 -168
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/types.mjs +0 -1
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/utils.mjs +0 -13
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +0 -149
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +0 -151
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-contract.mjs +0 -32
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-plan.mjs +0 -46
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +0 -46
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +0 -11
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +0 -52
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +0 -100
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +0 -314
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -251
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -191
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -514
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -1012
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -363
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +0 -93
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +0 -98
- package/dist/esm-node/types/config/cloudflareDeploy.mjs +0 -1
- package/dist/esm-node/ultramodern-release-envelope/canonical.mjs +0 -22
- package/dist/esm-node/ultramodern-release-envelope/framework-output.mjs +0 -574
- package/dist/esm-node/ultramodern-release-envelope/index.mjs +0 -336
- package/dist/esm-node/ultramodern-release-envelope/types.mjs +0 -8
- package/dist/esm-node/ultramodern-release-identity.mjs +0 -67
- package/dist/types/builder/shared/builderPlugins/adapterLazyCompilation.d.ts +0 -3
- package/dist/types/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.d.ts +0 -6
- package/dist/types/plugins/deploy/platforms/cloudflare/artifacts.d.ts +0 -15
- package/dist/types/plugins/deploy/platforms/cloudflare/constants.d.ts +0 -24
- package/dist/types/plugins/deploy/platforms/cloudflare/delivery-unit.d.ts +0 -23
- package/dist/types/plugins/deploy/platforms/cloudflare/i18n-worker.d.ts +0 -22
- package/dist/types/plugins/deploy/platforms/cloudflare/index.d.ts +0 -2
- package/dist/types/plugins/deploy/platforms/cloudflare/security-policies.d.ts +0 -51
- package/dist/types/plugins/deploy/platforms/cloudflare/types.d.ts +0 -5
- package/dist/types/plugins/deploy/platforms/cloudflare/utils.d.ts +0 -6
- package/dist/types/plugins/deploy/platforms/cloudflare/worker-manifest.d.ts +0 -122
- package/dist/types/plugins/deploy/platforms/cloudflare/wrangler-config.d.ts +0 -46
- package/dist/types/plugins/deploy/platforms/cloudflare-output-contract.d.ts +0 -14
- package/dist/types/plugins/deploy/platforms/cloudflare-output-plan.d.ts +0 -34
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/identity.d.ts +0 -4
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/issues.d.ts +0 -14
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/manifest.d.ts +0 -2
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.d.ts +0 -14
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +0 -20
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.d.mts +0 -4
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.d.mts +0 -5
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.d.mts +0 -48
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.d.mts +0 -13
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-path.d.mts +0 -21
- package/dist/types/types/config/cloudflareDeploy.d.ts +0 -161
- package/dist/types/ultramodern-release-envelope/canonical.d.ts +0 -5
- package/dist/types/ultramodern-release-envelope/framework-output.d.ts +0 -32
- package/dist/types/ultramodern-release-envelope/index.d.ts +0 -6
- package/dist/types/ultramodern-release-envelope/types.d.ts +0 -62
- package/dist/types/ultramodern-release-identity.d.ts +0 -16
|
@@ -55,26 +55,27 @@ workspaces. It does not require global installation and can be run on-demand
|
|
|
55
55
|
using `pnpm dlx`.
|
|
56
56
|
|
|
57
57
|
The supported pnpm command is the scoped package specifier:
|
|
58
|
-
`pnpm dlx @bleedingdev/modern-js-create <target>`. Do not shorten it
|
|
59
|
-
`pnpm dlx modern-js-create`; there is no unscoped package by
|
|
58
|
+
`pnpm dlx @bleedingdev/modern-js-ultramodern-create <target>`. Do not shorten it
|
|
59
|
+
to `pnpm dlx modern-js-ultramodern-create`; there is no unscoped package by
|
|
60
|
+
that name.
|
|
60
61
|
|
|
61
62
|
You can initialize the empty directory you are already in:
|
|
62
63
|
|
|
63
64
|
```bash
|
|
64
65
|
mkdir myapp && cd myapp
|
|
65
|
-
pnpm dlx @bleedingdev/modern-js-create .
|
|
66
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create .
|
|
66
67
|
```
|
|
67
68
|
|
|
68
69
|
You can also create a project directly in a new directory:
|
|
69
70
|
|
|
70
71
|
```bash
|
|
71
|
-
pnpm dlx @bleedingdev/modern-js-create my-super-app
|
|
72
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create my-super-app
|
|
72
73
|
```
|
|
73
74
|
|
|
74
75
|
To initialize with workspace protocol dependencies (for local monorepo testing of unreleased Modern.js packages):
|
|
75
76
|
|
|
76
77
|
```bash
|
|
77
|
-
pnpm dlx @bleedingdev/modern-js-create my-super-app --workspace
|
|
78
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create my-super-app --workspace
|
|
78
79
|
```
|
|
79
80
|
|
|
80
81
|
The BleedingDev create package will directly create the application without providing an interactive Q & A interface:
|
|
@@ -125,13 +126,13 @@ The default workspace starts shell-only and installs the published BleedingDev
|
|
|
125
126
|
package aliases:
|
|
126
127
|
|
|
127
128
|
```bash
|
|
128
|
-
pnpm dlx @bleedingdev/modern-js-create my-super-app
|
|
129
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create my-super-app
|
|
129
130
|
```
|
|
130
131
|
|
|
131
132
|
From a generated SuperApp workspace, add a business MicroVertical in place:
|
|
132
133
|
|
|
133
134
|
```bash
|
|
134
|
-
pnpm dlx @bleedingdev/modern-js-create transportation --vertical
|
|
135
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create transportation --vertical
|
|
135
136
|
```
|
|
136
137
|
|
|
137
138
|
The `--vertical` command mutates the current workspace: it adds the vertical
|
|
@@ -164,7 +165,7 @@ Open `http://localhost:8080/` in your browser to see the page content.
|
|
|
164
165
|
|
|
165
166
|
## Configuration
|
|
166
167
|
|
|
167
|
-
In an UltraModern.js project created using `@bleedingdev/modern-js-create`, a `modern.config.ts` file is generated by default.
|
|
168
|
+
In an UltraModern.js project created using `@bleedingdev/modern-js-ultramodern-create`, a `modern.config.ts` file is generated by default.
|
|
168
169
|
|
|
169
170
|
You can modify the configuration through this file to override the default behavior of Modern.js. For example, to enable SSR, add the following configuration:
|
|
170
171
|
|
|
@@ -20,7 +20,7 @@ Modern.js provides two first-party routing frameworks:
|
|
|
20
20
|
When creating an UltraModern project, TanStack Router is included by default:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
pnpm dlx @bleedingdev/modern-js-create myapp
|
|
23
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create myapp
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Modern.js supports conventional routing, self-controlled routing, or other routing schemes. Please refer to ["Routing"](/guides/basic-features/routes/routes.md) to make your choice.
|
|
@@ -64,9 +64,9 @@ For an older generated workspace, migrate by treating the published cohort as
|
|
|
64
64
|
the source of truth:
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
pnpm dlx @bleedingdev/modern-js-create@latest --help
|
|
68
|
-
pnpm dlx @bleedingdev/modern-js-create@latest catalog --vertical --dry-run
|
|
69
|
-
pnpm dlx @bleedingdev/modern-js-create@latest catalog --vertical
|
|
67
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create@latest --help
|
|
68
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create@latest catalog --vertical --dry-run
|
|
69
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create@latest catalog --vertical
|
|
70
70
|
mise install
|
|
71
71
|
mise exec -- pnpm install
|
|
72
72
|
mise exec -- pnpm check
|
|
@@ -86,8 +86,8 @@ package cohort together. Resolve the current cohort version first, then run
|
|
|
86
86
|
the matching migration:
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
-
COHORT="$(npm view @bleedingdev/modern-js-create version)"
|
|
90
|
-
pnpm dlx "@bleedingdev/modern-js-create@$COHORT" ultramodern \
|
|
89
|
+
COHORT="$(npm view @bleedingdev/modern-js-ultramodern-create version)"
|
|
90
|
+
pnpm dlx "@bleedingdev/modern-js-ultramodern-create@$COHORT" ultramodern \
|
|
91
91
|
migrate-strict-effect --version "$COHORT"
|
|
92
92
|
pnpm install
|
|
93
93
|
pnpm check
|
|
@@ -125,8 +125,8 @@ Before hand-editing package aliases or generated metadata, run the framework
|
|
|
125
125
|
migration command from the target workspace:
|
|
126
126
|
|
|
127
127
|
```bash
|
|
128
|
-
COHORT="$(npm view @bleedingdev/modern-js-create version)"
|
|
129
|
-
pnpm dlx "@bleedingdev/modern-js-create@$COHORT" ultramodern \
|
|
128
|
+
COHORT="$(npm view @bleedingdev/modern-js-ultramodern-create version)"
|
|
129
|
+
pnpm dlx "@bleedingdev/modern-js-ultramodern-create@$COHORT" ultramodern \
|
|
130
130
|
migrate-strict-effect --version "$COHORT"
|
|
131
131
|
pnpm api:check
|
|
132
132
|
pnpm contract:check
|
|
@@ -349,7 +349,7 @@ BFF, Module Federation topology, generated quality gates, and Cloudflare deploy
|
|
|
349
349
|
basics:
|
|
350
350
|
|
|
351
351
|
```bash
|
|
352
|
-
pnpm dlx @bleedingdev/modern-js-create myapp
|
|
352
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create myapp
|
|
353
353
|
cd myapp
|
|
354
354
|
mise install
|
|
355
355
|
mise exec -- pnpm install
|
|
@@ -361,10 +361,10 @@ generate a demo domain by default. Add real business MicroVerticals when they
|
|
|
361
361
|
become real ownership boundaries:
|
|
362
362
|
|
|
363
363
|
```bash
|
|
364
|
-
pnpm dlx @bleedingdev/modern-js-create transportation --vertical
|
|
365
|
-
pnpm dlx @bleedingdev/modern-js-create food-delivery --vertical
|
|
366
|
-
pnpm dlx @bleedingdev/modern-js-create payments --vertical
|
|
367
|
-
pnpm dlx @bleedingdev/modern-js-create maps --vertical
|
|
364
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create transportation --vertical
|
|
365
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create food-delivery --vertical
|
|
366
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create payments --vertical
|
|
367
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create maps --vertical
|
|
368
368
|
mise exec -- pnpm check
|
|
369
369
|
```
|
|
370
370
|
|
|
@@ -380,10 +380,10 @@ Automation can use explicit MicroVertical syntax instead of relying on the
|
|
|
380
380
|
positional form:
|
|
381
381
|
|
|
382
382
|
```bash
|
|
383
|
-
pnpm dlx @bleedingdev/modern-js-create --vertical=transportation
|
|
384
|
-
pnpm dlx @bleedingdev/modern-js-create --vertical-name transportation
|
|
385
|
-
pnpm dlx @bleedingdev/modern-js-create transportation --vertical --dry-run
|
|
386
|
-
pnpm dlx @bleedingdev/modern-js-create transportation --vertical \
|
|
383
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create --vertical=transportation
|
|
384
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create --vertical-name transportation
|
|
385
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create transportation --vertical --dry-run
|
|
386
|
+
pnpm dlx @bleedingdev/modern-js-ultramodern-create transportation --vertical \
|
|
387
387
|
--codesmith-overlay ./generators/vertical-overlay
|
|
388
388
|
```
|
|
389
389
|
|
|
@@ -402,7 +402,7 @@ import {
|
|
|
402
402
|
addUltramodernVertical,
|
|
403
403
|
generateUltramodernWorkspace,
|
|
404
404
|
planUltramodernVertical,
|
|
405
|
-
} from '@modern-js/create/ultramodern-workspace';
|
|
405
|
+
} from '@modern-js/ultramodern-create/ultramodern-workspace';
|
|
406
406
|
|
|
407
407
|
const workspace = generateUltramodernWorkspace({
|
|
408
408
|
targetDir: '/tmp/my-workspace',
|
|
@@ -434,7 +434,7 @@ returns the same shape plus `dryRun`, `selectedPort`, `moduleFederationRemote`,
|
|
|
434
434
|
CodeSmith consumers can use the adapter subpath:
|
|
435
435
|
|
|
436
436
|
```ts
|
|
437
|
-
import ultramodernCodeSmith from '@modern-js/create/ultramodern-workspace/codesmith';
|
|
437
|
+
import ultramodernCodeSmith from '@modern-js/ultramodern-create/ultramodern-workspace/codesmith';
|
|
438
438
|
|
|
439
439
|
await ultramodernCodeSmith({
|
|
440
440
|
config: {
|
|
@@ -31,5 +31,5 @@ pnpm run command --options
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
:::tip
|
|
34
|
-
|
|
34
|
+
UltraModern.js requires Node.js >= 26.7.0 and pnpm >= 11. Use the repository's pinned mise toolchain so the CLI and native TypeScript runtime stay aligned.
|
|
35
35
|
:::
|
package/docs/llms.txt
CHANGED
|
@@ -274,12 +274,12 @@
|
|
|
274
274
|
|
|
275
275
|
## Examples
|
|
276
276
|
|
|
277
|
-
- [Route Authorization](/tutorials/examples/csr-auth.md):
|
|
277
|
+
- [Route Authorization](/tutorials/examples/csr-auth.md): UltraModern.js uses convention-based routing backed by TanStack Router. For more details, please refer to Routing. In a web application, if there are multiple routes, we may need to authorize access to some of them before accessing them. For example, in the following scenario: Access to the / route does not require authorization and can be accessed directly.Access to the /protected route requires authorization. If there is no authorization, it will automatically redirect to the /login route. After successful login, it returns to /protected. <Sandpack template="web-app" files={{ ...ultramodernSandpackFiles, '/src/routes/page.tsx': srcRoutesPageText, '/src/routes/layout.tsx': srcRoutesLayoutText, '/src/routes/Auth.tsx': srcRoutesAuthText, '/src/routes/fakeAuth.ts': srcRoutesFakeAuthText, '/src/routes/protected/page.tsx': srcRoutesProtectedPageText, '/src/routes/login/page.tsx': srcRoutesLoginPageText, }}>
|
|
278
278
|
- [Introduction](/tutorials/foundations/introduction.md): Welcome to Modern.js Example Library! Here you'll find practical code examples to help you get started with Modern.js quickly. If you're new to Modern.js, we recommend reading the Modern.js Introduction first.
|
|
279
279
|
|
|
280
280
|
## Community
|
|
281
281
|
|
|
282
|
-
- [
|
|
282
|
+
- [Ecosystem](/community/showcase.md): UltraModern.js builds on a focused ecosystem of frameworks and tools. These projects provide the Effect, TanStack Router, build, documentation, and Module Federation foundations used by the fork.
|
|
283
283
|
- [Meet the Team](/community/team.md): The development of Modern.js is driven by ByteDance's Modern.js team and community contributors.
|
|
284
284
|
- [Releases](/community/releases.md)
|
|
285
285
|
- [Contributing Guide](/community/contributing-guide.md): Thanks for that you are interested in contributing to Modern.js. Before starting your contribution, please take a moment to read the following guidelines.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Route Authorization
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
UltraModern.js uses convention-based routing backed by TanStack Router. For more details, please refer to [Routing](/guides/basic-features/routes/routes.md#routing).
|
|
4
4
|
|
|
5
5
|
In a web application, if there are multiple routes, we may need to authorize access to some of them before accessing them. For example, in the following scenario:
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.8.3-ultramodern.
|
|
20
|
+
"version": "3.8.3-ultramodern.2",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
|
-
"node": ">=
|
|
78
|
+
"node": ">=26.7.0"
|
|
79
79
|
},
|
|
80
80
|
"typesVersions": {
|
|
81
81
|
"*": {
|
|
@@ -134,16 +134,18 @@
|
|
|
134
134
|
"@babel/traverse": "^8.0.0",
|
|
135
135
|
"@babel/types": "^8.0.0",
|
|
136
136
|
"@loadable/component": "5.16.7",
|
|
137
|
-
"@modern-js/
|
|
138
|
-
"@modern-js/
|
|
139
|
-
"@modern-js/
|
|
140
|
-
"@modern-js/plugin
|
|
141
|
-
"@modern-js/
|
|
142
|
-
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.8.3-ultramodern.
|
|
143
|
-
"@modern-js/server
|
|
144
|
-
"@modern-js/server-
|
|
145
|
-
"@modern-js/
|
|
146
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.8.3-ultramodern.
|
|
137
|
+
"@modern-js/app-tools-extensions": "npm:@bleedingdev/modern-js-app-tools-extensions@3.8.3-ultramodern.2",
|
|
138
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.8.3-ultramodern.2",
|
|
139
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.8.3-ultramodern.2",
|
|
140
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.8.3-ultramodern.2",
|
|
141
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.8.3-ultramodern.2",
|
|
142
|
+
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.8.3-ultramodern.2",
|
|
143
|
+
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.8.3-ultramodern.2",
|
|
144
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.8.3-ultramodern.2",
|
|
145
|
+
"@modern-js/server-runtime-extensions": "npm:@bleedingdev/modern-js-server-runtime-extensions@3.8.3-ultramodern.2",
|
|
146
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.8.3-ultramodern.2",
|
|
147
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.8.3-ultramodern.2",
|
|
148
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.8.3-ultramodern.2",
|
|
147
149
|
"@rsbuild/core": "2.2.0",
|
|
148
150
|
"@swc/core": "1.15.43",
|
|
149
151
|
"@swc/helpers": "^0.5.23",
|
|
@@ -163,29 +165,15 @@
|
|
|
163
165
|
"@types/babel__traverse": "7.28.0",
|
|
164
166
|
"@types/node": "^26.2.0",
|
|
165
167
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
166
|
-
"ts-node": "^10.9.2",
|
|
167
|
-
"tsconfig-paths": "^4.2.0",
|
|
168
168
|
"typescript": "^7.0.2"
|
|
169
169
|
},
|
|
170
|
-
"peerDependencies": {
|
|
171
|
-
"ts-node": "^10.9.2",
|
|
172
|
-
"tsconfig-paths": "^4.2.0"
|
|
173
|
-
},
|
|
174
|
-
"peerDependenciesMeta": {
|
|
175
|
-
"ts-node": {
|
|
176
|
-
"optional": true
|
|
177
|
-
},
|
|
178
|
-
"tsconfig-paths": {
|
|
179
|
-
"optional": true
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
170
|
"sideEffects": false,
|
|
183
171
|
"publishConfig": {
|
|
184
172
|
"access": "public"
|
|
185
173
|
},
|
|
186
174
|
"scripts": {
|
|
187
175
|
"dev": "rslib build --watch",
|
|
188
|
-
"build": "rslib build && pnpm
|
|
176
|
+
"build": "rslib build && pnpm run verify:public-surface && node ./bin/modern-bundle-docs.js",
|
|
189
177
|
"verify:public-surface": "node ./tests/config/verify-public-surface.mjs",
|
|
190
178
|
"test": "rstest"
|
|
191
179
|
}
|
package/rslib.config.mts
CHANGED
|
@@ -14,7 +14,6 @@ export default defineConfig({
|
|
|
14
14
|
source: {
|
|
15
15
|
...libConfig.source,
|
|
16
16
|
entry: {
|
|
17
|
-
// Deploy templates are copy-only; `src/esm` still needs compiled CJS.
|
|
18
17
|
index: APP_TOOLS_CODE_ENTRY_GLOBS,
|
|
19
18
|
},
|
|
20
19
|
},
|
|
@@ -28,6 +27,10 @@ export default defineConfig({
|
|
|
28
27
|
// `.js`, so there the copy is the only thing providing the `.mjs`
|
|
29
28
|
// loaders that `register()` resolves by name; keep it for that alone.
|
|
30
29
|
copy: [
|
|
30
|
+
{
|
|
31
|
+
from: './src/plugins/deploy/platforms/templates',
|
|
32
|
+
to: './plugins/deploy/platforms/templates',
|
|
33
|
+
},
|
|
31
34
|
...(libConfig.format === 'esm'
|
|
32
35
|
? []
|
|
33
36
|
: [
|
|
@@ -36,12 +39,6 @@ export default defineConfig({
|
|
|
36
39
|
to: './esm',
|
|
37
40
|
},
|
|
38
41
|
]),
|
|
39
|
-
{
|
|
40
|
-
from: './src/plugins/deploy/platforms/templates',
|
|
41
|
-
to: './plugins/deploy/platforms/templates',
|
|
42
|
-
// These JavaScript-named assets must bypass Rspack's minimizer.
|
|
43
|
-
info: { minimized: true },
|
|
44
|
-
},
|
|
45
42
|
],
|
|
46
43
|
},
|
|
47
44
|
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
-
var define = (defs, kind)=>{
|
|
6
|
-
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
[kind]: defs[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
define(getters, "get");
|
|
12
|
-
define(values, "value");
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
-
})();
|
|
18
|
-
(()=>{
|
|
19
|
-
__webpack_require__.r = (exports1)=>{
|
|
20
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
-
value: 'Module'
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
-
value: true
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
})();
|
|
28
|
-
var __webpack_exports__ = {};
|
|
29
|
-
__webpack_require__.r(__webpack_exports__);
|
|
30
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
-
builderPluginAdapterLazyCompilation: ()=>builderPluginAdapterLazyCompilation
|
|
32
|
-
});
|
|
33
|
-
const utils_namespaceObject = require("@modern-js/utils");
|
|
34
|
-
const external_lazyCompilation_js_namespaceObject = require("../lazyCompilation.js");
|
|
35
|
-
const builderPluginAdapterLazyCompilation = (options)=>({
|
|
36
|
-
name: 'builder-plugin-adapter-modern-lazy-compilation',
|
|
37
|
-
setup (api) {
|
|
38
|
-
api.modifyRsbuildConfig((config)=>{
|
|
39
|
-
const lazyCompilation = getRouteEagerLazyCompilation(options, config);
|
|
40
|
-
if (void 0 === lazyCompilation) return config;
|
|
41
|
-
return {
|
|
42
|
-
...config,
|
|
43
|
-
dev: {
|
|
44
|
-
...config.dev,
|
|
45
|
-
lazyCompilation
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
function getRouteEagerLazyCompilation(options, config) {
|
|
52
|
-
const current = config.dev?.lazyCompilation;
|
|
53
|
-
if (!current || (0, utils_namespaceObject.isUseRsc)(options.normalizedConfig)) return;
|
|
54
|
-
const plan = (0, external_lazyCompilation_js_namespaceObject.planRouteEagerLazyCompilation)(current, (0, external_lazyCompilation_js_namespaceObject.aggregateEagerRouteComponentFiles)(options.eagerRouteComponentFilesByEntry));
|
|
55
|
-
if (!plan.apply) {
|
|
56
|
-
if (plan.unresolvedByEntry) warnUnresolvedRouteComponents(options.appContext.appDirectory, plan.unresolvedByEntry);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
return plan.lazyCompilation;
|
|
60
|
-
}
|
|
61
|
-
const warnedLazyApps = new Set();
|
|
62
|
-
function warnUnresolvedRouteComponents(appDirectory, unresolvedByEntry) {
|
|
63
|
-
if (warnedLazyApps.has(appDirectory)) return;
|
|
64
|
-
warnedLazyApps.add(appDirectory);
|
|
65
|
-
const detail = Array.from(unresolvedByEntry).map(([entry, components])=>`${entry}: ${components.join(', ')}`).join('; ');
|
|
66
|
-
utils_namespaceObject.logger.warn(`[lazyCompilation] Skipped route-eager optimization because some route components could not be resolved to a file (${detail}). Lazy compilation may delay route rendering for these routes.`);
|
|
67
|
-
}
|
|
68
|
-
exports.builderPluginAdapterLazyCompilation = __webpack_exports__.builderPluginAdapterLazyCompilation;
|
|
69
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
70
|
-
"builderPluginAdapterLazyCompilation"
|
|
71
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
72
|
-
Object.defineProperty(exports, '__esModule', {
|
|
73
|
-
value: true
|
|
74
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
-
var define = (defs, kind)=>{
|
|
6
|
-
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
[kind]: defs[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
define(getters, "get");
|
|
12
|
-
define(values, "value");
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
-
})();
|
|
18
|
-
(()=>{
|
|
19
|
-
__webpack_require__.r = (exports1)=>{
|
|
20
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
-
value: 'Module'
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
-
value: true
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
})();
|
|
28
|
-
var __webpack_exports__ = {};
|
|
29
|
-
__webpack_require__.r(__webpack_exports__);
|
|
30
|
-
const PLUGIN_NAME = 'ModernjsCssExtractRuntimePlugin';
|
|
31
|
-
const CSS_LOADING_RUNTIME_MODULE = 'webpack/runtime/css loading';
|
|
32
|
-
const CSS_EXTRACT_STYLESHEET_MATCH = '\t\tif (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag;';
|
|
33
|
-
const CSS_EXTRACT_STYLESHEET_MATCH_WITH_NORMALIZED_URL = `\t\tvar absoluteHref = tag.href;
|
|
34
|
-
\t\tvar absoluteFullHref = new URL(fullhref, document.baseURI).href;
|
|
35
|
-
\t\tif (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref || absoluteHref === absoluteFullHref)) return tag;`;
|
|
36
|
-
const isAutomaticPublicPath = (publicPath)=>'auto' === publicPath || 'auto/' === publicPath;
|
|
37
|
-
const normalizeCssExtractRuntimeStylesheetLookup = (source)=>{
|
|
38
|
-
if (!source.includes('__webpack_require__.miniCssF')) return source;
|
|
39
|
-
const occurrences = source.split(CSS_EXTRACT_STYLESHEET_MATCH).length - 1;
|
|
40
|
-
if (1 !== occurrences) throw new Error(`Unsupported CssExtractRspackPlugin runtime shape: expected one stylesheet lookup, found ${occurrences}.`);
|
|
41
|
-
return source.replace(CSS_EXTRACT_STYLESHEET_MATCH, CSS_EXTRACT_STYLESHEET_MATCH_WITH_NORMALIZED_URL);
|
|
42
|
-
};
|
|
43
|
-
class CssExtractRuntimePlugin {
|
|
44
|
-
apply(compiler) {
|
|
45
|
-
if (!isAutomaticPublicPath(compiler.options.output.publicPath)) return;
|
|
46
|
-
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation)=>{
|
|
47
|
-
compilation.hooks.runtimeModule.tap(PLUGIN_NAME, (runtimeModule)=>{
|
|
48
|
-
if (runtimeModule.identifier() !== CSS_LOADING_RUNTIME_MODULE) return;
|
|
49
|
-
const runtimeSource = runtimeModule.source?.source;
|
|
50
|
-
if ('string' != typeof runtimeSource) return;
|
|
51
|
-
runtimeModule.source.source = normalizeCssExtractRuntimeStylesheetLookup(runtimeSource);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
constructor(){
|
|
56
|
-
this.name = PLUGIN_NAME;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
60
|
-
CssExtractRuntimePlugin: ()=>CssExtractRuntimePlugin
|
|
61
|
-
}, {
|
|
62
|
-
normalizeCssExtractRuntimeStylesheetLookup: normalizeCssExtractRuntimeStylesheetLookup
|
|
63
|
-
});
|
|
64
|
-
exports.CssExtractRuntimePlugin = __webpack_exports__.CssExtractRuntimePlugin;
|
|
65
|
-
exports.normalizeCssExtractRuntimeStylesheetLookup = __webpack_exports__.normalizeCssExtractRuntimeStylesheetLookup;
|
|
66
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
67
|
-
"CssExtractRuntimePlugin",
|
|
68
|
-
"normalizeCssExtractRuntimeStylesheetLookup"
|
|
69
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
-
Object.defineProperty(exports, '__esModule', {
|
|
71
|
-
value: true
|
|
72
|
-
});
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
-
var define = (defs, kind)=>{
|
|
15
|
-
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
[kind]: defs[key]
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
define(getters, "get");
|
|
21
|
-
define(values, "value");
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
(()=>{
|
|
25
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
-
})();
|
|
27
|
-
(()=>{
|
|
28
|
-
__webpack_require__.r = (exports1)=>{
|
|
29
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
-
value: 'Module'
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
-
value: true
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
})();
|
|
37
|
-
var __webpack_exports__ = {};
|
|
38
|
-
__webpack_require__.r(__webpack_exports__);
|
|
39
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
-
copyCloudflareArtifacts: ()=>copyCloudflareArtifacts,
|
|
41
|
-
copyCloudflareD1Migrations: ()=>copyCloudflareD1Migrations,
|
|
42
|
-
copyCloudflarePublicAssets: ()=>copyCloudflarePublicAssets,
|
|
43
|
-
getCloudflareArtifacts: ()=>getCloudflareArtifacts,
|
|
44
|
-
getCloudflarePublicAssets: ()=>getCloudflarePublicAssets,
|
|
45
|
-
readRouteSpec: ()=>readRouteSpec
|
|
46
|
-
});
|
|
47
|
-
const external_node_path_namespaceObject = require("node:path");
|
|
48
|
-
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
49
|
-
const utils_namespaceObject = require("@modern-js/utils");
|
|
50
|
-
const external_constants_js_namespaceObject = require("./constants.js");
|
|
51
|
-
const external_utils_js_namespaceObject = require("./utils.js");
|
|
52
|
-
const normalizeCloudflareArtifact = (artifact, index)=>{
|
|
53
|
-
const from = (0, external_utils_js_namespaceObject.normalizeRelativePath)(artifact.from, `deploy.worker.artifacts[${index}].from`, 'app root');
|
|
54
|
-
const to = (0, external_utils_js_namespaceObject.normalizeRelativePath)(artifact.to, `deploy.worker.artifacts[${index}].to`, 'Cloudflare output');
|
|
55
|
-
const [topLevelDestination] = to.split('/');
|
|
56
|
-
const reservedDestination = external_constants_js_namespaceObject.RESERVED_ARTIFACT_DESTINATION_FILES.has(to) ? to : topLevelDestination;
|
|
57
|
-
if (external_constants_js_namespaceObject.RESERVED_ARTIFACT_DESTINATION_FILES.has(to) || external_constants_js_namespaceObject.RESERVED_ARTIFACT_DESTINATION_DIRECTORIES.has(topLevelDestination)) throw new Error(`deploy.worker.artifacts[${index}].to must not target generated Cloudflare output path ${JSON.stringify(reservedDestination)}.`);
|
|
58
|
-
return {
|
|
59
|
-
from,
|
|
60
|
-
to,
|
|
61
|
-
index
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
const getCloudflareArtifacts = (modernConfig)=>(modernConfig.deploy?.worker?.artifacts ?? []).map(normalizeCloudflareArtifact);
|
|
65
|
-
const normalizeCloudflarePublicAsset = (asset, index)=>{
|
|
66
|
-
const from = (0, external_utils_js_namespaceObject.normalizeRelativePath)(asset.from, `deploy.worker.publicAssets[${index}].from`, 'app root');
|
|
67
|
-
const to = (0, external_utils_js_namespaceObject.normalizeRelativePath)(asset.to, `deploy.worker.publicAssets[${index}].to`, 'Cloudflare public output', {
|
|
68
|
-
allowRoot: true
|
|
69
|
-
});
|
|
70
|
-
return {
|
|
71
|
-
from,
|
|
72
|
-
to,
|
|
73
|
-
index
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
const getCloudflarePublicAssets = (modernConfig)=>(modernConfig.deploy?.worker?.publicAssets ?? []).map(normalizeCloudflarePublicAsset);
|
|
77
|
-
const copyCloudflareArtifacts = async (appDirectory, outputDirectory, artifacts)=>{
|
|
78
|
-
for (const artifact of artifacts){
|
|
79
|
-
const sourcePath = external_node_path_default().join(appDirectory, artifact.from);
|
|
80
|
-
if (!await utils_namespaceObject.fs.pathExists(sourcePath)) throw new Error(`deploy.worker.artifacts[${artifact.index}].from does not exist: ${artifact.from}`);
|
|
81
|
-
await utils_namespaceObject.fs.copy(sourcePath, external_node_path_default().join(outputDirectory, artifact.to));
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
const copyCloudflarePublicAssets = async (appDirectory, publicDirectory, publicAssets)=>{
|
|
85
|
-
for (const asset of publicAssets){
|
|
86
|
-
const sourcePath = external_node_path_default().join(appDirectory, asset.from);
|
|
87
|
-
if (!await utils_namespaceObject.fs.pathExists(sourcePath)) throw new Error(`deploy.worker.publicAssets[${asset.index}].from does not exist: ${asset.from}`);
|
|
88
|
-
await utils_namespaceObject.fs.copy(sourcePath, external_node_path_default().join(publicDirectory, asset.to));
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const copyCloudflareD1Migrations = async (appDirectory, outputDirectory, modernConfig)=>{
|
|
92
|
-
for (const [index, database] of (modernConfig.deploy?.worker?.d1Databases ?? []).entries()){
|
|
93
|
-
if (!database.migrationsDir) continue;
|
|
94
|
-
const migrationsDir = (0, external_utils_js_namespaceObject.normalizeRelativePath)(database.migrationsDir, `deploy.worker.d1Databases[${index}].migrationsDir`, 'app root');
|
|
95
|
-
const sourcePath = external_node_path_default().join(appDirectory, migrationsDir);
|
|
96
|
-
if (!await utils_namespaceObject.fs.pathExists(sourcePath)) throw new Error(`deploy.worker.d1Databases[${index}].migrationsDir does not exist: ${migrationsDir}`);
|
|
97
|
-
await utils_namespaceObject.fs.copy(sourcePath, external_node_path_default().join(outputDirectory, migrationsDir));
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
const readRouteSpec = async (outputDirectory)=>{
|
|
101
|
-
const routeSpecPath = external_node_path_default().join(outputDirectory, external_constants_js_namespaceObject.ROUTE_SPEC_OUTPUT);
|
|
102
|
-
if (!await utils_namespaceObject.fs.pathExists(routeSpecPath)) return {
|
|
103
|
-
routes: []
|
|
104
|
-
};
|
|
105
|
-
const routeSpec = await utils_namespaceObject.fs.readJSON(routeSpecPath);
|
|
106
|
-
return {
|
|
107
|
-
...routeSpec,
|
|
108
|
-
routes: Array.isArray(routeSpec.routes) ? routeSpec.routes : []
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
exports.copyCloudflareArtifacts = __webpack_exports__.copyCloudflareArtifacts;
|
|
112
|
-
exports.copyCloudflareD1Migrations = __webpack_exports__.copyCloudflareD1Migrations;
|
|
113
|
-
exports.copyCloudflarePublicAssets = __webpack_exports__.copyCloudflarePublicAssets;
|
|
114
|
-
exports.getCloudflareArtifacts = __webpack_exports__.getCloudflareArtifacts;
|
|
115
|
-
exports.getCloudflarePublicAssets = __webpack_exports__.getCloudflarePublicAssets;
|
|
116
|
-
exports.readRouteSpec = __webpack_exports__.readRouteSpec;
|
|
117
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
118
|
-
"copyCloudflareArtifacts",
|
|
119
|
-
"copyCloudflareD1Migrations",
|
|
120
|
-
"copyCloudflarePublicAssets",
|
|
121
|
-
"getCloudflareArtifacts",
|
|
122
|
-
"getCloudflarePublicAssets",
|
|
123
|
-
"readRouteSpec"
|
|
124
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
125
|
-
Object.defineProperty(exports, '__esModule', {
|
|
126
|
-
value: true
|
|
127
|
-
});
|