@modern-js/mwa-generator 3.3.9 → 3.3.11

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 (3) hide show
  1. package/dist/index.js +266 -259
  2. package/package.json +13 -13
  3. package/src/index.ts +4 -12
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.3.9",
18
+ "version": "3.3.11",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "main": "./dist/index.js",
21
21
  "files": [
@@ -23,24 +23,24 @@
23
23
  "/dist/index.js"
24
24
  ],
25
25
  "dependencies": {
26
- "@modern-js/utils": "2.47.0"
26
+ "@modern-js/utils": "2.48.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@modern-js/codesmith": "2.3.4",
30
- "@modern-js/codesmith-api-app": "2.3.4",
29
+ "@modern-js/codesmith": "2.3.5",
30
+ "@modern-js/codesmith-api-app": "2.3.5",
31
31
  "@types/jest": "^29",
32
32
  "@types/node": "^14",
33
33
  "jest": "^29",
34
34
  "typescript": "^5",
35
- "@modern-js/base-generator": "3.3.9",
36
- "@modern-js/dependence-generator": "3.3.9",
37
- "@modern-js/entry-generator": "3.3.9",
38
- "@modern-js/generator-utils": "3.3.9",
39
- "@modern-js/generator-common": "3.3.9",
40
- "@modern-js/packages-generator": "3.3.9",
41
- "@modern-js/plugin-i18n": "2.47.0",
42
- "@scripts/jest-config": "2.47.0",
43
- "@scripts/build": "2.47.0"
35
+ "@modern-js/base-generator": "3.3.11",
36
+ "@modern-js/dependence-generator": "3.3.11",
37
+ "@modern-js/generator-common": "3.3.11",
38
+ "@modern-js/generator-utils": "3.3.11",
39
+ "@modern-js/packages-generator": "3.3.11",
40
+ "@modern-js/entry-generator": "3.3.11",
41
+ "@scripts/build": "2.48.0",
42
+ "@scripts/jest-config": "2.48.0",
43
+ "@modern-js/plugin-i18n": "2.48.0"
44
44
  },
45
45
  "sideEffects": false,
46
46
  "publishConfig": {
package/src/index.ts CHANGED
@@ -19,18 +19,10 @@ import {
19
19
  validatePackagePath,
20
20
  getPackageManagerText,
21
21
  getModernVersion,
22
+ getGeneratorPath,
22
23
  } from '@modern-js/generator-utils';
23
24
  import { i18n, localeKeys } from './locale';
24
25
 
25
- const getGeneratorPath = (generator: string, distTag: string) => {
26
- if (process.env.CODESMITH_ENV === 'development') {
27
- return path.dirname(require.resolve(generator));
28
- } else if (distTag) {
29
- return `${generator}@${distTag}`;
30
- }
31
- return generator;
32
- };
33
-
34
26
  export const handleTemplateFile = async (
35
27
  context: GeneratorContext,
36
28
  generator: GeneratorCore,
@@ -131,7 +123,7 @@ export const handleTemplateFile = async (
131
123
  const dirname = path.basename(generator.outputPath);
132
124
 
133
125
  await appApi.runSubGenerator(
134
- getGeneratorPath(BaseGenerator, context.config.distTag),
126
+ getGeneratorPath(BaseGenerator, context.config.distTag, [__dirname]),
135
127
  undefined,
136
128
  { ...context.config, hasPlugin: false },
137
129
  );
@@ -179,7 +171,7 @@ export const handleTemplateFile = async (
179
171
  }
180
172
 
181
173
  await appApi.runSubGenerator(
182
- getGeneratorPath(EntryGenerator, context.config.distTag),
174
+ getGeneratorPath(EntryGenerator, context.config.distTag, [__dirname]),
183
175
  `./${projectPath}`,
184
176
  {
185
177
  ...context.config,
@@ -196,7 +188,7 @@ export const handleTemplateFile = async (
196
188
 
197
189
  if (packagesInfo && Object.keys(packagesInfo).length > 0) {
198
190
  await appApi.runSubGenerator(
199
- getGeneratorPath(PackagesGenerator, context.config.distTag),
191
+ getGeneratorPath(PackagesGenerator, context.config.distTag, [__dirname]),
200
192
  undefined,
201
193
  context.config,
202
194
  );