create-astrale-domain 0.3.0-beta.158 → 0.3.0-beta.159
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/package.json +4 -4
- package/template/.variants/custom/README.md +3 -3
- package/template/.variants/custom/__tests__/variant.test.ts +4 -4
- package/template/.variants/custom/{application.ts → domain.ts} +2 -2
- package/template/.variants/none/README.md +2 -2
- package/template/.variants/none/__tests__/variant.test.ts +3 -3
- package/template/.variants/none/{application.ts → domain.ts} +2 -2
- package/template/.variants/react/README.md +3 -3
- package/template/.variants/react/__tests__/variant.test.ts +4 -4
- package/template/.variants/react/{application.ts → domain.ts} +2 -2
- package/template/CLAUDE.md +2 -2
- package/template/index.ts +1 -1
- package/template/tests/e2e/domain.test.ts +9 -0
- package/template/tsconfig.json +1 -1
- package/template/tests/e2e/application.test.ts +0 -9
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.159",
|
|
4
4
|
"description": "Scaffold a standalone Astrale domain — npm create astrale-domain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -30,14 +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.159",
|
|
34
|
+
"@astrale-os/adapter-cloudflare": "0.5.0-beta.166",
|
|
35
35
|
"@clack/prompts": "^0.11.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@astrale-os/kernel-dsl": "0.2.0-beta.44",
|
|
39
39
|
"@astrale-os/ox": "0.1.4",
|
|
40
|
-
"@astrale-os/sdk": "0.6.0-beta.
|
|
40
|
+
"@astrale-os/sdk": "0.6.0-beta.11",
|
|
41
41
|
"@types/node": "^22.0.0",
|
|
42
42
|
"esbuild": "^0.28.2",
|
|
43
43
|
"oxfmt": "0.63.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Astrale Domain
|
|
2
2
|
|
|
3
|
-
This project uses the framework-neutral frontend escape hatch. `
|
|
3
|
+
This project uses the framework-neutral frontend escape hatch. `domain.ts` binds declared
|
|
4
4
|
Schema Views to `defineFrontend`; `vite.config.ts` owns the ordinary `frontend/` Vite root you can
|
|
5
5
|
replace with any framework; `ui/` owns presentation assets. The starter route uses
|
|
6
6
|
`handshake: 'none'`, so it mounts as a plain hosted app. Change that route to `handshake: 'shell'`
|
|
@@ -9,7 +9,7 @@ only after your browser entrypoint boots the Shell protocol.
|
|
|
9
9
|
```text
|
|
10
10
|
schema/ public Domain contract, including View declarations
|
|
11
11
|
runtime.ts Actions, Workflows, Integrations, Providers, and initialization
|
|
12
|
-
|
|
12
|
+
domain.ts Schema, Runtime, and frontend composition
|
|
13
13
|
views/application/ application View projection and mount behavior
|
|
14
14
|
frontend/ browser entrypoint and assets
|
|
15
15
|
ui/application/ application presentation, tokens, and styles
|
|
@@ -19,7 +19,7 @@ tests/ cross-layer executable journeys
|
|
|
19
19
|
Run `pnpm dev` to watch, remotely deploy, and verify the committed `development` Environment. It
|
|
20
20
|
starts no local Worker, browser server, or tunnel; when installation is configured it reconciles the
|
|
21
21
|
ready Release onto that Environment's exact Astrale instance. Run `pnpm build` to build both Worker
|
|
22
|
-
and browser assets.
|
|
22
|
+
and browser assets and print their build digest.
|
|
23
23
|
Domain projects intentionally own no `.spec` trees and import authoring contracts only through
|
|
24
24
|
semantic `@astrale-os/sdk/*` subpaths.
|
|
25
25
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { domain } from '../domain.js'
|
|
2
2
|
|
|
3
3
|
describe('custom frontend variant', () => {
|
|
4
4
|
/** @evidence SDK-V1-SCAFFOLD-CUSTOM */
|
|
5
5
|
it('rejects missing authored frontend composition', () => {
|
|
6
|
-
expect(
|
|
7
|
-
expect(
|
|
8
|
-
expect(
|
|
6
|
+
expect(domain.frontend).toBeDefined()
|
|
7
|
+
expect(domain.frontend?.source.kind).toBe('vite')
|
|
8
|
+
expect(domain.frontend?.routes.application).toMatchObject({
|
|
9
9
|
path: '/application',
|
|
10
10
|
handshake: 'none',
|
|
11
11
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineDomain, defineFrontend, requirements, vite } from '@astrale-os/sdk/domain'
|
|
2
2
|
import { K } from '@astrale-os/sdk/schema'
|
|
3
3
|
|
|
4
4
|
import { schema } from '#schema'
|
|
@@ -15,7 +15,7 @@ const frontend = defineFrontend({
|
|
|
15
15
|
})
|
|
16
16
|
|
|
17
17
|
/** Build and publication composition; provider effects live in astrale.config.ts. */
|
|
18
|
-
export const
|
|
18
|
+
export const domain = defineDomain({
|
|
19
19
|
schema,
|
|
20
20
|
runtime,
|
|
21
21
|
frontend,
|
|
@@ -5,13 +5,13 @@ This is a callable-only Domain with no frontend artifact or browser assets.
|
|
|
5
5
|
```text
|
|
6
6
|
schema/ public Domain contract
|
|
7
7
|
runtime.ts Actions, Workflows, Integrations, Providers, and initialization
|
|
8
|
-
|
|
8
|
+
domain.ts Schema and Runtime composition
|
|
9
9
|
tests/ cross-layer executable journeys
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Run `pnpm dev` to watch, remotely deploy, and verify the committed `development` Environment. It
|
|
13
13
|
starts no local Worker or tunnel; when installation is configured it reconciles the ready Release
|
|
14
|
-
onto that Environment's exact Astrale instance. Run `pnpm build` to qualify its deploy bundle. Add `views/` and
|
|
14
|
+
onto that Environment's exact Astrale instance. Run `pnpm build` to qualify its deploy bundle and print its build digest. Add `views/` and
|
|
15
15
|
`ui/` later only when the schema gains declared Views. Domain projects intentionally own no `.spec`
|
|
16
16
|
trees and import authoring contracts only through semantic `@astrale-os/sdk/*` subpaths.
|
|
17
17
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { domain } from '../domain.js'
|
|
2
2
|
|
|
3
3
|
describe('none frontend variant', () => {
|
|
4
4
|
/** @evidence SDK-V1-SCAFFOLD-NONE */
|
|
5
|
-
it('rejects an implicit browser frontend by keeping
|
|
6
|
-
expect(
|
|
5
|
+
it('rejects an implicit browser frontend by keeping the Domain headless', () => {
|
|
6
|
+
expect(domain.frontend).toBeUndefined()
|
|
7
7
|
})
|
|
8
8
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineDomain, requirements } from '@astrale-os/sdk/domain'
|
|
2
2
|
import { K } from '@astrale-os/sdk/schema'
|
|
3
3
|
|
|
4
4
|
import { schema } from '#schema'
|
|
@@ -6,7 +6,7 @@ import { schema } from '#schema'
|
|
|
6
6
|
import runtime from './runtime.js'
|
|
7
7
|
|
|
8
8
|
/** Build and publication composition; provider effects live in astrale.config.ts. */
|
|
9
|
-
export const
|
|
9
|
+
export const domain = defineDomain({
|
|
10
10
|
schema,
|
|
11
11
|
runtime,
|
|
12
12
|
requirements: requirements({ functions: [K.functions.query, K.functions.mutate] }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Astrale Domain
|
|
2
2
|
|
|
3
|
-
This project is an ordinary Vite React application. `
|
|
3
|
+
This project is an ordinary Vite React application. `domain.ts` owns the small Worker-safe,
|
|
4
4
|
Schema-bound frontend deployment contract; `frontend/` owns TanStack Router and browser
|
|
5
5
|
composition; `ui/` owns reusable presentation. It has no mandatory Shell runtime: add
|
|
6
6
|
`@astrale-os/shell-react` independently when the application genuinely needs Shell sessions, graph
|
|
@@ -9,7 +9,7 @@ context, or View-stage integration.
|
|
|
9
9
|
```text
|
|
10
10
|
schema/ public Domain contract, including View declarations
|
|
11
11
|
runtime.ts Functions, Integrations, Providers, and initialization
|
|
12
|
-
|
|
12
|
+
domain.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
|
|
15
15
|
tests/ cross-layer executable journeys
|
|
@@ -18,7 +18,7 @@ tests/ cross-layer executable journeys
|
|
|
18
18
|
Run `pnpm dev` to watch, remotely deploy, and verify the committed `development` Environment. It
|
|
19
19
|
starts no local Worker, Vite server, or tunnel; when installation is configured it reconciles the
|
|
20
20
|
ready Release onto that Environment's exact Astrale instance. Run `pnpm build` to qualify Worker and
|
|
21
|
-
frontend output, and `pnpm run deploy production` to deploy through the selected adapter. Add semantic `rules/`, `queries/`,
|
|
21
|
+
frontend output and print their build digest, and `pnpm run deploy production` to deploy through the selected adapter. Add semantic `rules/`, `queries/`,
|
|
22
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
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { domain } from '../domain.js'
|
|
2
2
|
|
|
3
3
|
describe('react frontend variant', () => {
|
|
4
4
|
/** @evidence SDK-V1-SCAFFOLD-REACT */
|
|
5
5
|
it('rejects missing authored frontend composition', () => {
|
|
6
|
-
expect(
|
|
7
|
-
expect(
|
|
8
|
-
expect(
|
|
6
|
+
expect(domain.frontend).toBeDefined()
|
|
7
|
+
expect(domain.frontend?.source.kind).toBe('vite')
|
|
8
|
+
expect(domain.frontend?.routes.application).toMatchObject({
|
|
9
9
|
path: '/application',
|
|
10
10
|
handshake: 'none',
|
|
11
11
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineDomain, defineFrontend, requirements, vite } from '@astrale-os/sdk/domain'
|
|
2
2
|
import { K } from '@astrale-os/sdk/schema'
|
|
3
3
|
|
|
4
4
|
import { schema } from '#schema'
|
|
@@ -15,7 +15,7 @@ const frontend = defineFrontend({
|
|
|
15
15
|
})
|
|
16
16
|
|
|
17
17
|
/** Build and publication composition; provider effects live in astrale.config.ts. */
|
|
18
|
-
export const
|
|
18
|
+
export const domain = defineDomain({
|
|
19
19
|
schema,
|
|
20
20
|
runtime,
|
|
21
21
|
frontend,
|
package/template/CLAUDE.md
CHANGED
|
@@ -11,10 +11,10 @@ npx skills add astrale-os/cli -g
|
|
|
11
11
|
This scaffold is intentionally minimal. React and custom projects include one schema-declared
|
|
12
12
|
application View to prove frontend delivery; `--frontend none` is callable-only. Start each real
|
|
13
13
|
behavior in its semantic submodule, keep owners explicit, put focused tests in `__tests__`, use
|
|
14
|
-
registered package `#` imports across owners, and keep `runtime.ts` and `
|
|
14
|
+
registered package `#` imports across owners, and keep `runtime.ts` and `domain.ts` limited to
|
|
15
15
|
their exact composition responsibilities.
|
|
16
16
|
Actions perform one semantic asynchronous operation; Workflows name every explicit multi-step operation.
|
|
17
|
-
The scaffold's Kernel dependency and `query`/`mutate`
|
|
17
|
+
The scaffold's Kernel dependency and `query`/`mutate` Domain requirements authorize bound graph
|
|
18
18
|
executors. Retain them while handlers access graph state; use `graph.self` for Domain-owned facts.
|
|
19
19
|
|
|
20
20
|
Add `schema/modules/<module>/states/` only when a Schema business module owns a finite persisted
|
package/template/index.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { domain, runtime, schema } from '../../index.js'
|
|
2
|
+
|
|
3
|
+
describe('domain composition', () => {
|
|
4
|
+
it('keeps authored Domain and Runtime composition exact', () => {
|
|
5
|
+
expect(domain.schema).toBe(schema)
|
|
6
|
+
expect(domain.runtime).toBe(runtime)
|
|
7
|
+
expect(runtime.functions).toEqual([])
|
|
8
|
+
})
|
|
9
|
+
})
|
package/template/tsconfig.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { application, runtime, schema } from '../../index.js'
|
|
2
|
-
|
|
3
|
-
describe('application composition', () => {
|
|
4
|
-
it('keeps authored Application and Runtime composition exact', () => {
|
|
5
|
-
expect(application.schema).toBe(schema)
|
|
6
|
-
expect(application.runtime).toBe(runtime)
|
|
7
|
-
expect(runtime.functions).toEqual([])
|
|
8
|
-
})
|
|
9
|
-
})
|