@modern-js/plugin-garfish 2.65.6-alpha.0 → 2.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,15 +58,19 @@ const garfishPlugin = () => ({
58
58
  setup: (api) => {
59
59
  api._internalRuntimePlugins(({ entrypoint, plugins }) => {
60
60
  const userConfig = api.getNormalizedConfig();
61
+ if (userConfig.deploy.microFrontend) {
62
+ return {
63
+ entrypoint,
64
+ plugins
65
+ };
66
+ }
61
67
  const { packageName, metaName } = api.getAppContext();
62
68
  const runtimeConfig = (0, import_utils.getEntryOptions)(entrypoint.entryName, entrypoint.isMainEntry, userConfig.runtime, userConfig.runtimeByEntries, packageName);
63
- if (runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.masterApp) {
64
- plugins.push({
65
- name: "garfish",
66
- path: `@${metaName}/plugin-garfish/runtime`,
67
- config: (runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.masterApp) || {}
68
- });
69
- }
69
+ plugins.push({
70
+ name: "garfish",
71
+ path: `@${metaName}/plugin-garfish/runtime`,
72
+ config: (runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.masterApp) || {}
73
+ });
70
74
  return {
71
75
  entrypoint,
72
76
  plugins
@@ -38,15 +38,19 @@ var garfishPlugin = function() {
38
38
  api._internalRuntimePlugins(function(param) {
39
39
  var entrypoint = param.entrypoint, plugins = param.plugins;
40
40
  var userConfig = api.getNormalizedConfig();
41
+ if (userConfig.deploy.microFrontend) {
42
+ return {
43
+ entrypoint,
44
+ plugins
45
+ };
46
+ }
41
47
  var _api_getAppContext = api.getAppContext(), packageName = _api_getAppContext.packageName, metaName = _api_getAppContext.metaName;
42
48
  var runtimeConfig = getEntryOptions(entrypoint.entryName, entrypoint.isMainEntry, userConfig.runtime, userConfig.runtimeByEntries, packageName);
43
- if (runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.masterApp) {
44
- plugins.push({
45
- name: "garfish",
46
- path: "@".concat(metaName, "/plugin-garfish/runtime"),
47
- config: (runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.masterApp) || {}
48
- });
49
- }
49
+ plugins.push({
50
+ name: "garfish",
51
+ path: "@".concat(metaName, "/plugin-garfish/runtime"),
52
+ config: (runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.masterApp) || {}
53
+ });
50
54
  return {
51
55
  entrypoint,
52
56
  plugins
@@ -32,15 +32,19 @@ const garfishPlugin = () => ({
32
32
  setup: (api) => {
33
33
  api._internalRuntimePlugins(({ entrypoint, plugins }) => {
34
34
  const userConfig = api.getNormalizedConfig();
35
+ if (userConfig.deploy.microFrontend) {
36
+ return {
37
+ entrypoint,
38
+ plugins
39
+ };
40
+ }
35
41
  const { packageName, metaName } = api.getAppContext();
36
42
  const runtimeConfig = getEntryOptions(entrypoint.entryName, entrypoint.isMainEntry, userConfig.runtime, userConfig.runtimeByEntries, packageName);
37
- if (runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.masterApp) {
38
- plugins.push({
39
- name: "garfish",
40
- path: `@${metaName}/plugin-garfish/runtime`,
41
- config: (runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.masterApp) || {}
42
- });
43
- }
43
+ plugins.push({
44
+ name: "garfish",
45
+ path: `@${metaName}/plugin-garfish/runtime`,
46
+ config: (runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.masterApp) || {}
47
+ });
44
48
  return {
45
49
  entrypoint,
46
50
  plugins
@@ -1,4 +1,4 @@
1
1
  import type { AppTools, AppToolsContext, AppToolsFeatureHooks, NormalizedConfig } from '@modern-js/app-tools';
2
2
  import type { Entrypoint } from '@modern-js/types';
3
3
  export declare const ENTRY_BOOTSTRAP_FILE_NAME = "bootstrap.jsx";
4
- export declare const generateCode: (entrypoints: Entrypoint[], appContext: AppToolsContext<'shared'>, config: NormalizedConfig<AppTools>, hooks: AppToolsFeatureHooks<'shared'>) => Promise<void>;
4
+ export declare const generateCode: (entrypoints: Entrypoint[], appContext: AppToolsContext<"shared">, config: NormalizedConfig<AppTools>, hooks: AppToolsFeatureHooks<"shared">) => Promise<void>;
@@ -8,5 +8,5 @@ export declare const externals: {
8
8
  export type LifeCycle = CliHookCallbacks;
9
9
  type NonInValidAble<T> = T extends null | undefined | false ? never : T;
10
10
  export declare function getDefaultMicroFrontedConfig(microFrontend: NonInValidAble<NonNullable<UseConfig['deploy']>['microFrontend']>): any;
11
- export declare const garfishPlugin: () => CliPluginFuture<AppTools<'shared'>>;
11
+ export declare const garfishPlugin: () => CliPluginFuture<AppTools<"shared">>;
12
12
  export default garfishPlugin;
@@ -4,8 +4,8 @@ export declare const index: ({ srcDirectory, internalSrcAlias, metaName, entry,
4
4
  metaName: string;
5
5
  entry: string;
6
6
  entryName: string;
7
- customEntry?: boolean | undefined;
8
- customBootstrap?: string | false | undefined;
9
- mountId?: string | undefined;
10
- appendCode?: string[] | undefined;
7
+ customEntry?: boolean;
8
+ customBootstrap?: string | false;
9
+ mountId?: string;
10
+ appendCode?: string[];
11
11
  }) => string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { LoadableConfig, MicroComponentProps } from './useModuleApps';
3
2
  export interface MicroProps {
4
3
  setLoadingState: (state: {
@@ -1,5 +1,3 @@
1
- /// <reference types="react" />
2
- /// <reference types="src/global" />
3
1
  import { type RenderFunc } from '@meta/runtime/browser';
4
2
  import type { Root } from 'react-dom/client';
5
3
  export declare function createProvider(id?: string, { customBootstrap, beforeRender, }?: {
@@ -13,7 +11,7 @@ export declare function createProvider(id?: string, { customBootstrap, beforeRen
13
11
  basename: string;
14
12
  dom: HTMLElement;
15
13
  props: any;
16
- appName?: string | undefined;
14
+ appName?: string;
17
15
  }): Promise<void>;
18
16
  destroy({ dom }: {
19
17
  dom: HTMLElement;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.65.6-alpha.0",
18
+ "version": "2.67.0",
19
19
  "jsnext:source": "./src/cli/index.ts",
20
20
  "types": "./dist/types/cli/index.d.ts",
21
21
  "typesVersions": {
@@ -69,12 +69,12 @@
69
69
  "debug": "4.3.7",
70
70
  "garfish": "^1.8.1",
71
71
  "react-loadable": "^5.5.0",
72
- "@modern-js/plugin-v2": "2.65.5",
73
- "@modern-js/runtime-utils": "2.65.5",
74
- "@modern-js/utils": "2.65.5"
72
+ "@modern-js/plugin-v2": "2.67.0",
73
+ "@modern-js/runtime-utils": "2.67.0",
74
+ "@modern-js/utils": "2.67.0"
75
75
  },
76
76
  "peerDependencies": {
77
- "@modern-js/runtime": "^2.65.5",
77
+ "@modern-js/runtime": "^2.67.0",
78
78
  "react": ">=17",
79
79
  "react-dom": ">=17"
80
80
  },
@@ -93,13 +93,13 @@
93
93
  "react-dom": "^18.3.1",
94
94
  "react-router-dom": "6.27.0",
95
95
  "typescript": "^5",
96
- "@modern-js/app-tools": "2.65.5",
97
- "@modern-js/core": "2.65.5",
98
- "@modern-js/plugin-router-v5": "2.65.5",
99
- "@modern-js/runtime": "2.65.5",
100
- "@modern-js/types": "2.65.5",
101
- "@scripts/build": "2.65.5",
102
- "@scripts/jest-config": "2.65.5"
96
+ "@modern-js/app-tools": "2.67.0",
97
+ "@modern-js/core": "2.67.0",
98
+ "@modern-js/plugin-router-v5": "2.67.0",
99
+ "@modern-js/runtime": "2.67.0",
100
+ "@modern-js/types": "2.67.0",
101
+ "@scripts/build": "2.66.0",
102
+ "@scripts/jest-config": "2.66.0"
103
103
  },
104
104
  "sideEffects": false,
105
105
  "publishConfig": {
package/type.d.ts CHANGED
@@ -11,10 +11,7 @@ declare module '@modern-js/runtime' {
11
11
  }
12
12
 
13
13
  interface RuntimeConfig {
14
- garfish?: Config;
15
- garfishByEntries?: {
16
- [name: string]: Config;
17
- };
14
+ masterApp?: Config;
18
15
  }
19
16
  }
20
17
  declare module '@modern-js/app-tools' {