create-astrale-domain 0.2.3 → 0.2.5
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/index.js +34 -40
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -25,9 +25,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
|
|
28
|
-
//
|
|
28
|
+
// ../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
29
29
|
var require_src = __commonJS({
|
|
30
|
-
"
|
|
30
|
+
"../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
|
|
31
31
|
"use strict";
|
|
32
32
|
var ESC = "\x1B";
|
|
33
33
|
var CSI = `${ESC}[`;
|
|
@@ -81,9 +81,9 @@ var require_src = __commonJS({
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
//
|
|
84
|
+
// ../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
85
85
|
var require_picocolors = __commonJS({
|
|
86
|
-
"
|
|
86
|
+
"../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
|
|
87
87
|
var p2 = process || {};
|
|
88
88
|
var argv = p2.argv || [];
|
|
89
89
|
var env = p2.env || {};
|
|
@@ -153,10 +153,10 @@ var require_picocolors = __commonJS({
|
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
//
|
|
156
|
+
// ../node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
|
|
157
157
|
import { stripVTControlCharacters as S2 } from "node:util";
|
|
158
158
|
|
|
159
|
-
//
|
|
159
|
+
// ../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs
|
|
160
160
|
var import_sisteransi = __toESM(require_src(), 1);
|
|
161
161
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
162
162
|
import { stdin as j, stdout as M } from "node:process";
|
|
@@ -548,7 +548,7 @@ var RD = class extends x {
|
|
|
548
548
|
}
|
|
549
549
|
};
|
|
550
550
|
|
|
551
|
-
//
|
|
551
|
+
// ../node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
|
|
552
552
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
553
553
|
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
554
554
|
import y2 from "node:process";
|
|
@@ -804,23 +804,6 @@ var ADAPTER_PACKAGES = {
|
|
|
804
804
|
astrale: "@astrale-os/adapter-astrale",
|
|
805
805
|
cloudflare: "@astrale-os/adapter-cloudflare"
|
|
806
806
|
};
|
|
807
|
-
function packageJson(pkgName) {
|
|
808
|
-
const rel = LINK_TARGETS[pkgName];
|
|
809
|
-
if (rel) {
|
|
810
|
-
const local = join(WORKSPACE_ROOT, rel, "package.json");
|
|
811
|
-
if (existsSync(local)) return JSON.parse(readFileSync(local, "utf-8"));
|
|
812
|
-
}
|
|
813
|
-
const direct = tryPackageJson(require2, pkgName);
|
|
814
|
-
if (direct) return direct;
|
|
815
|
-
for (const owner of /* @__PURE__ */ new Set([BODY_PACKAGE, ...Object.values(ADAPTER_PACKAGES)])) {
|
|
816
|
-
const ownerPkgPath = tryResolve(`${owner}/package.json`);
|
|
817
|
-
if (!ownerPkgPath) continue;
|
|
818
|
-
const ownerRequire = createRequire(ownerPkgPath);
|
|
819
|
-
const nested = tryPackageJson(ownerRequire, pkgName);
|
|
820
|
-
if (nested) return nested;
|
|
821
|
-
}
|
|
822
|
-
throw new Error(`Could not read ${pkgName} package.json.`);
|
|
823
|
-
}
|
|
824
807
|
function tryResolve(id) {
|
|
825
808
|
try {
|
|
826
809
|
return require2.resolve(id);
|
|
@@ -828,21 +811,30 @@ function tryResolve(id) {
|
|
|
828
811
|
return void 0;
|
|
829
812
|
}
|
|
830
813
|
}
|
|
831
|
-
function
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
814
|
+
function packageRoot(pkg) {
|
|
815
|
+
const direct = tryResolve(`${pkg}/package.json`);
|
|
816
|
+
if (direct) return dirname(direct);
|
|
817
|
+
const entry = tryResolve(pkg);
|
|
818
|
+
if (entry) {
|
|
819
|
+
let dir = dirname(entry);
|
|
820
|
+
for (; ; ) {
|
|
821
|
+
const candidate = join(dir, "package.json");
|
|
822
|
+
if (existsSync(candidate)) {
|
|
823
|
+
try {
|
|
824
|
+
const parsed = JSON.parse(readFileSync(candidate, "utf-8"));
|
|
825
|
+
if (parsed.name === pkg) return dir;
|
|
826
|
+
} catch {
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
const parent = dirname(dir);
|
|
830
|
+
if (parent === dir) break;
|
|
831
|
+
dir = parent;
|
|
832
|
+
}
|
|
836
833
|
}
|
|
837
|
-
}
|
|
838
|
-
function publishedDepVersion(pkgName) {
|
|
839
|
-
const pkg = packageJson(pkgName);
|
|
840
|
-
const version = pkg.version;
|
|
841
|
-
if (!version) throw new Error(`Could not read ${pkgName} package version.`);
|
|
842
|
-
return version;
|
|
834
|
+
throw new Error(`Could not locate the ${pkg} package.`);
|
|
843
835
|
}
|
|
844
836
|
function templateDir(pkg) {
|
|
845
|
-
return join(
|
|
837
|
+
return join(packageRoot(pkg), "template");
|
|
846
838
|
}
|
|
847
839
|
async function scaffold(opts) {
|
|
848
840
|
const src = templateDir(BODY_PACKAGE);
|
|
@@ -855,7 +847,7 @@ async function scaffold(opts) {
|
|
|
855
847
|
}
|
|
856
848
|
await cp(src, opts.dir, {
|
|
857
849
|
recursive: true,
|
|
858
|
-
filter: (s) => !/\/(node_modules|\.astrale|\.dist|\.domain-studio|dist-client|\.wrangler|pnpm-lock\.yaml|\.DS_Store)(\/|$)/.test(
|
|
850
|
+
filter: (s) => !/\/(node_modules|\.agents|\.astrale|\.dist|\.domain-studio|dist-client|\.wrangler|pnpm-lock\.yaml|\.DS_Store)(\/|$)/.test(
|
|
859
851
|
`/${relative(src, s)}`
|
|
860
852
|
)
|
|
861
853
|
});
|
|
@@ -895,8 +887,9 @@ async function setAdapterDep(dir, from, to) {
|
|
|
895
887
|
const path = join(dir, "package.json");
|
|
896
888
|
const pkg = JSON.parse(await readFile(path, "utf-8"));
|
|
897
889
|
if (!pkg.dependencies || !(from in pkg.dependencies)) return;
|
|
890
|
+
const range = pkg.dependencies[from];
|
|
898
891
|
delete pkg.dependencies[from];
|
|
899
|
-
pkg.dependencies[to] =
|
|
892
|
+
pkg.dependencies[to] = range;
|
|
900
893
|
pkg.dependencies = Object.fromEntries(
|
|
901
894
|
Object.entries(pkg.dependencies).sort(([a], [b3]) => a.localeCompare(b3))
|
|
902
895
|
);
|
|
@@ -925,12 +918,13 @@ async function rewritePackageJson(dir, name, link) {
|
|
|
925
918
|
await writeFile(path, JSON.stringify(pkg, null, 2) + "\n");
|
|
926
919
|
}
|
|
927
920
|
function rewriteAstraleDeps(pkg, link) {
|
|
921
|
+
if (!link) return false;
|
|
928
922
|
let changed = false;
|
|
929
923
|
for (const group of [pkg.dependencies, pkg.devDependencies]) {
|
|
930
924
|
if (!group) continue;
|
|
931
925
|
for (const dep of Object.keys(group)) {
|
|
932
|
-
if (!dep.startsWith("@astrale-os/")) continue;
|
|
933
|
-
const next =
|
|
926
|
+
if (!dep.startsWith("@astrale-os/") || !LINK_TARGETS[dep]) continue;
|
|
927
|
+
const next = `link:${join(WORKSPACE_ROOT, LINK_TARGETS[dep])}`;
|
|
934
928
|
if (group[dep] !== next) {
|
|
935
929
|
group[dep] = next;
|
|
936
930
|
changed = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-astrale-domain",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Scaffold a standalone Astrale domain — npm create astrale-domain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"type": "module",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@clack/prompts": "^0.11.0",
|
|
22
|
-
"@astrale-os/adapter-
|
|
23
|
-
"@astrale-os/adapter-
|
|
22
|
+
"@astrale-os/adapter-cloudflare": "^0.4.2",
|
|
23
|
+
"@astrale-os/adapter-astrale": "^0.4.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@astrale-os/ox": ">=0.1.0 <1.0.0",
|