@lotics/cli 0.226.0 → 0.226.1
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/src/cli.js +21 -10
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -53876,7 +53876,7 @@ function resultSideEffects(result) {
|
|
|
53876
53876
|
|
|
53877
53877
|
// src/version.ts
|
|
53878
53878
|
init_define_LOTICS_KIT_VERSIONS();
|
|
53879
|
-
var VERSION = "0.226.
|
|
53879
|
+
var VERSION = "0.226.1";
|
|
53880
53880
|
|
|
53881
53881
|
// src/timezone.ts
|
|
53882
53882
|
init_define_LOTICS_KIT_VERSIONS();
|
|
@@ -72988,12 +72988,22 @@ function installedKitVersion(projectDir, pkg) {
|
|
|
72988
72988
|
return null;
|
|
72989
72989
|
}
|
|
72990
72990
|
}
|
|
72991
|
-
function
|
|
72992
|
-
const
|
|
72993
|
-
|
|
72994
|
-
|
|
72995
|
-
|
|
72996
|
-
|
|
72991
|
+
function installedKitViteExports(projectDir) {
|
|
72992
|
+
const kitDir = path13.join(projectDir, "node_modules", "@lotics", "ui");
|
|
72993
|
+
try {
|
|
72994
|
+
const manifest = JSON.parse(fs11.readFileSync(path13.join(kitDir, "package.json"), "utf-8"));
|
|
72995
|
+
const entry = manifest.exports?.["./vite"];
|
|
72996
|
+
const file2 = typeof entry === "string" ? entry : entry?.default;
|
|
72997
|
+
if (file2 === void 0) return /* @__PURE__ */ new Set();
|
|
72998
|
+
const code = codeOnly(fs11.readFileSync(path13.join(kitDir, file2), "utf-8"));
|
|
72999
|
+
const declared = [...code.matchAll(/^export\s+(?:async\s+)?(?:function\*?|const|let|class)\s+([\w$]+)/gm)].map((m) => m[1]);
|
|
73000
|
+
const listed = [...code.matchAll(/^export\s*\{([^}]*)\}/gm)].flatMap(
|
|
73001
|
+
(m) => m[1].split(",").map((spec) => spec.trim().split(/\s+as\s+/).pop() ?? "").filter(Boolean)
|
|
73002
|
+
);
|
|
73003
|
+
return /* @__PURE__ */ new Set([...declared, ...listed]);
|
|
73004
|
+
} catch {
|
|
73005
|
+
return /* @__PURE__ */ new Set();
|
|
73006
|
+
}
|
|
72997
73007
|
}
|
|
72998
73008
|
async function publishedKitVersion(pkg) {
|
|
72999
73009
|
const controller = new AbortController();
|
|
@@ -73194,7 +73204,8 @@ function ensureAppViteConfig(projectDir) {
|
|
|
73194
73204
|
const changes = [];
|
|
73195
73205
|
const blocked = [];
|
|
73196
73206
|
const added = [];
|
|
73197
|
-
|
|
73207
|
+
const kitHas = installedKitViteExports(projectDir);
|
|
73208
|
+
if (!code.includes("loticsOptimizeDeps") && kitHas.has("loticsOptimizeDeps")) {
|
|
73198
73209
|
const anchor = shallowestKey(code, /^([ \t]*)resolve:[ \t]*loticsResolve\(\),/gm);
|
|
73199
73210
|
if (/^[ \t]*optimizeDeps[ \t]*:/m.test(code) || anchor === null) {
|
|
73200
73211
|
blocked.push({ key: "optimizeDeps", line: VITE_OPTIMIZE_DEPS_LINE });
|
|
@@ -73206,7 +73217,7 @@ ${anchor.indent}${VITE_OPTIMIZE_DEPS_LINE}` });
|
|
|
73206
73217
|
changes.push(`added \`${VITE_OPTIMIZE_DEPS_LINE}\``);
|
|
73207
73218
|
}
|
|
73208
73219
|
}
|
|
73209
|
-
if (!code.includes("loticsFsAllow")) {
|
|
73220
|
+
if (!code.includes("loticsFsAllow") && kitHas.has("loticsFsAllow")) {
|
|
73210
73221
|
const anchor = shallowestKey(code, /^([ \t]*)server:[ \t]*\{/gm);
|
|
73211
73222
|
const viteImport = namedImport(before, code, "vite");
|
|
73212
73223
|
if (/^[ \t]*fs[ \t]*:/m.test(code) || anchor === null || viteImport === null) {
|
|
@@ -75268,7 +75279,7 @@ function warnIfProjectFootguns(projectDir, sourceText) {
|
|
|
75268
75279
|
);
|
|
75269
75280
|
}
|
|
75270
75281
|
}
|
|
75271
|
-
if (configName !== void 0 &&
|
|
75282
|
+
if (configName !== void 0 && installedKitViteExports(projectDir).has("loticsOptimizeDeps")) {
|
|
75272
75283
|
const config2 = fs11.readFileSync(path13.join(projectDir, configName), "utf-8");
|
|
75273
75284
|
const handWritten = objectBlocks(codeOnly(config2), "optimizeDeps").some(
|
|
75274
75285
|
(block) => /(?:^|[{,;])\s*include\s*:/.test(block) && !block.includes("loticsOptimizeDeps")
|