@sse-ui/builder 1.0.3 → 1.2.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.
- package/dist/acorn-RZKYEOCN.js +3130 -0
- package/dist/angular-65ZVA2AO.js +3070 -0
- package/dist/babel-6NAC7UZ3.js +7296 -0
- package/dist/babel-RJOLF3H5.js +12 -0
- package/dist/babel-config.js +14 -12
- package/dist/{chunk-5S2N5WDQ.js → chunk-B6FMAT44.js} +269 -52
- package/dist/{babel-VTL3CZAT.js → chunk-MBPIJFGX.js} +21 -18
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/cli.js +688 -439
- package/dist/config.d.ts +49 -30
- package/dist/config.js +2 -0
- package/dist/estree-SLPC3MKU.js +4612 -0
- package/dist/flow-JKSA2WQA.js +27546 -0
- package/dist/glimmer-KH4FHVWK.js +2894 -0
- package/dist/graphql-X7RDVKKC.js +1266 -0
- package/dist/html-A2DZMMEZ.js +2933 -0
- package/dist/markdown-35RS3VXW.js +3553 -0
- package/dist/meriyah-UIMGFPH2.js +2684 -0
- package/dist/postcss-CITECRUH.js +5080 -0
- package/dist/typescript-6QWCIZ3Q.js +20526 -0
- package/dist/typescript-CFZSZQGQ.js +13203 -0
- package/dist/yaml-RAY3ED75.js +4224 -0
- package/package.json +21 -6
- package/dist/typescript-CS6YZCMJ.js +0 -217
package/dist/babel-config.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "./chunk-MLKGABMK.js";
|
|
2
|
+
|
|
1
3
|
// src/babel-config.ts
|
|
2
4
|
import pluginTransformRuntime from "@ssets/babel/plugin/transform-runtime";
|
|
3
5
|
import presetEnv from "@ssets/babel/preset/env";
|
|
@@ -43,11 +45,11 @@ function getBaseConfig({
|
|
|
43
45
|
pluginTransformInlineEnvVars,
|
|
44
46
|
{
|
|
45
47
|
include: [
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
48
|
+
"SSE_VERSION",
|
|
49
|
+
"SSE_MAJOR_VERSION",
|
|
50
|
+
"SSE_MINOR_VERSION",
|
|
51
|
+
"SSE_PATCH_VERSION",
|
|
52
|
+
"SSE_PRERELEASE"
|
|
51
53
|
]
|
|
52
54
|
},
|
|
53
55
|
"babel-plugin-transform-inline-environment-variables"
|
|
@@ -139,16 +141,16 @@ function getBabelConfig(api) {
|
|
|
139
141
|
noResolveImports = api.noResolveImports || false;
|
|
140
142
|
}
|
|
141
143
|
return getBaseConfig({
|
|
142
|
-
debug: process.env.
|
|
144
|
+
debug: process.env.SSE_BUILD_VERBOSE === "true",
|
|
143
145
|
bundle,
|
|
144
|
-
outExtension: process.env.
|
|
146
|
+
outExtension: process.env.SSE_OUT_FILE_EXTENSION || null,
|
|
145
147
|
// any package needs to declare 7.25.0 as a runtime dependency. default is ^7.0.0
|
|
146
|
-
runtimeVersion: process.env.
|
|
147
|
-
optimizeClsx: process.env.
|
|
148
|
-
removePropTypes: process.env.
|
|
148
|
+
runtimeVersion: process.env.SSE_BABEL_RUNTIME_VERSION || "^7.25.0",
|
|
149
|
+
optimizeClsx: process.env.SSE_OPTIMIZE_CLSX === "true",
|
|
150
|
+
removePropTypes: process.env.SSE_REMOVE_PROP_TYPES === "true",
|
|
149
151
|
noResolveImports,
|
|
150
|
-
reactCompilerReactVersion: process.env.
|
|
151
|
-
reactCompilerMode: process.env.
|
|
152
|
+
reactCompilerReactVersion: process.env.SSE_REACT_COMPILER_REACT_VERSION,
|
|
153
|
+
reactCompilerMode: process.env.SSE_REACT_COMPILER_MODE
|
|
152
154
|
});
|
|
153
155
|
}
|
|
154
156
|
export {
|
|
@@ -168,7 +168,8 @@ async function createPackageExports({
|
|
|
168
168
|
cwd,
|
|
169
169
|
addTypes = false,
|
|
170
170
|
isFlat = false,
|
|
171
|
-
packageType = "commonjs"
|
|
171
|
+
packageType = "commonjs",
|
|
172
|
+
exportExtensions = [".js", ".mjs", ".cjs"]
|
|
172
173
|
}) {
|
|
173
174
|
const resolvedPackageType = packageType === "module" ? "module" : "commonjs";
|
|
174
175
|
const rawExports = typeof packageExports === "string" || Array.isArray(packageExports) ? { ".": packageExports } : packageExports || {};
|
|
@@ -179,8 +180,33 @@ async function createPackageExports({
|
|
|
179
180
|
const result = {
|
|
180
181
|
exports: newExports
|
|
181
182
|
};
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
const baseBundle = bundles.find((b) => b.type === "esm") || bundles[0];
|
|
184
|
+
const scanDir = isFlat ? outputDir : path.join(outputDir, baseBundle.dir);
|
|
185
|
+
const buildFiles = await globby("**/*", { cwd: scanDir });
|
|
186
|
+
const jsDirs = /* @__PURE__ */ new Set();
|
|
187
|
+
const otherFiles = /* @__PURE__ */ new Set();
|
|
188
|
+
let exportableFileCount = 0;
|
|
189
|
+
for (const file of buildFiles) {
|
|
190
|
+
if (file.endsWith(".d.ts") || file.endsWith(".d.mts") || file.endsWith(".d.cts")) {
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
const ext = path.extname(file);
|
|
194
|
+
const normalizedFile = file.split(path.sep).join(path.posix.sep);
|
|
195
|
+
if (exportExtensions.includes(ext)) {
|
|
196
|
+
jsDirs.add(path.posix.dirname(normalizedFile));
|
|
197
|
+
exportableFileCount++;
|
|
198
|
+
} else {
|
|
199
|
+
if (normalizedFile.endsWith("package.json")) continue;
|
|
200
|
+
otherFiles.add(normalizedFile);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
const getIndexFileName = (type) => `index${getOutExtension(type, { isFlat, packageType: resolvedPackageType })}`;
|
|
204
|
+
const rootIndexExists = await fs.stat(path.join(scanDir, getIndexFileName(baseBundle.type))).then((s) => s.isFile()).catch(() => false);
|
|
205
|
+
const hasOnlyRootIndex = exportableFileCount === 1 && rootIndexExists;
|
|
206
|
+
if (rootIndexExists && originalExports["."] === void 0) {
|
|
207
|
+
newExports["."] ??= {};
|
|
208
|
+
const rootConditions = newExports["."];
|
|
209
|
+
for (const { type, dir: bundleDir } of bundles) {
|
|
184
210
|
const outExtension = getOutExtension(type, {
|
|
185
211
|
isFlat,
|
|
186
212
|
packageType: resolvedPackageType
|
|
@@ -190,59 +216,161 @@ async function createPackageExports({
|
|
|
190
216
|
isType: true,
|
|
191
217
|
packageType: resolvedPackageType
|
|
192
218
|
});
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
);
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const exportDir = `./${dirPrefix}index${outExtension}`;
|
|
203
|
-
const typeExportDir = `./${dirPrefix}index${typeOutExtension}`;
|
|
204
|
-
if (indexFileExists) {
|
|
205
|
-
if (type === "cjs") {
|
|
206
|
-
result.main = exportDir;
|
|
207
|
-
}
|
|
208
|
-
if (typeof newExports["."] === "string" || Array.isArray(newExports["."])) {
|
|
209
|
-
throw new Error(
|
|
210
|
-
`The export "." is already defined as a string or Array.`
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
newExports["."] ??= {};
|
|
214
|
-
newExports["."][type === "cjs" ? "require" : "import"] = typeFileExists ? {
|
|
215
|
-
types: typeExportDir,
|
|
216
|
-
default: exportDir
|
|
217
|
-
} : exportDir;
|
|
219
|
+
const dirPrefix = bundleDir === "." ? "" : `${bundleDir}/`;
|
|
220
|
+
const exportPath = `./${dirPrefix}index${outExtension}`;
|
|
221
|
+
const typeExportPath = `./${dirPrefix}index${typeOutExtension}`;
|
|
222
|
+
const typeExists = addTypes && await fs.stat(path.join(outputDir, bundleDir, `index${typeOutExtension}`)).then((s) => s.isFile()).catch(() => false);
|
|
223
|
+
const conditionKey = type === "cjs" ? "require" : "import";
|
|
224
|
+
rootConditions[conditionKey] = typeExists ? { types: typeExportPath, default: exportPath } : exportPath;
|
|
225
|
+
if (type === "cjs" || type === "esm" && bundles.length === 1) {
|
|
226
|
+
result.main = exportPath;
|
|
227
|
+
if (typeExists) result.types = typeExportPath;
|
|
218
228
|
}
|
|
219
|
-
|
|
220
|
-
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
for (const dir of jsDirs) {
|
|
232
|
+
const globKey = dir === "." ? "./*" : `./${dir}/*`;
|
|
233
|
+
if (dir === "." && hasOnlyRootIndex) {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
if (originalExports[globKey] === void 0) {
|
|
237
|
+
newExports[globKey] ??= {};
|
|
238
|
+
const globConditions = newExports[globKey];
|
|
239
|
+
for (const { type, dir: bundleDir } of bundles) {
|
|
240
|
+
const outExtension = getOutExtension(type, {
|
|
241
|
+
isFlat,
|
|
242
|
+
packageType: resolvedPackageType
|
|
243
|
+
});
|
|
244
|
+
const typeOutExtension = getOutExtension(type, {
|
|
245
|
+
isFlat,
|
|
246
|
+
isType: true,
|
|
247
|
+
packageType: resolvedPackageType
|
|
248
|
+
});
|
|
249
|
+
const dirPrefix = bundleDir === "." ? "" : `${bundleDir}/`;
|
|
250
|
+
const basePath = dir === "." ? "" : `${dir}/`;
|
|
251
|
+
const exportPath = `./${dirPrefix}${basePath}*${outExtension}`;
|
|
252
|
+
const typeExportPath = `./${dirPrefix}${basePath}*${typeOutExtension}`;
|
|
253
|
+
const conditionKey = type === "cjs" ? "require" : "import";
|
|
254
|
+
globConditions[conditionKey] = addTypes ? { types: typeExportPath, default: exportPath } : exportPath;
|
|
221
255
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
256
|
+
}
|
|
257
|
+
if (dir !== ".") {
|
|
258
|
+
const dirIndexExists = await fs.stat(path.posix.join(scanDir, dir, getIndexFileName(baseBundle.type))).then((s) => s.isFile()).catch(() => false);
|
|
259
|
+
const dirKey = `./${dir}`;
|
|
260
|
+
if (dirIndexExists && originalExports[dirKey] === void 0) {
|
|
261
|
+
newExports[dirKey] ??= {};
|
|
262
|
+
const dirConditions = newExports[dirKey];
|
|
263
|
+
for (const { type, dir: bundleDir } of bundles) {
|
|
264
|
+
const outExtension = getOutExtension(type, {
|
|
265
|
+
isFlat,
|
|
266
|
+
packageType: resolvedPackageType
|
|
267
|
+
});
|
|
268
|
+
const typeOutExtension = getOutExtension(type, {
|
|
269
|
+
isFlat,
|
|
270
|
+
isType: true,
|
|
271
|
+
packageType: resolvedPackageType
|
|
272
|
+
});
|
|
273
|
+
const dirPrefix = bundleDir === "." ? "" : `${bundleDir}/`;
|
|
274
|
+
const basePath = `${dir}/`;
|
|
275
|
+
const exportPath = `./${dirPrefix}${basePath}index${outExtension}`;
|
|
276
|
+
const typeExportPath = `./${dirPrefix}${basePath}index${typeOutExtension}`;
|
|
277
|
+
const typeExists = addTypes && await fs.stat(
|
|
278
|
+
path.join(
|
|
279
|
+
outputDir,
|
|
280
|
+
bundleDir,
|
|
281
|
+
dir,
|
|
282
|
+
`index${typeOutExtension}`
|
|
283
|
+
)
|
|
284
|
+
).then((s) => s.isFile()).catch(() => false);
|
|
285
|
+
const conditionKey = type === "cjs" ? "require" : "import";
|
|
286
|
+
dirConditions[conditionKey] = typeExists ? { types: typeExportPath, default: exportPath } : exportPath;
|
|
228
287
|
}
|
|
229
|
-
await createExportsFor({
|
|
230
|
-
importPath,
|
|
231
|
-
key,
|
|
232
|
-
cwd,
|
|
233
|
-
dir,
|
|
234
|
-
type,
|
|
235
|
-
newExports,
|
|
236
|
-
typeOutExtension,
|
|
237
|
-
outExtension,
|
|
238
|
-
addTypes
|
|
239
|
-
});
|
|
240
288
|
}
|
|
241
|
-
}
|
|
242
|
-
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
for (const file of otherFiles) {
|
|
292
|
+
const exportKey = `./${file}`;
|
|
293
|
+
if (originalExports[exportKey] !== void 0) continue;
|
|
294
|
+
const dirPrefix = baseBundle.dir === "." ? "" : `${baseBundle.dir}/`;
|
|
295
|
+
newExports[exportKey] = `./${dirPrefix}${file}`;
|
|
296
|
+
}
|
|
297
|
+
const exportKeys = Object.keys(originalExports);
|
|
298
|
+
for (const key of exportKeys) {
|
|
299
|
+
const importPath = originalExports[key];
|
|
300
|
+
if (!importPath) {
|
|
301
|
+
newExports[key] = null;
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
if (key === ".") continue;
|
|
305
|
+
await Promise.all(
|
|
306
|
+
bundles.map(async ({ type, dir }) => {
|
|
307
|
+
const outExtension = getOutExtension(type, {
|
|
308
|
+
isFlat,
|
|
309
|
+
packageType: resolvedPackageType
|
|
310
|
+
});
|
|
311
|
+
const typeOutExtension = getOutExtension(type, {
|
|
312
|
+
isFlat,
|
|
313
|
+
isType: true,
|
|
314
|
+
packageType: resolvedPackageType
|
|
315
|
+
});
|
|
316
|
+
const indexFileExists = await fs.stat(path.join(outputDir, dir, `index${outExtension}`)).then(
|
|
317
|
+
(stats) => stats.isFile(),
|
|
318
|
+
() => false
|
|
319
|
+
);
|
|
320
|
+
const typeFileExists = addTypes && await fs.stat(path.join(outputDir, dir, `index${typeOutExtension}`)).then(
|
|
321
|
+
(stats) => stats.isFile(),
|
|
322
|
+
() => false
|
|
323
|
+
);
|
|
324
|
+
const dirPrefix = dir === "." ? "" : `${dir}/`;
|
|
325
|
+
const exportDir = `./${dirPrefix}index${outExtension}`;
|
|
326
|
+
const typeExportDir = `./${dirPrefix}index${typeOutExtension}`;
|
|
327
|
+
if (indexFileExists && originalExports["."] !== void 0) {
|
|
328
|
+
if (type === "cjs") {
|
|
329
|
+
result.main = exportDir;
|
|
330
|
+
}
|
|
331
|
+
if (typeof newExports["."] === "string" || Array.isArray(newExports["."])) {
|
|
332
|
+
throw new Error(
|
|
333
|
+
`The export "." is already defined as a string or Array.`
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
newExports["."] ??= {};
|
|
337
|
+
const rootConditions = newExports["."];
|
|
338
|
+
rootConditions[type === "cjs" ? "require" : "import"] = typeFileExists ? {
|
|
339
|
+
types: typeExportDir,
|
|
340
|
+
default: exportDir
|
|
341
|
+
} : exportDir;
|
|
342
|
+
}
|
|
343
|
+
if (typeFileExists && type === "cjs") {
|
|
344
|
+
result.types = typeExportDir;
|
|
345
|
+
}
|
|
346
|
+
const subExportKeys = Object.keys(originalExports);
|
|
347
|
+
for (const subKey of subExportKeys) {
|
|
348
|
+
const subImportPath = originalExports[subKey];
|
|
349
|
+
if (!subImportPath) {
|
|
350
|
+
newExports[subKey] = null;
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
if (subKey === ".") continue;
|
|
354
|
+
await createExportsFor({
|
|
355
|
+
importPath: subImportPath,
|
|
356
|
+
key: subKey,
|
|
357
|
+
cwd,
|
|
358
|
+
dir,
|
|
359
|
+
type,
|
|
360
|
+
newExports,
|
|
361
|
+
typeOutExtension,
|
|
362
|
+
outExtension,
|
|
363
|
+
addTypes
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
})
|
|
367
|
+
);
|
|
368
|
+
}
|
|
243
369
|
bundles.forEach(({ dir }) => {
|
|
244
370
|
if (dir !== ".") {
|
|
371
|
+
newExports[`./${dir}/package.json`] = null;
|
|
245
372
|
newExports[`./${dir}`] = null;
|
|
373
|
+
newExports[`./${dir}/*`] = null;
|
|
246
374
|
}
|
|
247
375
|
});
|
|
248
376
|
Object.keys(newExports).forEach((key) => {
|
|
@@ -390,12 +518,101 @@ async function mapConcurrently(items, mapper, concurrency) {
|
|
|
390
518
|
await Promise.all(workers);
|
|
391
519
|
return results;
|
|
392
520
|
}
|
|
521
|
+
async function addLicense({
|
|
522
|
+
name,
|
|
523
|
+
version,
|
|
524
|
+
license,
|
|
525
|
+
bundle,
|
|
526
|
+
outputDir,
|
|
527
|
+
isFlat,
|
|
528
|
+
packageType
|
|
529
|
+
}) {
|
|
530
|
+
const outExtension = getOutExtension(bundle, { isFlat, packageType });
|
|
531
|
+
const file = path.join(outputDir, `index${outExtension}`);
|
|
532
|
+
if (!await fs.stat(file).then(
|
|
533
|
+
(stats) => stats.isFile(),
|
|
534
|
+
() => false
|
|
535
|
+
)) {
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
const content = await fs.readFile(file, { encoding: "utf8" });
|
|
539
|
+
await fs.writeFile(
|
|
540
|
+
file,
|
|
541
|
+
`/**
|
|
542
|
+
* ${name} v${version}
|
|
543
|
+
*
|
|
544
|
+
* @license ${license}
|
|
545
|
+
* This source code is licensed under the ${license} license found in the
|
|
546
|
+
* LICENSE file in the root directory of this source tree.
|
|
547
|
+
*/
|
|
548
|
+
${content}`,
|
|
549
|
+
{ encoding: "utf8" }
|
|
550
|
+
);
|
|
551
|
+
if (process.env.SSE_BUILD_VERBOSE) console.log(`License added to ${file}`);
|
|
552
|
+
}
|
|
553
|
+
async function writePackageJson({
|
|
554
|
+
packageJson,
|
|
555
|
+
bundles,
|
|
556
|
+
outputDir,
|
|
557
|
+
cwd,
|
|
558
|
+
addTypes = false,
|
|
559
|
+
isFlat = false,
|
|
560
|
+
packageType,
|
|
561
|
+
exportExtensions
|
|
562
|
+
}) {
|
|
563
|
+
delete packageJson.scripts;
|
|
564
|
+
delete packageJson.publishConfig?.directory;
|
|
565
|
+
delete packageJson.devDependencies;
|
|
566
|
+
delete packageJson.imports;
|
|
567
|
+
const resolvedPackageType = packageType || packageJson.type || "commonjs";
|
|
568
|
+
packageJson.type = resolvedPackageType;
|
|
569
|
+
const originalExports = packageJson.exports;
|
|
570
|
+
delete packageJson.exports;
|
|
571
|
+
const originalBin = packageJson.bin;
|
|
572
|
+
delete packageJson.bin;
|
|
573
|
+
const {
|
|
574
|
+
exports: packageExports,
|
|
575
|
+
main,
|
|
576
|
+
types
|
|
577
|
+
} = await createPackageExports({
|
|
578
|
+
exports: originalExports,
|
|
579
|
+
bundles,
|
|
580
|
+
outputDir,
|
|
581
|
+
cwd,
|
|
582
|
+
addTypes,
|
|
583
|
+
isFlat,
|
|
584
|
+
packageType: resolvedPackageType,
|
|
585
|
+
exportExtensions
|
|
586
|
+
});
|
|
587
|
+
packageJson.exports = packageExports;
|
|
588
|
+
if (main) {
|
|
589
|
+
packageJson.main = main;
|
|
590
|
+
}
|
|
591
|
+
if (types) {
|
|
592
|
+
packageJson.types = types;
|
|
593
|
+
}
|
|
594
|
+
const bin = await createPackageBin({
|
|
595
|
+
bin: originalBin,
|
|
596
|
+
bundles,
|
|
597
|
+
cwd,
|
|
598
|
+
isFlat,
|
|
599
|
+
packageType: resolvedPackageType
|
|
600
|
+
});
|
|
601
|
+
if (bin) {
|
|
602
|
+
packageJson.bin = bin;
|
|
603
|
+
}
|
|
604
|
+
await fs.writeFile(
|
|
605
|
+
path.join(outputDir, "package.json"),
|
|
606
|
+
JSON.stringify(packageJson, null, 2),
|
|
607
|
+
"utf-8"
|
|
608
|
+
);
|
|
609
|
+
}
|
|
393
610
|
|
|
394
611
|
export {
|
|
395
612
|
getOutExtension,
|
|
396
|
-
createPackageExports,
|
|
397
|
-
createPackageBin,
|
|
398
613
|
validatePkgJson,
|
|
399
614
|
BASE_IGNORES,
|
|
400
|
-
mapConcurrently
|
|
615
|
+
mapConcurrently,
|
|
616
|
+
addLicense,
|
|
617
|
+
writePackageJson
|
|
401
618
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BASE_IGNORES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B6FMAT44.js";
|
|
4
4
|
|
|
5
5
|
// src/utils/babel.ts
|
|
6
6
|
import { findWorkspacesRoot } from "find-workspaces";
|
|
@@ -19,11 +19,11 @@ function getVersionEnvVariables(pkgVersion) {
|
|
|
19
19
|
throw new Error(`Couldn't parse version from package.json`);
|
|
20
20
|
}
|
|
21
21
|
return {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
SSE_VERSION: pkgVersion,
|
|
23
|
+
SSE_MAJOR_VERSION: major,
|
|
24
|
+
SSE_MINOR_VERSION: minor,
|
|
25
|
+
SSE_PATCH_VERSION: patch,
|
|
26
|
+
SSE_PRERELEASE: prerelease
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
async function cjsCopy({ from, to }) {
|
|
@@ -53,9 +53,11 @@ async function build({
|
|
|
53
53
|
ignores = [],
|
|
54
54
|
reactCompiler
|
|
55
55
|
}) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
if (verbose) {
|
|
57
|
+
console.log(
|
|
58
|
+
`Transpiling files to "${path.relative(path.dirname(sourceDir), outDir)}" for "${bundle}" bundle.`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
59
61
|
const workspaceDir = await findWorkspacesRoot(cwd);
|
|
60
62
|
const rootDir = workspaceDir ? workspaceDir.location : cwd;
|
|
61
63
|
let configFile = path.join(rootDir, "babel.config.js");
|
|
@@ -67,14 +69,14 @@ async function build({
|
|
|
67
69
|
const env = {
|
|
68
70
|
NODE_ENV: "production",
|
|
69
71
|
BABEL_ENV: bundle === "esm" ? "stable" : "node",
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
SSE_BUILD_VERBOSE: verbose ? "true" : void 0,
|
|
73
|
+
SSE_OPTIMIZE_CLSX: optimizeClsx ? "true" : void 0,
|
|
74
|
+
SSE_REMOVE_PROP_TYPES: removePropTypes ? "true" : void 0,
|
|
75
|
+
SSE_BABEL_RUNTIME_VERSION: babelRuntimeVersion,
|
|
76
|
+
SSE_OUT_FILE_EXTENSION: outExtension ?? ".js",
|
|
75
77
|
...getVersionEnvVariables(pkgVersion),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
SSE_REACT_COMPILER: reactVersion ? "1" : "0",
|
|
79
|
+
SSE_REACT_COMPILER_REACT_VERSION: reactVersion
|
|
78
80
|
};
|
|
79
81
|
const resolvedOutExtension = outExtension ?? ".js";
|
|
80
82
|
const res = await $({
|
|
@@ -103,8 +105,9 @@ ${res.stdout}`
|
|
|
103
105
|
);
|
|
104
106
|
}
|
|
105
107
|
}
|
|
108
|
+
|
|
106
109
|
export {
|
|
107
|
-
|
|
110
|
+
getVersionEnvVariables,
|
|
108
111
|
cjsCopy,
|
|
109
|
-
|
|
112
|
+
build
|
|
110
113
|
};
|