@bleedingdev/modern-js-create 3.2.0-ultramodern.108 → 3.2.0-ultramodern.110

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 (44) hide show
  1. package/dist/cjs/index.cjs +1040 -0
  2. package/dist/cjs/locale/en.cjs +97 -0
  3. package/dist/cjs/locale/index.cjs +50 -0
  4. package/dist/cjs/locale/zh.cjs +97 -0
  5. package/dist/cjs/ultramodern-checks/cli/i18n-check.cjs +73 -0
  6. package/dist/cjs/ultramodern-checks/cli/oxlint.cjs +174 -0
  7. package/dist/cjs/ultramodern-checks/cli/workspace-source-check.cjs +179 -0
  8. package/dist/cjs/ultramodern-checks/index.cjs +58 -0
  9. package/dist/cjs/ultramodern-checks/oxlint-plugin.cjs +354 -0
  10. package/dist/cjs/ultramodern-package-source.cjs +133 -0
  11. package/dist/cjs/ultramodern-workspace.cjs +5616 -0
  12. package/dist/esm/index.js +1002 -0
  13. package/dist/esm/locale/en.js +59 -0
  14. package/dist/esm/locale/index.js +9 -0
  15. package/dist/esm/locale/zh.js +59 -0
  16. package/dist/esm/ultramodern-checks/cli/i18n-check.js +26 -0
  17. package/dist/esm/ultramodern-checks/cli/oxlint.js +118 -0
  18. package/dist/esm/ultramodern-checks/cli/workspace-source-check.js +124 -0
  19. package/dist/esm/ultramodern-checks/index.js +3 -0
  20. package/dist/esm/ultramodern-checks/oxlint-plugin.js +316 -0
  21. package/dist/esm/ultramodern-package-source.js +61 -0
  22. package/dist/esm/ultramodern-workspace.js +5554 -0
  23. package/dist/esm-node/index.js +1003 -0
  24. package/dist/esm-node/locale/en.js +60 -0
  25. package/dist/esm-node/locale/index.js +10 -0
  26. package/dist/esm-node/locale/zh.js +60 -0
  27. package/dist/esm-node/ultramodern-checks/cli/i18n-check.js +27 -0
  28. package/dist/esm-node/ultramodern-checks/cli/oxlint.js +119 -0
  29. package/dist/esm-node/ultramodern-checks/cli/workspace-source-check.js +125 -0
  30. package/dist/esm-node/ultramodern-checks/index.js +4 -0
  31. package/dist/esm-node/ultramodern-checks/oxlint-plugin.js +317 -0
  32. package/dist/esm-node/ultramodern-package-source.js +62 -0
  33. package/dist/{index.js → esm-node/ultramodern-workspace.js} +31 -1793
  34. package/dist/types/ultramodern-checks/cli/i18n-check.d.ts +9 -0
  35. package/dist/types/ultramodern-checks/cli/oxlint.d.ts +22 -0
  36. package/dist/types/ultramodern-checks/cli/workspace-source-check.d.ts +8 -0
  37. package/dist/types/ultramodern-checks/index.d.ts +3 -0
  38. package/dist/types/ultramodern-checks/oxlint-plugin.d.ts +63 -0
  39. package/dist/types/ultramodern-package-source.d.ts +2 -2
  40. package/package.json +49 -8
  41. package/template/package.json.handlebars +7 -5
  42. package/template/scripts/check-i18n-strings.mjs +2 -205
  43. package/template/scripts/validate-ultramodern.mjs.handlebars +27 -9
  44. package/template/tests/ultramodern.contract.test.ts.handlebars +19 -0
