create-astrale-domain 0.3.0-beta.93 → 0.3.0-beta.95
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/CHANGELOG.md +38 -0
- package/dist/index.js +244 -22
- package/package.json +5 -4
- package/template/.variants/react/README.md +2 -2
- package/template/package.json +3 -5
- package/template/runtime.ts +1 -2
- package/template/tests/e2e/application.test.ts +1 -2
- package/template/tsconfig.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.0-beta.95](https://github.com/astrale-os/sdk/compare/create-astrale-domain-v0.3.0-beta.94...create-astrale-domain-v0.3.0-beta.95) (2026-09-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* dependencies
|
|
10
|
+
* @astrale-os/adapter-astrale bumped to 0.5.0-beta.95
|
|
11
|
+
* @astrale-os/adapter-cloudflare bumped to 0.5.0-beta.102
|
|
12
|
+
* devDependencies
|
|
13
|
+
* @astrale-os/sdk bumped to 0.5.0-beta.99
|
|
14
|
+
|
|
15
|
+
## [0.3.0-beta.94](https://github.com/astrale-os/sdk/compare/create-astrale-domain-v0.3.0-beta.93...create-astrale-domain-v0.3.0-beta.94) (2026-09-01)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### ⚠ BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
* unify Domain functions layer
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* unify Domain functions layer ([326a3ea](https://github.com/astrale-os/sdk/commit/326a3ea7f296157d511a552cc159b82a34937f3a))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* admit leading-digit domain slugs ([ec9288c](https://github.com/astrale-os/sdk/commit/ec9288cb8a2d0506dd91fcd4c01f47688086bbd1))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Dependencies
|
|
33
|
+
|
|
34
|
+
* The following workspace dependencies were updated
|
|
35
|
+
* dependencies
|
|
36
|
+
* @astrale-os/adapter-astrale bumped to 0.5.0-beta.94
|
|
37
|
+
* @astrale-os/adapter-cloudflare bumped to 0.5.0-beta.101
|
|
38
|
+
* devDependencies
|
|
39
|
+
* @astrale-os/sdk bumped to 0.5.0-beta.98
|
|
40
|
+
|
|
3
41
|
## [0.3.0-beta.93](https://github.com/astrale-os/sdk/compare/create-astrale-domain-v0.3.0-beta.92...create-astrale-domain-v0.3.0-beta.93) (2026-08-31)
|
|
4
42
|
|
|
5
43
|
|
package/dist/index.js
CHANGED
|
@@ -783,6 +783,237 @@ var Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
|
783
783
|
import { existsSync as existsSync2 } from "node:fs";
|
|
784
784
|
import { relative as relative2, resolve as resolve2 } from "node:path";
|
|
785
785
|
|
|
786
|
+
// ../node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.23/node_modules/@astrale-os/kernel-dsl/dist/v1/addressing/patterns.js
|
|
787
|
+
var DOMAIN_ORIGIN_PATTERN = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/u;
|
|
788
|
+
var MEMBER_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_]*$/u;
|
|
789
|
+
var DEPENDENCY_ALIAS_PATTERN = /^[a-z][A-Za-z0-9]*$/u;
|
|
790
|
+
var CORE_SLUG_PATTERN = /^[a-z][a-z0-9-]{0,99}$/u;
|
|
791
|
+
var DOMAIN_REVISION_PATTERN = /^sha256:[0-9a-f]{64}$/u;
|
|
792
|
+
var DOMAIN_REVISION_FULL_MATCH = "sha256:[0-9a-f]{64}";
|
|
793
|
+
var DOMAIN_ORIGIN_FULL_MATCH = "([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?";
|
|
794
|
+
var MEMBER_NAME_FULL_MATCH = "[A-Za-z][A-Za-z0-9_]*";
|
|
795
|
+
var DEPENDENCY_ALIAS_FULL_MATCH = "[a-z][A-Za-z0-9]*";
|
|
796
|
+
var PROPERTY_KEY_FULL_MATCH = "([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?:class\\.[A-Za-z][A-Za-z0-9_]*\\.property\\.[A-Za-z][A-Za-z0-9_]*";
|
|
797
|
+
var PROPERTY_KEY_PATTERN = new RegExp(`^(?:${PROPERTY_KEY_FULL_MATCH})$`, "u");
|
|
798
|
+
var patterns = Object.freeze({
|
|
799
|
+
coreSlug: CORE_SLUG_PATTERN,
|
|
800
|
+
dependencyAlias: DEPENDENCY_ALIAS_PATTERN,
|
|
801
|
+
dependencyAliasFullMatch: DEPENDENCY_ALIAS_FULL_MATCH,
|
|
802
|
+
memberName: MEMBER_NAME_PATTERN,
|
|
803
|
+
memberNameFullMatch: MEMBER_NAME_FULL_MATCH,
|
|
804
|
+
origin: DOMAIN_ORIGIN_PATTERN,
|
|
805
|
+
originFullMatch: DOMAIN_ORIGIN_FULL_MATCH,
|
|
806
|
+
propertyKey: PROPERTY_KEY_PATTERN,
|
|
807
|
+
propertyKeyFullMatch: PROPERTY_KEY_FULL_MATCH,
|
|
808
|
+
revision: DOMAIN_REVISION_PATTERN,
|
|
809
|
+
revisionFullMatch: DOMAIN_REVISION_FULL_MATCH
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
// ../node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.23/node_modules/@astrale-os/kernel-dsl/dist/v1/addressing/definition-ref.js
|
|
813
|
+
var DEFINITION_KINDS = /* @__PURE__ */ new Set([
|
|
814
|
+
"class",
|
|
815
|
+
"function",
|
|
816
|
+
"policy",
|
|
817
|
+
"view",
|
|
818
|
+
"core"
|
|
819
|
+
]);
|
|
820
|
+
function acceptDefinitionRef(input) {
|
|
821
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) {
|
|
822
|
+
invalid(input);
|
|
823
|
+
}
|
|
824
|
+
const value = input;
|
|
825
|
+
const keys = Reflect.ownKeys(value);
|
|
826
|
+
if (keys.length !== 3 || !keys.every((key) => key === "origin" || key === "kind" || key === "name")) {
|
|
827
|
+
invalid(input);
|
|
828
|
+
}
|
|
829
|
+
const origin = value.origin;
|
|
830
|
+
const kind = value.kind;
|
|
831
|
+
const name = value.name;
|
|
832
|
+
if (typeof origin !== "string" || !DOMAIN_ORIGIN_PATTERN.test(origin) || typeof kind !== "string" || !DEFINITION_KINDS.has(kind) || typeof name !== "string" || !definitionNameMatches(kind, name)) {
|
|
833
|
+
invalid(input);
|
|
834
|
+
}
|
|
835
|
+
return Object.freeze({
|
|
836
|
+
origin,
|
|
837
|
+
kind,
|
|
838
|
+
name
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
function invalid(input) {
|
|
842
|
+
throw new TypeError(`Invalid DefinitionRef: ${JSON.stringify(input)}.`);
|
|
843
|
+
}
|
|
844
|
+
function definitionNameMatches(kind, name) {
|
|
845
|
+
return kind === "core" ? CORE_SLUG_PATTERN.test(name) : MEMBER_NAME_PATTERN.test(name);
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// ../node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.23/node_modules/@astrale-os/kernel-dsl/dist/v1/addressing/key.js
|
|
849
|
+
var DEFINITION_KEY = /^(?:class|function|policy|view)\.([A-Za-z][A-Za-z0-9_]*)$/u;
|
|
850
|
+
var CORE_KEY = /^core\.([a-z][a-z0-9-]{0,99})$/u;
|
|
851
|
+
var MEMBER_KEY = /^class\.([A-Za-z][A-Za-z0-9_]*)\.(property|method)\.([A-Za-z][A-Za-z0-9_]*)$/u;
|
|
852
|
+
function Key(input) {
|
|
853
|
+
if (typeof input !== "string" || !isCanonicalKey(input)) {
|
|
854
|
+
throw new TypeError(`Invalid Key: ${JSON.stringify(input)}.`);
|
|
855
|
+
}
|
|
856
|
+
return input;
|
|
857
|
+
}
|
|
858
|
+
(function(Key2) {
|
|
859
|
+
function of(ref) {
|
|
860
|
+
const definition = acceptDefinitionRef(ref);
|
|
861
|
+
return Key2(`${definition.origin}:${definition.kind}.${definition.name}`);
|
|
862
|
+
}
|
|
863
|
+
Key2.of = of;
|
|
864
|
+
function origin(input) {
|
|
865
|
+
const admitted = Key2(input);
|
|
866
|
+
return admitted.slice(0, admitted.indexOf(":"));
|
|
867
|
+
}
|
|
868
|
+
Key2.origin = origin;
|
|
869
|
+
function is(input) {
|
|
870
|
+
return typeof input === "string" && isCanonicalKey(input);
|
|
871
|
+
}
|
|
872
|
+
Key2.is = is;
|
|
873
|
+
})(Key || (Key = {}));
|
|
874
|
+
function isCanonicalKey(input) {
|
|
875
|
+
const separator = input.indexOf(":");
|
|
876
|
+
return separator > 0 && separator === input.lastIndexOf(":") && DOMAIN_ORIGIN_PATTERN.test(input.slice(0, separator)) && isCanonicalCoordinate(input.slice(separator + 1));
|
|
877
|
+
}
|
|
878
|
+
function isCanonicalCoordinate(input) {
|
|
879
|
+
return DEFINITION_KEY.test(input) || CORE_KEY.test(input) || MEMBER_KEY.test(input);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
// ../node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.23/node_modules/@astrale-os/kernel-dsl/dist/v1/addressing/class-key.js
|
|
883
|
+
function ClassKey(input) {
|
|
884
|
+
if (!ClassKey.is(input)) {
|
|
885
|
+
throw new TypeError(`Invalid canonical ClassKey: ${JSON.stringify(input)}.`);
|
|
886
|
+
}
|
|
887
|
+
return input;
|
|
888
|
+
}
|
|
889
|
+
(function(ClassKey2) {
|
|
890
|
+
function of(ref2) {
|
|
891
|
+
const admitted = acceptDefinitionRef(ref2);
|
|
892
|
+
if (admitted.kind !== "class") {
|
|
893
|
+
throw new TypeError(`Invalid ClassKey coordinate: ${JSON.stringify(ref2)}.`);
|
|
894
|
+
}
|
|
895
|
+
return Key.of(admitted);
|
|
896
|
+
}
|
|
897
|
+
ClassKey2.of = of;
|
|
898
|
+
function is(input) {
|
|
899
|
+
if (typeof input !== "string" || !Key.is(input))
|
|
900
|
+
return false;
|
|
901
|
+
const separator = input.indexOf(":");
|
|
902
|
+
return input.slice(separator + 1).startsWith("class.") && !input.includes(".property.") && !input.includes(".method.");
|
|
903
|
+
}
|
|
904
|
+
ClassKey2.is = is;
|
|
905
|
+
function ref(input) {
|
|
906
|
+
const admitted = ClassKey2(input);
|
|
907
|
+
const separator = admitted.indexOf(":");
|
|
908
|
+
return acceptDefinitionRef({
|
|
909
|
+
origin: admitted.slice(0, separator),
|
|
910
|
+
kind: "class",
|
|
911
|
+
name: admitted.slice(separator + ":class.".length)
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
ClassKey2.ref = ref;
|
|
915
|
+
})(ClassKey || (ClassKey = {}));
|
|
916
|
+
|
|
917
|
+
// ../node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.23/node_modules/@astrale-os/kernel-dsl/dist/v1/addressing/method-key.js
|
|
918
|
+
function MethodKey(input) {
|
|
919
|
+
if (!MethodKey.is(input)) {
|
|
920
|
+
throw new TypeError(`Invalid canonical MethodKey: ${JSON.stringify(input)}.`);
|
|
921
|
+
}
|
|
922
|
+
return input;
|
|
923
|
+
}
|
|
924
|
+
(function(MethodKey2) {
|
|
925
|
+
function of(owner, name) {
|
|
926
|
+
const admitted = acceptDefinitionRef(owner);
|
|
927
|
+
if (admitted.kind !== "class" || !MEMBER_NAME_PATTERN.test(name)) {
|
|
928
|
+
throw new TypeError(`Invalid MethodKey address: ${JSON.stringify({ owner, name })}.`);
|
|
929
|
+
}
|
|
930
|
+
return Key(`${admitted.origin}:class.${admitted.name}.method.${name}`);
|
|
931
|
+
}
|
|
932
|
+
MethodKey2.of = of;
|
|
933
|
+
function is(input) {
|
|
934
|
+
if (typeof input !== "string" || !Key.is(input))
|
|
935
|
+
return false;
|
|
936
|
+
const coordinate = input.slice(input.indexOf(":") + 1);
|
|
937
|
+
return coordinate.startsWith("class.") && coordinate.includes(".method.");
|
|
938
|
+
}
|
|
939
|
+
MethodKey2.is = is;
|
|
940
|
+
function address(input) {
|
|
941
|
+
const admitted = MethodKey2(input);
|
|
942
|
+
const separator = admitted.indexOf(":");
|
|
943
|
+
const coordinate = admitted.slice(separator + ":class.".length);
|
|
944
|
+
const member = coordinate.indexOf(".method.");
|
|
945
|
+
return Object.freeze({
|
|
946
|
+
kind: "method",
|
|
947
|
+
owner: acceptDefinitionRef({
|
|
948
|
+
origin: admitted.slice(0, separator),
|
|
949
|
+
kind: "class",
|
|
950
|
+
name: coordinate.slice(0, member)
|
|
951
|
+
}),
|
|
952
|
+
name: coordinate.slice(member + ".method.".length)
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
MethodKey2.address = address;
|
|
956
|
+
})(MethodKey || (MethodKey = {}));
|
|
957
|
+
|
|
958
|
+
// ../node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.23/node_modules/@astrale-os/kernel-dsl/dist/v1/addressing/property-key.js
|
|
959
|
+
function PropertyKey(input) {
|
|
960
|
+
if (!PropertyKey.is(input)) {
|
|
961
|
+
throw new TypeError(`Invalid canonical PropertyKey: ${JSON.stringify(input)}.`);
|
|
962
|
+
}
|
|
963
|
+
return input;
|
|
964
|
+
}
|
|
965
|
+
(function(PropertyKey2) {
|
|
966
|
+
function of(owner, name) {
|
|
967
|
+
const admitted = acceptDefinitionRef(owner);
|
|
968
|
+
if (admitted.kind !== "class" || !MEMBER_NAME_PATTERN.test(name)) {
|
|
969
|
+
throw new TypeError(`Invalid PropertyKey coordinate: ${JSON.stringify({ owner, name })}.`);
|
|
970
|
+
}
|
|
971
|
+
return Key(`${admitted.origin}:class.${admitted.name}.property.${name}`);
|
|
972
|
+
}
|
|
973
|
+
PropertyKey2.of = of;
|
|
974
|
+
function is(input) {
|
|
975
|
+
return typeof input === "string" && Key.is(input) && PROPERTY_KEY_PATTERN.test(input);
|
|
976
|
+
}
|
|
977
|
+
PropertyKey2.is = is;
|
|
978
|
+
function address(input) {
|
|
979
|
+
const admitted = PropertyKey2(input);
|
|
980
|
+
const separator = admitted.indexOf(":");
|
|
981
|
+
const coordinate = admitted.slice(separator + ":class.".length);
|
|
982
|
+
const member = coordinate.indexOf(".property.");
|
|
983
|
+
return Object.freeze({
|
|
984
|
+
owner: acceptDefinitionRef({
|
|
985
|
+
origin: admitted.slice(0, separator),
|
|
986
|
+
kind: "class",
|
|
987
|
+
name: coordinate.slice(0, member)
|
|
988
|
+
}),
|
|
989
|
+
name: coordinate.slice(member + ".property.".length)
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
PropertyKey2.address = address;
|
|
993
|
+
})(PropertyKey || (PropertyKey = {}));
|
|
994
|
+
|
|
995
|
+
// src/naming/index.ts
|
|
996
|
+
var NPM_NAME_MAX = 214;
|
|
997
|
+
var DNS_NAME_MAX = 253;
|
|
998
|
+
function hasValidLabels(value) {
|
|
999
|
+
return patterns.origin.test(`${value}.dev`);
|
|
1000
|
+
}
|
|
1001
|
+
function isValidOrigin(value) {
|
|
1002
|
+
return value.length <= DNS_NAME_MAX && patterns.origin.test(value);
|
|
1003
|
+
}
|
|
1004
|
+
function deriveOrigin(slug) {
|
|
1005
|
+
return slug.includes(".") ? slug : `${slug}.example.dev`;
|
|
1006
|
+
}
|
|
1007
|
+
function isValidProjectSlug(value) {
|
|
1008
|
+
return value.length <= NPM_NAME_MAX && isValidOrigin(deriveOrigin(value));
|
|
1009
|
+
}
|
|
1010
|
+
function isValidInstanceSlug(value) {
|
|
1011
|
+
return !value.includes(".") && hasValidLabels(value);
|
|
1012
|
+
}
|
|
1013
|
+
var PROJECT_SLUG_RULE = `Use dot-separated labels of lowercase letters, digits and inner dashes (63 characters per label, ${NPM_NAME_MAX} in total) \u2014 e.g. crm, 1crm, crm.example.dev.`;
|
|
1014
|
+
var ORIGIN_RULE = `Use a lowercase dotted domain with valid DNS labels (63 characters per label, ${DNS_NAME_MAX} in total) \u2014 e.g. crm.example.dev.`;
|
|
1015
|
+
var INSTANCE_SLUG_RULE = "Use one label of lowercase letters, digits and inner dashes (63 characters, no dots) \u2014 e.g. bryan-dev.";
|
|
1016
|
+
|
|
786
1017
|
// src/scaffold/index.ts
|
|
787
1018
|
import { existsSync, readFileSync } from "node:fs";
|
|
788
1019
|
import { cp, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
@@ -1208,13 +1439,18 @@ async function main() {
|
|
|
1208
1439
|
const answer = await he({
|
|
1209
1440
|
message: "Domain name (slug)",
|
|
1210
1441
|
placeholder: "crm",
|
|
1211
|
-
validate: (v2) =>
|
|
1442
|
+
validate: (v2) => isValidProjectSlug(v2) ? void 0 : PROJECT_SLUG_RULE
|
|
1212
1443
|
});
|
|
1213
1444
|
if (pD(answer)) return bail();
|
|
1214
1445
|
slug = answer;
|
|
1215
1446
|
}
|
|
1216
|
-
if (!
|
|
1217
|
-
xe(`Invalid slug "${slug}".
|
|
1447
|
+
if (!isValidProjectSlug(slug)) {
|
|
1448
|
+
xe(`Invalid slug "${slug}". ${PROJECT_SLUG_RULE}`);
|
|
1449
|
+
return 1;
|
|
1450
|
+
}
|
|
1451
|
+
const origin = flags.origin ?? deriveOrigin(slug);
|
|
1452
|
+
if (!isValidOrigin(origin)) {
|
|
1453
|
+
xe(`Invalid --origin "${origin}". ${ORIGIN_RULE}`);
|
|
1218
1454
|
return 1;
|
|
1219
1455
|
}
|
|
1220
1456
|
let adapter = flags.adapter;
|
|
@@ -1256,8 +1492,8 @@ async function main() {
|
|
|
1256
1492
|
return 1;
|
|
1257
1493
|
}
|
|
1258
1494
|
const instance = flags.instance;
|
|
1259
|
-
if (instance !== void 0 && !
|
|
1260
|
-
xe(`Invalid --instance "${instance}".
|
|
1495
|
+
if (instance !== void 0 && !isValidInstanceSlug(instance)) {
|
|
1496
|
+
xe(`Invalid --instance "${instance}". ${INSTANCE_SLUG_RULE}`);
|
|
1261
1497
|
return 1;
|
|
1262
1498
|
}
|
|
1263
1499
|
let pm = flags.pm;
|
|
@@ -1288,13 +1524,6 @@ async function main() {
|
|
|
1288
1524
|
if (pD(go) || !go) return bail();
|
|
1289
1525
|
}
|
|
1290
1526
|
const link = flags.link ?? workspaceAvailable();
|
|
1291
|
-
if (flags.origin !== void 0 && !isValidOrigin(flags.origin)) {
|
|
1292
|
-
xe(
|
|
1293
|
-
`Invalid --origin "${flags.origin}". Use a lowercase dotted domain with valid DNS labels.`
|
|
1294
|
-
);
|
|
1295
|
-
return 1;
|
|
1296
|
-
}
|
|
1297
|
-
const origin = flags.origin ?? (slug.includes(".") ? slug : `${slug}.example.dev`);
|
|
1298
1527
|
const s = Y2();
|
|
1299
1528
|
s.start(`Creating ./${slug}`);
|
|
1300
1529
|
try {
|
|
@@ -1386,12 +1615,14 @@ Usage:
|
|
|
1386
1615
|
pnpm create astrale-domain <slug> [options]
|
|
1387
1616
|
|
|
1388
1617
|
Arguments:
|
|
1389
|
-
<slug> domain name
|
|
1618
|
+
<slug> domain name \u2014 dot-separated labels of lowercase letters,
|
|
1619
|
+
digits and inner dashes (crm \xB7 1crm \xB7 crm.example.dev)
|
|
1390
1620
|
|
|
1391
1621
|
Options:
|
|
1392
1622
|
--adapter <id> deployment adapter \u2014 astrale (managed, default) | cloudflare
|
|
1393
1623
|
--frontend <id> react (default) | custom | none
|
|
1394
1624
|
--instance <slug> target instance for managed development and deploys
|
|
1625
|
+
(one label, no dots)
|
|
1395
1626
|
--pm <pm> pnpm | npm | yarn | bun (default: detected, else pnpm)
|
|
1396
1627
|
--dir <path> target directory (default: ./<slug>)
|
|
1397
1628
|
--origin <fqdn> domain identity origin (default: <slug>.example.dev)
|
|
@@ -1406,15 +1637,6 @@ Non-interactive (also auto-enabled without a TTY, e.g. CI):
|
|
|
1406
1637
|
`
|
|
1407
1638
|
);
|
|
1408
1639
|
}
|
|
1409
|
-
function isValidSlug(v2) {
|
|
1410
|
-
return /^[a-z][a-z0-9.-]*$/.test(v2);
|
|
1411
|
-
}
|
|
1412
|
-
function isValidOrigin(value) {
|
|
1413
|
-
if (value.length > 253 || !value.includes(".")) return false;
|
|
1414
|
-
return value.split(".").every(
|
|
1415
|
-
(label) => label.length > 0 && label.length <= 63 && /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/u.test(label)
|
|
1416
|
-
);
|
|
1417
|
-
}
|
|
1418
1640
|
function bail() {
|
|
1419
1641
|
xe("Cancelled.");
|
|
1420
1642
|
return 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-astrale-domain",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.95",
|
|
4
4
|
"description": "Scaffold a standalone Astrale domain — npm create astrale-domain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -30,13 +30,14 @@
|
|
|
30
30
|
"registry": "https://registry.npmjs.org/"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@astrale-os/adapter-astrale": "0.5.0-beta.
|
|
34
|
-
"@astrale-os/adapter-cloudflare": "0.5.0-beta.
|
|
33
|
+
"@astrale-os/adapter-astrale": "0.5.0-beta.95",
|
|
34
|
+
"@astrale-os/adapter-cloudflare": "0.5.0-beta.102",
|
|
35
35
|
"@clack/prompts": "^0.11.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
+
"@astrale-os/kernel-dsl": "0.2.0-beta.23",
|
|
38
39
|
"@astrale-os/ox": "0.1.3",
|
|
39
|
-
"@astrale-os/sdk": "0.5.0-beta.
|
|
40
|
+
"@astrale-os/sdk": "0.5.0-beta.99",
|
|
40
41
|
"@types/node": "^22.0.0",
|
|
41
42
|
"esbuild": "^0.28.2",
|
|
42
43
|
"oxfmt": "0.63.0",
|
|
@@ -8,7 +8,7 @@ context, or View-stage integration.
|
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
10
|
schema/ public Domain contract, including View declarations
|
|
11
|
-
runtime.ts
|
|
11
|
+
runtime.ts Functions, Integrations, Providers, and initialization
|
|
12
12
|
application.ts Schema, Runtime, and frontend composition
|
|
13
13
|
frontend/ Vite, file-based TanStack Router, and Tailwind entrypoint
|
|
14
14
|
ui/ styles and pure presentation components
|
|
@@ -19,7 +19,7 @@ Run `pnpm dev` for one Worker-facing URL with Vite HMR. With the managed Astrale
|
|
|
19
19
|
command also creates a temporary public ingress, installs each ready revision on the selected (or
|
|
20
20
|
active) instance, and opens its View. Run `pnpm build` to qualify Worker and frontend output, and
|
|
21
21
|
`pnpm run deploy prod` to deploy through the selected adapter. Add semantic `rules/`, `queries/`,
|
|
22
|
-
`mutations/`, and `
|
|
22
|
+
`mutations/`, and `functions/` modules only when the Domain gains those responsibilities.
|
|
23
23
|
|
|
24
24
|
Domain projects intentionally own no `.spec` trees. Import authoring contracts through semantic
|
|
25
25
|
`@astrale-os/sdk/*` subpaths; never import Kernel Core or DSL directly. Routing remains a normal
|
package/template/package.json
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"main": "./schema/index.ts",
|
|
9
9
|
"types": "./schema/index.ts",
|
|
10
10
|
"imports": {
|
|
11
|
-
"#
|
|
12
|
-
"#
|
|
11
|
+
"#functions": "./functions/index.ts",
|
|
12
|
+
"#functions/*": "./functions/*/index.ts",
|
|
13
13
|
"#integrations": "./integrations/index.ts",
|
|
14
14
|
"#integrations/*": "./integrations/*/index.ts",
|
|
15
15
|
"#migrations": "./migrations/index.ts",
|
|
@@ -35,9 +35,7 @@
|
|
|
35
35
|
"#utils": "./utils/index.ts",
|
|
36
36
|
"#utils/*": "./utils/*/index.ts",
|
|
37
37
|
"#views": "./views/index.ts",
|
|
38
|
-
"#views/*": "./views/*/index.ts"
|
|
39
|
-
"#workflows": "./workflows/index.ts",
|
|
40
|
-
"#workflows/*": "./workflows/*/index.ts"
|
|
38
|
+
"#views/*": "./views/*/index.ts"
|
|
41
39
|
},
|
|
42
40
|
"exports": {
|
|
43
41
|
".": {
|
package/template/runtime.ts
CHANGED
|
@@ -4,7 +4,6 @@ describe('application composition', () => {
|
|
|
4
4
|
it('keeps authored Application and Runtime composition exact', () => {
|
|
5
5
|
expect(application.schema).toBe(schema)
|
|
6
6
|
expect(application.runtime).toBe(runtime)
|
|
7
|
-
expect(runtime.
|
|
8
|
-
expect(runtime.workflows).toEqual([])
|
|
7
|
+
expect(runtime.functions).toEqual([])
|
|
9
8
|
})
|
|
10
9
|
})
|
package/template/tsconfig.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"jsx": "react-jsx",
|
|
8
8
|
"types": ["node", "vitest/globals"],
|
|
9
9
|
"paths": {
|
|
10
|
-
"#
|
|
11
|
-
"#
|
|
10
|
+
"#functions": ["./functions/index.ts"],
|
|
11
|
+
"#functions/*": ["./functions/*/index.ts"],
|
|
12
12
|
"#integrations": ["./integrations/index.ts"],
|
|
13
13
|
"#integrations/*": ["./integrations/*/index.ts"],
|
|
14
14
|
"#migrations": ["./migrations/index.ts"],
|
|
@@ -34,9 +34,7 @@
|
|
|
34
34
|
"#utils": ["./utils/index.ts"],
|
|
35
35
|
"#utils/*": ["./utils/*/index.ts"],
|
|
36
36
|
"#views": ["./views/index.ts"],
|
|
37
|
-
"#views/*": ["./views/*/index.ts"]
|
|
38
|
-
"#workflows": ["./workflows/index.ts"],
|
|
39
|
-
"#workflows/*": ["./workflows/*/index.ts"]
|
|
37
|
+
"#views/*": ["./views/*/index.ts"]
|
|
40
38
|
},
|
|
41
39
|
"strict": true,
|
|
42
40
|
"noEmit": true,
|
|
@@ -52,9 +50,8 @@
|
|
|
52
50
|
"queries",
|
|
53
51
|
"routes",
|
|
54
52
|
"mutations",
|
|
55
|
-
"
|
|
53
|
+
"functions",
|
|
56
54
|
"migrations",
|
|
57
|
-
"actions",
|
|
58
55
|
"integrations",
|
|
59
56
|
"providers",
|
|
60
57
|
"frontend",
|