@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.102 → 3.2.0-ultramodern.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/cjs/baseline.js +9 -5
  2. package/dist/cjs/builder/builder-rspack/index.js +9 -5
  3. package/dist/cjs/builder/generator/adapterCopy.js +9 -5
  4. package/dist/cjs/builder/generator/createBuilderProviderConfig.js +9 -5
  5. package/dist/cjs/builder/generator/createCopyPattern.js +9 -5
  6. package/dist/cjs/builder/generator/getBuilderEnvironments.js +9 -5
  7. package/dist/cjs/builder/generator/index.js +9 -5
  8. package/dist/cjs/builder/index.js +9 -5
  9. package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +9 -5
  10. package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +10 -6
  11. package/dist/cjs/builder/shared/builderPlugins/adapterPrecompress.js +9 -5
  12. package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +9 -5
  13. package/dist/cjs/builder/shared/builderPlugins/builderHooks.js +12 -8
  14. package/dist/cjs/builder/shared/builderPlugins/index.js +9 -5
  15. package/dist/cjs/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +9 -5
  16. package/dist/cjs/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +12 -8
  17. package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +9 -5
  18. package/dist/cjs/builder/shared/bundlerPlugins/index.js +9 -5
  19. package/dist/cjs/builder/shared/createCopyInfo.js +9 -5
  20. package/dist/cjs/builder/shared/index.js +9 -5
  21. package/dist/cjs/builder/shared/loaders/serverModuleLoader.js +12 -8
  22. package/dist/cjs/commands/build.js +9 -5
  23. package/dist/cjs/commands/deploy.js +9 -5
  24. package/dist/cjs/commands/dev.js +9 -5
  25. package/dist/cjs/commands/index.js +9 -5
  26. package/dist/cjs/commands/info.js +9 -5
  27. package/dist/cjs/commands/inspect.js +12 -8
  28. package/dist/cjs/commands/runtime.js +15 -11
  29. package/dist/cjs/commands/serve.js +9 -5
  30. package/dist/cjs/compat/hooks.js +9 -5
  31. package/dist/cjs/compat/index.js +9 -5
  32. package/dist/cjs/compat/utils.js +9 -5
  33. package/dist/cjs/config/default.js +9 -5
  34. package/dist/cjs/config/index.js +9 -5
  35. package/dist/cjs/config/initialize/index.js +9 -5
  36. package/dist/cjs/config/initialize/inits.js +9 -5
  37. package/dist/cjs/constants.js +13 -9
  38. package/dist/cjs/defineConfig.js +12 -8
  39. package/dist/cjs/esm/register-esm.js +12 -8
  40. package/dist/cjs/esm/ts-paths-loader.js +9 -5
  41. package/dist/cjs/index.js +21 -16
  42. package/dist/cjs/locale/en.js +12 -8
  43. package/dist/cjs/locale/index.js +9 -5
  44. package/dist/cjs/locale/zh.js +12 -8
  45. package/dist/cjs/plugins/analyze/constants.js +14 -10
  46. package/dist/cjs/plugins/analyze/getBundleEntry.js +9 -5
  47. package/dist/cjs/plugins/analyze/getFileSystemEntry.js +9 -5
  48. package/dist/cjs/plugins/analyze/getHtmlTemplate.js +9 -5
  49. package/dist/cjs/plugins/analyze/getServerRoutes.js +9 -5
  50. package/dist/cjs/plugins/analyze/index.js +9 -5
  51. package/dist/cjs/plugins/analyze/isDefaultExportFunction.js +9 -5
  52. package/dist/cjs/plugins/analyze/templates.js +12 -8
  53. package/dist/cjs/plugins/analyze/utils.js +9 -5
  54. package/dist/cjs/plugins/deploy/index.js +9 -5
  55. package/dist/cjs/plugins/deploy/platforms/cloudflare.js +169 -7
  56. package/dist/cjs/plugins/deploy/platforms/gh-pages.js +9 -5
  57. package/dist/cjs/plugins/deploy/platforms/netlify.js +9 -5
  58. package/dist/cjs/plugins/deploy/platforms/node.js +9 -5
  59. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +50 -5
  60. package/dist/cjs/plugins/deploy/platforms/vercel.js +9 -5
  61. package/dist/cjs/plugins/deploy/utils/generator.js +9 -5
  62. package/dist/cjs/plugins/deploy/utils/index.js +9 -5
  63. package/dist/cjs/plugins/initialize/index.js +9 -5
  64. package/dist/cjs/plugins/serverBuild.js +9 -5
  65. package/dist/cjs/plugins/serverRuntime.js +12 -8
  66. package/dist/cjs/presetUltramodern.js +9 -5
  67. package/dist/cjs/rsbuild.js +9 -5
  68. package/dist/cjs/run/index.js +9 -5
  69. package/dist/cjs/types/config/index.js +9 -5
  70. package/dist/cjs/types/index.js +9 -5
  71. package/dist/cjs/ultramodern/designSystem.js +16 -12
  72. package/dist/cjs/utils/config.js +9 -5
  73. package/dist/cjs/utils/createServer.js +14 -10
  74. package/dist/cjs/utils/env.js +9 -5
  75. package/dist/cjs/utils/generateWatchFiles.js +9 -5
  76. package/dist/cjs/utils/getConfigFile.js +9 -5
  77. package/dist/cjs/utils/getSelectedEntries.js +9 -5
  78. package/dist/cjs/utils/initAppContext.js +9 -5
  79. package/dist/cjs/utils/loadPlugins.js +9 -5
  80. package/dist/cjs/utils/printInstructions.js +9 -5
  81. package/dist/cjs/utils/register.js +9 -5
  82. package/dist/cjs/utils/restart.js +9 -5
  83. package/dist/cjs/utils/routes.js +9 -5
  84. package/dist/esm/builder/shared/builderPlugins/adapterHtml.mjs +1 -1
  85. package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +160 -2
  86. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +50 -5
  87. package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.mjs +1 -1
  88. package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +160 -2
  89. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +50 -5
  90. package/dist/types/builder/builder-rspack/index.d.ts +1 -1
  91. package/dist/types/builder/generator/index.d.ts +1 -1
  92. package/dist/types/builder/shared/createCopyInfo.d.ts +1 -1
  93. package/dist/types/commands/inspect.d.ts +1 -1
  94. package/dist/types/locale/index.d.ts +89 -2
  95. package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +2 -2
  96. package/dist/types/plugins/analyze/utils.d.ts +1 -1
  97. package/dist/types/plugins/deploy/utils/generator.d.ts +2 -2
  98. package/dist/types/plugins/deploy/utils/index.d.ts +1 -1
  99. package/dist/types/rsbuild.d.ts +1 -1
  100. package/dist/types/run/index.d.ts +1 -1
  101. package/dist/types/types/config/deploy.d.ts +48 -0
  102. package/dist/types/utils/getConfigFile.d.ts +1 -1
  103. package/dist/types/utils/loadPlugins.d.ts +2 -2
  104. package/package.json +15 -15