@@ -0,0 +1,58 @@
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
+ oxlintPlugin: ()=>external_oxlint_plugin_cjs_default(),
41
+ runSingleAppI18nCheck: ()=>i18n_check_cjs_namespaceObject.runSingleAppI18nCheck,
42
+ runWorkspaceSourceCheck: ()=>workspace_source_check_cjs_namespaceObject.runWorkspaceSourceCheck
43
+ });
44
+ const i18n_check_cjs_namespaceObject = require("./cli/i18n-check.cjs");
45
+ const workspace_source_check_cjs_namespaceObject = require("./cli/workspace-source-check.cjs");
46
+ const external_oxlint_plugin_cjs_namespaceObject = require("./oxlint-plugin.cjs");
47
+ var external_oxlint_plugin_cjs_default = /*#__PURE__*/ __webpack_require__.n(external_oxlint_plugin_cjs_namespaceObject);
48
+ exports.oxlintPlugin = __webpack_exports__.oxlintPlugin;
49
+ exports.runSingleAppI18nCheck = __webpack_exports__.runSingleAppI18nCheck;
50
+ exports.runWorkspaceSourceCheck = __webpack_exports__.runWorkspaceSourceCheck;
51
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
52
+ "oxlintPlugin",
53
+ "runSingleAppI18nCheck",
54
+ "runWorkspaceSourceCheck"
55
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
56
+ Object.defineProperty(exports, '__esModule', {
57
+ value: true
58
+ });
@@ -0,0 +1,354 @@
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 commonOptionsSchema = {
31
+ type: 'object',
32
+ properties: {
33
+ allowElements: {
34
+ type: 'array',
35
+ items: {
36
+ type: 'string'
37
+ }
38
+ },
39
+ ignoreCommentPattern: {
40
+ type: 'string'
41
+ }
42
+ },
43
+ additionalProperties: false
44
+ };
45
+ const attributeOptionsSchema = {
46
+ type: 'object',
47
+ properties: {
48
+ ...commonOptionsSchema.properties,
49
+ visibleAttributes: {
50
+ type: 'array',
51
+ items: {
52
+ type: 'string'
53
+ }
54
+ }
55
+ },
56
+ additionalProperties: false
57
+ };
58
+ const translationOptionsSchema = {
59
+ type: 'object',
60
+ properties: {
61
+ translationFunctions: {
62
+ type: 'array',
63
+ items: {
64
+ type: 'string'
65
+ }
66
+ }
67
+ },
68
+ additionalProperties: false
69
+ };
70
+ const DEFAULT_VISIBLE_ATTRIBUTES = [
71
+ 'aria-label',
72
+ "aria-description",
73
+ "aria-roledescription",
74
+ 'aria-valuetext',
75
+ 'alt',
76
+ 'placeholder',
77
+ 'title'
78
+ ];
79
+ const DEFAULT_ALLOWED_ELEMENTS = [
80
+ 'code',
81
+ 'kbd',
82
+ 'samp'
83
+ ];
84
+ const DEFAULT_TRANSLATION_FUNCTIONS = [
85
+ 't'
86
+ ];
87
+ const DEFAULT_IGNORE_COMMENT_PATTERN = 'i18n-ignore';
88
+ const LETTER_PATTERN = /\p{L}/u;
89
+ const SPLIT_TRANSLATION_KEY_PATTERN = /\.(?:prefix|suffix|before|after)$/u;
90
+ const isRecord = (value)=>Boolean(value) && 'object' == typeof value && !Array.isArray(value);
91
+ const asStringArray = (value, fallback)=>Array.isArray(value) && value.every((item)=>'string' == typeof item) ? value : fallback;
92
+ const getCommonRuleOption = (context, defaults)=>{
93
+ const options = context.options?.[0];
94
+ if (!isRecord(options)) return defaults;
95
+ return {
96
+ allowElements: asStringArray(options.allowElements, defaults.allowElements),
97
+ ignoreCommentPattern: 'string' == typeof options.ignoreCommentPattern ? options.ignoreCommentPattern : defaults.ignoreCommentPattern
98
+ };
99
+ };
100
+ const getAttributeRuleOption = (context, defaults)=>{
101
+ const options = context.options?.[0];
102
+ const commonOptions = getCommonRuleOption(context, defaults);
103
+ return {
104
+ ...commonOptions,
105
+ visibleAttributes: isRecord(options) ? asStringArray(options.visibleAttributes, defaults.visibleAttributes) : defaults.visibleAttributes
106
+ };
107
+ };
108
+ const getSplitTranslationKeyRuleOption = (context, defaults)=>{
109
+ const options = context.options?.[0];
110
+ if (!isRecord(options)) return defaults;
111
+ return {
112
+ translationFunctions: asStringArray(options.translationFunctions, defaults.translationFunctions)
113
+ };
114
+ };
115
+ const normalizeVisibleText = (value)=>value.replaceAll(/\s+/gu, ' ').trim();
116
+ const hasLetters = (value)=>LETTER_PATTERN.test(value);
117
+ const getNodeName = (node)=>{
118
+ if (!node) return;
119
+ if ('string' == typeof node.name) return node.name;
120
+ if ('JSXIdentifier' === node.type && isRecord(node.name) && 'string' == typeof node.name.name) return node.name.name;
121
+ if ('JSXIdentifier' === node.type && 'string' == typeof node.name) return node.name;
122
+ if (('JSXMemberExpression' === node.type || 'MemberExpression' === node.type) && isRecord(node.property) && true !== node.computed) {
123
+ const objectName = getNodeName(node.object);
124
+ const propertyName = getNodeName(node.property);
125
+ return objectName && propertyName ? `${objectName}.${propertyName}` : propertyName;
126
+ }
127
+ };
128
+ const getJsxElementName = (node)=>{
129
+ if (node?.type !== 'JSXElement') return;
130
+ return getNodeName(node.openingElement?.name);
131
+ };
132
+ const hasAllowedElementAncestor = (node, allowedElements)=>{
133
+ let current = node;
134
+ while(current){
135
+ const elementName = getJsxElementName(current);
136
+ if (elementName && allowedElements.has(elementName)) return true;
137
+ current = current.parent;
138
+ }
139
+ return false;
140
+ };
141
+ const getTemplateLiteralValue = (node)=>{
142
+ if ('TemplateLiteral' !== node.type || (node.expressions?.length ?? 0) > 0) return;
143
+ const quasi = node.quasis?.[0];
144
+ if (!isRecord(quasi?.value)) return;
145
+ const cooked = quasi.value.cooked;
146
+ const raw = quasi.value.raw;
147
+ return 'string' == typeof cooked ? cooked : 'string' == typeof raw ? raw : void 0;
148
+ };
149
+ const getStringLiteralValue = (node)=>{
150
+ if (!node) return;
151
+ if (('Literal' === node.type || 'StringLiteral' === node.type) && 'string' == typeof node.value) return node.value;
152
+ return getTemplateLiteralValue(node);
153
+ };
154
+ const expressionStringValue = (node)=>getStringLiteralValue(node?.type === 'JSXExpressionContainer' ? node.expression : node);
155
+ const getLine = (node)=>node.loc?.start?.line;
156
+ const hasIgnoreComment = (node, context, pattern)=>{
157
+ const sourceCode = context.getSourceCode?.();
158
+ const nodeLine = getLine(node);
159
+ if (!sourceCode?.getAllComments || void 0 === nodeLine) return false;
160
+ return sourceCode.getAllComments().some((comment)=>{
161
+ const commentValue = String(comment.value ?? '');
162
+ if (!pattern.test(commentValue)) return false;
163
+ const startLine = comment.loc?.start?.line;
164
+ const endLine = comment.loc?.end?.line ?? startLine;
165
+ return void 0 !== startLine && void 0 !== endLine && startLine <= nodeLine + 1 && endLine >= nodeLine - 1;
166
+ });
167
+ };
168
+ const getIgnorePattern = (options)=>new RegExp(options.ignoreCommentPattern, 'u');
169
+ const reportVisibleText = (context, node, text)=>{
170
+ context.report({
171
+ node,
172
+ message: `Move user-visible JSX text to locale resources: ${JSON.stringify(text)}`
173
+ });
174
+ };
175
+ const createNoHardcodedJsxTextRule = ()=>({
176
+ meta: {
177
+ type: 'problem',
178
+ docs: {
179
+ description: 'Disallow literal user-visible text in JSX children in UltraModern generated apps.'
180
+ },
181
+ schema: [
182
+ commonOptionsSchema
183
+ ]
184
+ },
185
+ create (context) {
186
+ const options = getCommonRuleOption(context, {
187
+ allowElements: DEFAULT_ALLOWED_ELEMENTS,
188
+ ignoreCommentPattern: DEFAULT_IGNORE_COMMENT_PATTERN
189
+ });
190
+ const allowedElements = new Set(options.allowElements);
191
+ const ignorePattern = getIgnorePattern(options);
192
+ const shouldSkipNode = (node)=>hasAllowedElementAncestor(node, allowedElements) || hasIgnoreComment(node, context, ignorePattern);
193
+ return {
194
+ JSXText (node) {
195
+ const text = normalizeVisibleText(String(node.value ?? ''));
196
+ if (!text || !hasLetters(text) || shouldSkipNode(node)) return;
197
+ reportVisibleText(context, node, text);
198
+ },
199
+ JSXExpressionContainer (node) {
200
+ if (node.parent?.type !== 'JSXElement' && node.parent?.type !== 'JSXFragment') return;
201
+ const text = normalizeVisibleText(expressionStringValue(node.expression) ?? '');
202
+ if (!text || !hasLetters(text) || shouldSkipNode(node)) return;
203
+ reportVisibleText(context, node, text);
204
+ }
205
+ };
206
+ }
207
+ });
208
+ const createNoLiteralVisibleJsxAttributesRule = ()=>({
209
+ meta: {
210
+ type: 'problem',
211
+ docs: {
212
+ description: 'Disallow literal user-visible JSX attribute text in UltraModern generated apps.'
213
+ },
214
+ schema: [
215
+ attributeOptionsSchema
216
+ ]
217
+ },
218
+ create (context) {
219
+ const options = getAttributeRuleOption(context, {
220
+ allowElements: DEFAULT_ALLOWED_ELEMENTS,
221
+ ignoreCommentPattern: DEFAULT_IGNORE_COMMENT_PATTERN,
222
+ visibleAttributes: DEFAULT_VISIBLE_ATTRIBUTES
223
+ });
224
+ const visibleAttributes = new Set(options.visibleAttributes);
225
+ const ignorePattern = getIgnorePattern(options);
226
+ return {
227
+ JSXAttribute (node) {
228
+ const attributeName = getNodeName(node.name);
229
+ if (!attributeName || !visibleAttributes.has(attributeName)) return;
230
+ const text = normalizeVisibleText(expressionStringValue(node.value) ?? '');
231
+ if (!text || !hasLetters(text) || hasIgnoreComment(node, context, ignorePattern)) return;
232
+ context.report({
233
+ node,
234
+ message: `Move literal ${attributeName} copy to locale resources: ${JSON.stringify(text)}`
235
+ });
236
+ }
237
+ };
238
+ }
239
+ });
240
+ const getSourceText = (context, node)=>context.getSourceCode?.().getText?.(node) ?? '';
241
+ const looksLikeLocaleTest = (context, node)=>{
242
+ const text = getSourceText(context, node);
243
+ return /\b(?:language|locale|lng|currentLanguage)\b/u.test(text) && /(?:={2,3}|!==?)/u.test(text) && /['"][a-z]{2}(?:-[A-Za-z0-9]+)?['"]/u.test(text);
244
+ };
245
+ const isAllowedBranchLiteral = (text)=>new Set([
246
+ 'page',
247
+ 'undefined',
248
+ 'null',
249
+ 'true',
250
+ 'false'
251
+ ]).has(text);
252
+ const createNoManualLocaleCopyBranchingRule = ()=>({
253
+ meta: {
254
+ type: 'problem',
255
+ docs: {
256
+ description: 'Disallow manual locale conditionals that choose user-visible copy.'
257
+ },
258
+ schema: []
259
+ },
260
+ create (context) {
261
+ const reportBranch = (node, text)=>{
262
+ context.report({
263
+ node,
264
+ message: `Move locale-specific copy branch to i18n resources: ${JSON.stringify(normalizeVisibleText(text))}`
265
+ });
266
+ };
267
+ return {
268
+ ConditionalExpression (node) {
269
+ if (!node.test || !looksLikeLocaleTest(context, node.test)) return;
270
+ for (const branch of [
271
+ node.consequent,
272
+ node.alternate
273
+ ]){
274
+ const text = expressionStringValue(branch);
275
+ if (text && hasLetters(text) && !isAllowedBranchLiteral(text.trim())) reportBranch(branch, text);
276
+ }
277
+ }
278
+ };
279
+ }
280
+ });
281
+ const getCallExpressionName = (node)=>getNodeName(node);
282
+ const createNoSplitTranslationKeysRule = ()=>({
283
+ meta: {
284
+ type: 'problem',
285
+ docs: {
286
+ description: 'Disallow split phrase translation key suffixes such as .prefix and .suffix.'
287
+ },
288
+ schema: [
289
+ translationOptionsSchema
290
+ ]
291
+ },
292
+ create (context) {
293
+ const options = getSplitTranslationKeyRuleOption(context, {
294
+ translationFunctions: DEFAULT_TRANSLATION_FUNCTIONS
295
+ });
296
+ const translationFunctions = new Set(options.translationFunctions);
297
+ return {
298
+ CallExpression (node) {
299
+ const calleeName = getCallExpressionName(node.callee);
300
+ if (!calleeName || !translationFunctions.has(calleeName)) return;
301
+ const key = expressionStringValue(node.arguments?.[0]);
302
+ if (!key || !SPLIT_TRANSLATION_KEY_PATTERN.test(key)) return;
303
+ context.report({
304
+ node,
305
+ message: 'Keep translator-owned phrases whole instead of using split translation keys.'
306
+ });
307
+ }
308
+ };
309
+ }
310
+ });
311
+ const createNoLegacyMfBoundaryAttributesRule = ()=>({
312
+ meta: {
313
+ type: 'problem',
314
+ docs: {
315
+ description: 'Disallow legacy Module Federation boundary attributes in generated UltraModern workspaces.'
316
+ },
317
+ schema: []
318
+ },
319
+ create (context) {
320
+ return {
321
+ JSXAttribute (node) {
322
+ const attributeName = getNodeName(node.name);
323
+ if ('data-mf-boundary' !== attributeName && 'data-mf-remote' !== attributeName && 'data-mf-expose' !== attributeName) return;
324
+ context.report({
325
+ node,
326
+ message: 'Use data-modern-boundary-id and data-modern-mf-expose instead of legacy data-mf-* boundary attributes.'
327
+ });
328
+ }
329
+ };
330
+ }
331
+ });
332
+ const plugin = {
333
+ meta: {
334
+ name: 'ultramodern'
335
+ },
336
+ rules: {
337
+ 'no-hardcoded-jsx-text': createNoHardcodedJsxTextRule(),
338
+ 'no-legacy-mf-boundary-attributes': createNoLegacyMfBoundaryAttributesRule(),
339
+ 'no-literal-visible-jsx-attributes': createNoLiteralVisibleJsxAttributesRule(),
340
+ 'no-manual-locale-copy-branching': createNoManualLocaleCopyBranchingRule(),
341
+ 'no-split-translation-keys': createNoSplitTranslationKeysRule()
342
+ }
343
+ };
344
+ const __rspack_default_export = plugin;
345
+ __webpack_require__.d(__webpack_exports__, {}, {
346
+ default: __rspack_default_export
347
+ });
348
+ exports["default"] = __webpack_exports__["default"];
349
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
350
+ "default"
351
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
352
+ Object.defineProperty(exports, '__esModule', {
353
+ value: true
354
+ });
@@ -0,0 +1,133 @@
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 WORKSPACE_PACKAGE_VERSION = 'workspace:*';
31
+ const BLEEDINGDEV_CREATE_PACKAGE = '@bleedingdev/modern-js-create';
32
+ const BLEEDINGDEV_PACKAGE_SCOPE = 'bleedingdev';
33
+ const BLEEDINGDEV_PACKAGE_NAME_PREFIX = 'modern-js-';
34
+ const BLEEDINGDEV_FRAMEWORK_VERSION_ENV = 'MODERN_CREATE_ULTRAMODERN_FRAMEWORK_VERSION';
35
+ const ULTRAMODERN_SINGLE_APP_MODERN_PACKAGES = [
36
+ '@modern-js/create',
37
+ '@modern-js/runtime',
38
+ '@modern-js/app-tools',
39
+ '@modern-js/tsconfig',
40
+ '@modern-js/plugin-i18n',
41
+ '@modern-js/plugin-tanstack',
42
+ '@modern-js/plugin-bff',
43
+ '@modern-js/adapter-rstest'
44
+ ];
45
+ const ULTRAMODERN_WORKSPACE_MODERN_PACKAGES = [
46
+ '@modern-js/create',
47
+ '@modern-js/app-tools',
48
+ '@modern-js/plugin-bff',
49
+ '@modern-js/plugin-i18n',
50
+ '@modern-js/plugin-tanstack',
51
+ '@modern-js/runtime'
52
+ ];
53
+ function modernPackageVersion(packageSource) {
54
+ return 'install' === packageSource.strategy ? packageSource.modernPackageVersion : WORKSPACE_PACKAGE_VERSION;
55
+ }
56
+ function modernAliasPackageName(packageName, packageSource) {
57
+ if (!packageSource.aliasScope) return packageName;
58
+ const scope = packageSource.aliasScope.replace(/^@/, '');
59
+ const unscopedName = packageName.split('/').at(-1);
60
+ return `@${scope}/${packageSource.aliasPackageNamePrefix ?? ''}${unscopedName}`;
61
+ }
62
+ function modernPackageSpecifier(packageName, packageSource) {
63
+ if ('install' !== packageSource.strategy) return WORKSPACE_PACKAGE_VERSION;
64
+ if (!packageSource.aliasScope) return packageSource.modernPackageVersion;
65
+ return `npm:${modernAliasPackageName(packageName, packageSource)}@${packageSource.modernPackageVersion}`;
66
+ }
67
+ function modernPackageAliases(packageNames, packageSource) {
68
+ if (!packageSource.aliasScope) return;
69
+ return Object.fromEntries(packageNames.map((packageName)=>[
70
+ packageName,
71
+ modernAliasPackageName(packageName, packageSource)
72
+ ]));
73
+ }
74
+ function createModernPackagesMetadata(packageNames, packageSource, options = {}) {
75
+ const includeAliases = options.includeAliases ?? Boolean(packageSource.aliasScope);
76
+ const aliases = includeAliases ? modernPackageAliases(packageNames, packageSource) : void 0;
77
+ return {
78
+ packages: [
79
+ ...packageNames
80
+ ],
81
+ specifier: modernPackageVersion(packageSource),
82
+ ...packageSource.registry ? {
83
+ registry: packageSource.registry
84
+ } : {},
85
+ ...aliases ? {
86
+ aliases
87
+ } : {}
88
+ };
89
+ }
90
+ __webpack_require__.d(__webpack_exports__, {
91
+ createModernPackagesMetadata: ()=>createModernPackagesMetadata,
92
+ modernAliasPackageName: ()=>modernAliasPackageName,
93
+ modernPackageAliases: ()=>modernPackageAliases,
94
+ modernPackageSpecifier: ()=>modernPackageSpecifier,
95
+ modernPackageVersion: ()=>modernPackageVersion
96
+ }, {
97
+ BLEEDINGDEV_CREATE_PACKAGE: BLEEDINGDEV_CREATE_PACKAGE,
98
+ BLEEDINGDEV_FRAMEWORK_VERSION_ENV: BLEEDINGDEV_FRAMEWORK_VERSION_ENV,
99
+ BLEEDINGDEV_PACKAGE_NAME_PREFIX: BLEEDINGDEV_PACKAGE_NAME_PREFIX,
100
+ BLEEDINGDEV_PACKAGE_SCOPE: BLEEDINGDEV_PACKAGE_SCOPE,
101
+ ULTRAMODERN_SINGLE_APP_MODERN_PACKAGES: ULTRAMODERN_SINGLE_APP_MODERN_PACKAGES,
102
+ ULTRAMODERN_WORKSPACE_MODERN_PACKAGES: ULTRAMODERN_WORKSPACE_MODERN_PACKAGES,
103
+ WORKSPACE_PACKAGE_VERSION: WORKSPACE_PACKAGE_VERSION
104
+ });
105
+ exports.BLEEDINGDEV_CREATE_PACKAGE = __webpack_exports__.BLEEDINGDEV_CREATE_PACKAGE;
106
+ exports.BLEEDINGDEV_FRAMEWORK_VERSION_ENV = __webpack_exports__.BLEEDINGDEV_FRAMEWORK_VERSION_ENV;
107
+ exports.BLEEDINGDEV_PACKAGE_NAME_PREFIX = __webpack_exports__.BLEEDINGDEV_PACKAGE_NAME_PREFIX;
108
+ exports.BLEEDINGDEV_PACKAGE_SCOPE = __webpack_exports__.BLEEDINGDEV_PACKAGE_SCOPE;
109
+ exports.ULTRAMODERN_SINGLE_APP_MODERN_PACKAGES = __webpack_exports__.ULTRAMODERN_SINGLE_APP_MODERN_PACKAGES;
110
+ exports.ULTRAMODERN_WORKSPACE_MODERN_PACKAGES = __webpack_exports__.ULTRAMODERN_WORKSPACE_MODERN_PACKAGES;
111
+ exports.WORKSPACE_PACKAGE_VERSION = __webpack_exports__.WORKSPACE_PACKAGE_VERSION;
112
+ exports.createModernPackagesMetadata = __webpack_exports__.createModernPackagesMetadata;
113
+ exports.modernAliasPackageName = __webpack_exports__.modernAliasPackageName;
114
+ exports.modernPackageAliases = __webpack_exports__.modernPackageAliases;
115
+ exports.modernPackageSpecifier = __webpack_exports__.modernPackageSpecifier;
116
+ exports.modernPackageVersion = __webpack_exports__.modernPackageVersion;
117
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
118
+ "BLEEDINGDEV_CREATE_PACKAGE",
119
+ "BLEEDINGDEV_FRAMEWORK_VERSION_ENV",
120
+ "BLEEDINGDEV_PACKAGE_NAME_PREFIX",
121
+ "BLEEDINGDEV_PACKAGE_SCOPE",
122
+ "ULTRAMODERN_SINGLE_APP_MODERN_PACKAGES",
123
+ "ULTRAMODERN_WORKSPACE_MODERN_PACKAGES",
124
+ "WORKSPACE_PACKAGE_VERSION",
125
+ "createModernPackagesMetadata",
126
+ "modernAliasPackageName",
127
+ "modernPackageAliases",
128
+ "modernPackageSpecifier",
129
+ "modernPackageVersion"
130
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
131
+ Object.defineProperty(exports, '__esModule', {
132
+ value: true
133
+ });