@sse-ui/builder 1.1.0 → 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-44E7L73Q.js → chunk-B6FMAT44.js} +16 -8
- package/dist/{babel-QBNMMXUJ.js → chunk-MBPIJFGX.js} +21 -18
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/cli.js +601 -326
- package/dist/config.d.ts +48 -36
- 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 +16 -5
- package/dist/typescript-3J237V7Q.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 {
|
|
@@ -185,6 +185,7 @@ async function createPackageExports({
|
|
|
185
185
|
const buildFiles = await globby("**/*", { cwd: scanDir });
|
|
186
186
|
const jsDirs = /* @__PURE__ */ new Set();
|
|
187
187
|
const otherFiles = /* @__PURE__ */ new Set();
|
|
188
|
+
let exportableFileCount = 0;
|
|
188
189
|
for (const file of buildFiles) {
|
|
189
190
|
if (file.endsWith(".d.ts") || file.endsWith(".d.mts") || file.endsWith(".d.cts")) {
|
|
190
191
|
continue;
|
|
@@ -193,12 +194,15 @@ async function createPackageExports({
|
|
|
193
194
|
const normalizedFile = file.split(path.sep).join(path.posix.sep);
|
|
194
195
|
if (exportExtensions.includes(ext)) {
|
|
195
196
|
jsDirs.add(path.posix.dirname(normalizedFile));
|
|
197
|
+
exportableFileCount++;
|
|
196
198
|
} else {
|
|
199
|
+
if (normalizedFile.endsWith("package.json")) continue;
|
|
197
200
|
otherFiles.add(normalizedFile);
|
|
198
201
|
}
|
|
199
202
|
}
|
|
200
203
|
const getIndexFileName = (type) => `index${getOutExtension(type, { isFlat, packageType: resolvedPackageType })}`;
|
|
201
204
|
const rootIndexExists = await fs.stat(path.join(scanDir, getIndexFileName(baseBundle.type))).then((s) => s.isFile()).catch(() => false);
|
|
205
|
+
const hasOnlyRootIndex = exportableFileCount === 1 && rootIndexExists;
|
|
202
206
|
if (rootIndexExists && originalExports["."] === void 0) {
|
|
203
207
|
newExports["."] ??= {};
|
|
204
208
|
const rootConditions = newExports["."];
|
|
@@ -226,6 +230,9 @@ async function createPackageExports({
|
|
|
226
230
|
}
|
|
227
231
|
for (const dir of jsDirs) {
|
|
228
232
|
const globKey = dir === "." ? "./*" : `./${dir}/*`;
|
|
233
|
+
if (dir === "." && hasOnlyRootIndex) {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
229
236
|
if (originalExports[globKey] === void 0) {
|
|
230
237
|
newExports[globKey] ??= {};
|
|
231
238
|
const globConditions = newExports[globKey];
|
|
@@ -336,17 +343,17 @@ async function createPackageExports({
|
|
|
336
343
|
if (typeFileExists && type === "cjs") {
|
|
337
344
|
result.types = typeExportDir;
|
|
338
345
|
}
|
|
339
|
-
const
|
|
340
|
-
for (const
|
|
341
|
-
const
|
|
342
|
-
if (!
|
|
343
|
-
newExports[
|
|
346
|
+
const subExportKeys = Object.keys(originalExports);
|
|
347
|
+
for (const subKey of subExportKeys) {
|
|
348
|
+
const subImportPath = originalExports[subKey];
|
|
349
|
+
if (!subImportPath) {
|
|
350
|
+
newExports[subKey] = null;
|
|
344
351
|
continue;
|
|
345
352
|
}
|
|
346
|
-
if (
|
|
353
|
+
if (subKey === ".") continue;
|
|
347
354
|
await createExportsFor({
|
|
348
|
-
importPath:
|
|
349
|
-
key:
|
|
355
|
+
importPath: subImportPath,
|
|
356
|
+
key: subKey,
|
|
350
357
|
cwd,
|
|
351
358
|
dir,
|
|
352
359
|
type,
|
|
@@ -361,6 +368,7 @@ async function createPackageExports({
|
|
|
361
368
|
}
|
|
362
369
|
bundles.forEach(({ dir }) => {
|
|
363
370
|
if (dir !== ".") {
|
|
371
|
+
newExports[`./${dir}/package.json`] = null;
|
|
364
372
|
newExports[`./${dir}`] = null;
|
|
365
373
|
newExports[`./${dir}/*`] = null;
|
|
366
374
|
}
|
|
@@ -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
|
};
|