@@ -1,5 +1,5 @@
1
1
  export declare const walkDirectory: (dir: string) => string[];
2
- export declare const replaceWithAlias: (base: string, filePath: string, alias: string) => any;
2
+ export declare const replaceWithAlias: (base: string, filePath: string, alias: string) => string;
3
3
  export declare const parseModule: ({ source, filename, }: {
4
4
  source: string;
5
5
  filename: string;
@@ -5,8 +5,8 @@ export declare const serverAppContextTemplate: (appContext: AppToolsContext) =>
5
5
  sharedDirectory: string;
6
6
  apiDirectory: string;
7
7
  lambdaDirectory: string;
8
- metaName: any;
9
- bffRuntimeFramework: any;
8
+ metaName: string;
9
+ bffRuntimeFramework: "effect" | "hono";
10
10
  };
11
11
  export type PluginItem = [string, Record<string, any> | undefined];
12
12
  export declare const genPluginImportsCode: (plugins: PluginItem[], isESM?: boolean) => string;
@@ -12,5 +12,5 @@ export declare const getProjectUsage: (appDirectory: string, distDirectory: stri
12
12
  useWebServer: boolean;
13
13
  };
14
14
  export declare const getTemplatePath: (file: string) => string;
15
- export declare const readTemplate: (file: string) => Promise<any>;
15
+ export declare const readTemplate: (file: string) => Promise<string>;
16
16
  export declare const resolveESMDependency: (entry: string) => Promise<string | undefined>;
@@ -7,6 +7,6 @@ type ResolveModernRsbuildConfigOptions = {
7
7
  modifyModernConfig?: (config: AppUserConfig) => AppUserConfig | Promise<AppUserConfig>;
8
8
  };
9
9
  export declare function resolveModernRsbuildConfig(options: ResolveModernRsbuildConfigOptions): Promise<{
10
- rsbuildConfig: any;
10
+ rsbuildConfig: import("@rsbuild/core").RsbuildConfig;
11
11
  }>;
12
12
  export type { ResolveModernRsbuildConfigOptions };
@@ -14,7 +14,7 @@ export declare function createRunOptions({ cwd, initialLog, metaName, version, i
14
14
  initialLog: string;
15
15
  configFile: string;
16
16
  metaName: string;
17
- internalPlugins: any;
17
+ internalPlugins: import("@modern-js/plugin").Plugin[];
18
18
  handleSetupResult: typeof handleSetupResult;
19
19
  }>;
20
20
  export declare function run(options: RunOptions): Promise<void>;
@@ -27,6 +27,47 @@ export interface MicroFrontend {
27
27
  attestation?: string;
28
28
  }
29
29
  export type DeployTarget = 'node' | 'vercel' | 'netlify' | 'ghPages' | 'cloudflare';
30
+ export type CloudflareWorkerSecurityCspMode = 'enforce' | 'report-only' | 'off';
31
+ export interface CloudflareWorkerSecurityCspConfig {
32
+ mode?: CloudflareWorkerSecurityCspMode;
33
+ directives?: Record<string, string[] | string | false>;
34
+ additionalScriptSrc?: string[];
35
+ additionalStyleSrc?: string[];
36
+ additionalConnectSrc?: string[];
37
+ additionalImgSrc?: string[];
38
+ frameAncestors?: string[] | false;
39
+ reportUri?: string;
40
+ reason?: string;
41
+ }
42
+ export interface CloudflareWorkerSecurityNoindexConfig {
43
+ workersDev?: boolean;
44
+ localhost?: boolean;
45
+ previewHostnames?: string[];
46
+ reason?: string;
47
+ }
48
+ export interface CloudflareWorkerSecurityConfig {
49
+ /**
50
+ * Disable all Cloudflare worker security defaults for this app.
51
+ * Prefer narrower escape hatches when possible.
52
+ */
53
+ enabled?: boolean;
54
+ headers?: {
55
+ referrerPolicy?: string | false;
56
+ contentTypeOptions?: 'nosniff' | false;
57
+ permissionsPolicy?: string | false;
58
+ };
59
+ contentSecurityPolicy?: CloudflareWorkerSecurityCspConfig;
60
+ noindex?: boolean | CloudflareWorkerSecurityNoindexConfig;
61
+ cookies?: {
62
+ /**
63
+ * Cloudflare worker does not mutate application Set-Cookie headers by
64
+ * default; app-owned cookies should be secured by the owner that sets them.
65
+ */
66
+ mutateSetCookie?: false;
67
+ reason?: string;
68
+ };
69
+ reason?: string;
70
+ }
30
71
  export interface DeployUserConfig {
31
72
  /**
32
73
  * Selects the deploy output preset.
@@ -41,6 +82,13 @@ export interface DeployUserConfig {
41
82
  microFrontend?: boolean | MicroFrontend;
42
83
  worker?: {
43
84
  name?: string;
85
+ /**
86
+ * Cloudflare Workers compatibility date for generated wrangler config.
87
+ * Use YYYY-MM-DD. Defaults to the date validated against the bundled
88
+ * Wrangler version used by UltraModern generated workspaces.
89
+ */
90
+ compatibilityDate?: string;
44
91
  ssr?: boolean;
92
+ security?: CloudflareWorkerSecurityConfig;
45
93
  };
46
94
  }
@@ -1 +1 @@
1
- export declare const getConfigFile: (configFile?: string, cwd?: string) => any;
1
+ export declare const getConfigFile: (configFile?: string, cwd?: string) => string | false;
@@ -1,4 +1,4 @@
1
- import type { CLIPluginAPI } from '@modern-js/plugin';
1
+ import type { CLIPluginAPI, Plugin } from '@modern-js/plugin';
2
2
  import type { ServerPlugin as ServerPluginInstance } from '@modern-js/server-core';
3
3
  import type { InternalPlugins, ServerPlugin } from '@modern-js/types';
4
4
  import type { AppTools } from '../types';
@@ -10,4 +10,4 @@ export declare function loadServerPlugins(api: CLIPluginAPI<AppTools>, appDirect
10
10
  * @param internalPlugins - Internal plugins.
11
11
  * @returns Plugin Objects has been required.
12
12
  */
13
- export declare const loadInternalPlugins: (appDirectory: string, internalPlugins?: InternalPlugins) => Promise<any>;
13
+ export declare const loadInternalPlugins: (appDirectory: string, internalPlugins?: InternalPlugins) => Promise<Plugin[]>;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.2.0-ultramodern.102",
20
+ "version": "3.2.0-ultramodern.103",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "exports": {
@@ -82,11 +82,11 @@
82
82
  "modern-app": "bin/modern.js"
83
83
  },
84
84
  "dependencies": {
85
- "@babel/parser": "^7.29.3",
86
- "@babel/traverse": "^7.29.0",
87
- "@babel/types": "^7.29.0",
85
+ "@babel/parser": "^7.29.7",
86
+ "@babel/traverse": "^7.29.7",
87
+ "@babel/types": "^7.29.7",
88
88
  "@loadable/component": "5.16.7",
89
- "@rsbuild/core": "2.0.7",
89
+ "@rsbuild/core": "2.0.10",
90
90
  "@swc/core": "1.15.40",
91
91
  "@swc/helpers": "^0.5.23",
92
92
  "compression-webpack-plugin": "^12.0.0",
@@ -99,16 +99,16 @@
99
99
  "ndepe": "^0.1.13",
100
100
  "pkg-types": "^2.3.1",
101
101
  "std-env": "4.1.0",
102
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.102",
103
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.102",
104
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.102",
105
- "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.102",
106
- "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.2.0-ultramodern.102",
107
- "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.2.0-ultramodern.102",
108
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.102",
109
- "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.2.0-ultramodern.102",
110
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.102",
111
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.102"
102
+ "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.2.0-ultramodern.103",
103
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.103",
104
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.103",
105
+ "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.2.0-ultramodern.103",
106
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.103",
107
+ "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.2.0-ultramodern.103",
108
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.103",
109
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.103",
110
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.103",
111
+ "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.2.0-ultramodern.103"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@rslib/core": "0.21.5",