@onexapis/cli 1.1.31 → 1.1.34
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/cli.js +19 -3
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +19 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -2
- package/dist/index.mjs.map +1 -1
- package/dist/preview/preview-app.tsx +31 -22
- package/package.json +2 -2
- package/templates/default/CLAUDE.md +82 -59
package/dist/cli.js
CHANGED
|
@@ -187,6 +187,10 @@ async function scanImportsFromPackage(sourceDir, packageName) {
|
|
|
187
187
|
`(?:import|export)\\s+(?:type\\s+)?\\{([^}]+)\\}\\s+from\\s+["']${escapedPkg}(/[\\w./-]+)?["']`,
|
|
188
188
|
"g"
|
|
189
189
|
);
|
|
190
|
+
const namespaceImportRegex = new RegExp(
|
|
191
|
+
`import\\s+\\*\\s+as\\s+\\w+\\s+from\\s+["']${escapedPkg}(/[\\w./-]+)?["']`,
|
|
192
|
+
"g"
|
|
193
|
+
);
|
|
190
194
|
const sourceFiles = await glob.glob("**/*.{ts,tsx}", {
|
|
191
195
|
cwd: sourceDir,
|
|
192
196
|
ignore: ["node_modules/**", "dist/**"]
|
|
@@ -194,6 +198,11 @@ async function scanImportsFromPackage(sourceDir, packageName) {
|
|
|
194
198
|
for (const file of sourceFiles) {
|
|
195
199
|
try {
|
|
196
200
|
const content = await fs7__default.default.readFile(path8__default.default.join(sourceDir, file), "utf-8");
|
|
201
|
+
for (const match of content.matchAll(namespaceImportRegex)) {
|
|
202
|
+
const subpath = match[1] ? match[1].slice(1) : "";
|
|
203
|
+
if (!result[subpath]) result[subpath] = /* @__PURE__ */ new Set();
|
|
204
|
+
result[subpath].add("*");
|
|
205
|
+
}
|
|
197
206
|
for (const match of content.matchAll(importRegex)) {
|
|
198
207
|
const subpath = match[2] ? match[2].slice(1) : "";
|
|
199
208
|
if (!result[subpath]) result[subpath] = /* @__PURE__ */ new Set();
|
|
@@ -234,8 +243,10 @@ function createCoreGlobalPlugin(themePath) {
|
|
|
234
243
|
const moduleAccess = subpath ? `['${subpath}']` : "";
|
|
235
244
|
let namedExports = [];
|
|
236
245
|
const cacheKey = subpath || "__root__";
|
|
237
|
-
|
|
238
|
-
|
|
246
|
+
const cached = exportsBySubpath[cacheKey];
|
|
247
|
+
const needsAllExports = cached?.includes("*");
|
|
248
|
+
if (cached && cached.length > 0 && !needsAllExports) {
|
|
249
|
+
namedExports = [...new Set(cached)];
|
|
239
250
|
} else {
|
|
240
251
|
const distFileName = subpath ? `${subpath}.mjs` : "index.mjs";
|
|
241
252
|
let distPath = await resolveNodeModulesFile(
|
|
@@ -259,6 +270,11 @@ function createCoreGlobalPlugin(themePath) {
|
|
|
259
270
|
}).filter((n) => n.length > 0);
|
|
260
271
|
namedExports.push(...names);
|
|
261
272
|
}
|
|
273
|
+
if (cached && cached.length > 0) {
|
|
274
|
+
for (const n of cached) {
|
|
275
|
+
if (n !== "*") namedExports.push(n);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
262
278
|
namedExports = [...new Set(namedExports)];
|
|
263
279
|
} catch {
|
|
264
280
|
}
|
|
@@ -4434,7 +4450,7 @@ init_logger();
|
|
|
4434
4450
|
var AUTH_DIR = path8__default.default.join(os3__default.default.homedir(), ".onexthm");
|
|
4435
4451
|
var AUTH_FILE = path8__default.default.join(AUTH_DIR, "auth.json");
|
|
4436
4452
|
function getApiUrl() {
|
|
4437
|
-
return process.env.
|
|
4453
|
+
return process.env.ONEXTHM_API_URL || process.env.NEXT_PUBLIC_API_URL || "https://platform-dev.onexeos.com";
|
|
4438
4454
|
}
|
|
4439
4455
|
async function saveAuthTokens(tokens) {
|
|
4440
4456
|
await fs__default.default.ensureDir(AUTH_DIR);
|