@toa.io/userland 1.0.0-alpha.34 → 1.0.0-alpha.340
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 +430 -0
- package/example/components/echo/manifest.toa.yaml +15 -5
- package/example/components/echo/operations/get.js +1 -5
- package/example/components/echo/operations/resolve.js +1 -5
- package/example/components/echo/operations/signal.js +3 -7
- package/example/components/math.calculations/manifest.toa.yaml +19 -6
- package/example/components/math.calculations/operations/add.js +1 -5
- package/example/components/math.calculations/operations/increment.js +1 -5
- package/example/components/math.proxy/manifest.toa.yaml +8 -3
- package/example/components/math.proxy/operations/add.js +1 -5
- package/example/components/tea.pots/manifest.toa.yaml +29 -9
- package/example/components/tea.pots/operations/same.js +1 -5
- package/example/components/tea.pots/receivers/store.orders.created.js +1 -5
- package/example/components/web/manifest.toa.yaml +2 -4
- package/example/components/web/operations/get.js +3 -8
- package/example/context.toa.yaml +2 -7
- package/example/stage/call.test.js +17 -10
- package/example/stage/events.test.js +63 -16
- package/example/stage/invoke.test.js +12 -9
- package/package.json +19 -13
- package/readme.md +58 -1
- package/stage/package.json +1 -0
- package/stage/src/component.js +3 -7
- package/stage/src/composition.js +3 -7
- package/stage/src/index.js +9 -16
- package/stage/src/manifest.js +2 -6
- package/stage/src/map.js +15 -0
- package/stage/src/quiescence.js +16 -0
- package/stage/src/remote.js +11 -8
- package/stage/src/service.js +11 -10
- package/stage/src/shutdown.js +16 -6
- package/stage/src/state.js +2 -4
- package/stage/src/workload.js +53 -0
- package/stage/test/boot.mock.js +10 -11
- package/stage/test/component.test.js +20 -10
- package/stage/test/composition.test.js +11 -9
- package/stage/test/manifest.test.js +15 -8
- package/stage/test/remote.test.js +14 -12
- package/stage/test/shutdown.test.js +28 -15
- package/stage/test/state.mock.js +5 -6
- package/stage/test/state.test.js +13 -12
- package/stage/types/index.d.ts +21 -8
- package/stage/types/state.d.ts +3 -4
- package/template/_gitignore +3 -0
- package/template/components/hello/manifest.toa.yaml +22 -0
- package/template/components/hello/operations/greet.ts +5 -0
- package/template/components/notes/manifest.toa.yaml +25 -0
- package/template/context.toa.yaml +29 -0
- package/template/cucumber.js +4 -0
- package/template/docker-compose.yaml +62 -0
- package/template/ecosystem.config.js +29 -0
- package/template/features/hello.feature +14 -0
- package/template/features/notes.feature +29 -0
- package/template/features/steps/application.ts +22 -0
- package/template/features/steps/http.ts +19 -0
- package/template/package.json +28 -0
- package/template/tsconfig.json +15 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Before, When, Then } from '@cucumber/cucumber'
|
|
2
|
+
import { Agent } from '@toa.io/agent'
|
|
3
|
+
|
|
4
|
+
// what the steps of one scenario share
|
|
5
|
+
export interface World {
|
|
6
|
+
agent: Agent
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
Before(function (this: World) {
|
|
10
|
+
this.agent = new Agent('http://localhost:8000')
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
When('the request is sent:', async function (this: World, text: string) {
|
|
14
|
+
await this.agent.request(text)
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
Then('the response is received:', function (this: World, text: string) {
|
|
18
|
+
this.agent.responseIncludes(text)
|
|
19
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"postinstall": "toa npm",
|
|
7
|
+
"dock": "docker compose up -d --wait",
|
|
8
|
+
"env": "toa types --quiet && toa env --dev && toa map",
|
|
9
|
+
"start": "pm2 start ecosystem.config.js",
|
|
10
|
+
"restart": "npm run env && pm2 restart ecosystem.config.js",
|
|
11
|
+
"stop": "pm2 delete ecosystem.config.js",
|
|
12
|
+
"sys": "pm2 start ecosystem.config.js --only sys",
|
|
13
|
+
"features": "cucumber-js",
|
|
14
|
+
"typecheck": "tsc"
|
|
15
|
+
},
|
|
16
|
+
"workspaces": [
|
|
17
|
+
"components/*"
|
|
18
|
+
],
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@cucumber/cucumber": "13.2.1",
|
|
21
|
+
"@toa.io/agent": "{{agent}}",
|
|
22
|
+
"@toa.io/operations": "{{version}}",
|
|
23
|
+
"@toa.io/runtime": "{{version}}",
|
|
24
|
+
"@toa.io/userland": "{{version}}",
|
|
25
|
+
"@types/node": "26.6.4",
|
|
26
|
+
"typescript": "7.0.2"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "nodenext",
|
|
4
|
+
"moduleResolution": "nodenext",
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"types": ["node"],
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"allowImportingTsExtensions": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"erasableSyntaxOnly": true
|
|
13
|
+
},
|
|
14
|
+
"include": ["components", "features"]
|
|
15
|
+
}
|