sanoma 0.4.0 → 0.4.2
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/oxlint-plugin.js +2 -1
- package/dist/oxlint-plugin.js.map +1 -1
- package/oxlint.json +4 -4
- package/package.json +5 -5
- package/template/AGENTS.md +1 -1
- package/template/package.json +2 -2
package/dist/oxlint-plugin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// The oxlint JS plugin `sanoma`, loaded by this package's `oxlint.json` from `dist/`, inside this
|
|
2
2
|
// package (a path into another package's directory would depend on how an installer lays out
|
|
3
|
-
// `node_modules`): `@sanoma-ai/workflows/plugin`'s
|
|
3
|
+
// `node_modules`): `@sanoma-ai/workflows/plugin`'s rules `data-file` and `date`, and `site-file`
|
|
4
|
+
// (`site-lint.ts`).
|
|
4
5
|
import workflows from "@sanoma-ai/workflows/plugin";
|
|
5
6
|
import { siteFile } from "./site-lint.js";
|
|
6
7
|
const plugin = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint-plugin.js","sourceRoot":"","sources":["../src/oxlint-plugin.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,6FAA6F;AAC7F,
|
|
1
|
+
{"version":3,"file":"oxlint-plugin.js","sourceRoot":"","sources":["../src/oxlint-plugin.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,6FAA6F;AAC7F,iGAAiG;AACjG,oBAAoB;AACpB,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,MAAM,GAA+D;IACzE,GAAG,SAAS;IACZ,KAAK,EAAE,EAAE,GAAG,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE;CACrD,CAAC;AACF,eAAe,MAAM,CAAC"}
|
package/oxlint.json
CHANGED
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"workflows/**"
|
|
30
30
|
],
|
|
31
|
+
"jsPlugins": [
|
|
32
|
+
"./dist/oxlint-plugin.js"
|
|
33
|
+
],
|
|
31
34
|
"rules": {
|
|
35
|
+
"sanoma/date": "error",
|
|
32
36
|
"no-restricted-globals": [
|
|
33
37
|
"error",
|
|
34
|
-
{
|
|
35
|
-
"name": "Date",
|
|
36
|
-
"message": "Workflows are replayed: use `await ctx.now()` for the time and `ctx.sleep({ until })` to wait for a date."
|
|
37
|
-
},
|
|
38
38
|
{
|
|
39
39
|
"name": "fetch",
|
|
40
40
|
"message": "A workflow must call vendors through ctx, so the policy sees every call: use a connector operation listed in `uses`."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanoma",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "One command over a Sanoma repo: run the worker and the app, check it, write its .env.example, export a run's ledger",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"approvals",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@sanoma-ai/app": "0.4.
|
|
61
|
-
"@sanoma-ai/bridge": "0.4.
|
|
62
|
-
"@sanoma-ai/workflows": "0.4.
|
|
60
|
+
"@sanoma-ai/app": "0.4.2",
|
|
61
|
+
"@sanoma-ai/bridge": "0.4.2",
|
|
62
|
+
"@sanoma-ai/workflows": "0.4.2",
|
|
63
63
|
"@types/node": "^26.6.4",
|
|
64
64
|
"oxlint": "^1.87.0",
|
|
65
65
|
"pg": "^8.23.1",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"zod": "^4.6.5"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@sanoma-ai/connector-ghost": "0.4.
|
|
70
|
+
"@sanoma-ai/connector-ghost": "0.4.2",
|
|
71
71
|
"@sanoma-ai/testing": "0.1.0",
|
|
72
72
|
"@types/pg": "^8.23.1"
|
|
73
73
|
},
|
package/template/AGENTS.md
CHANGED
|
@@ -30,7 +30,7 @@ npm run env # rewrites .env.example from the connectors' variables
|
|
|
30
30
|
|
|
31
31
|
## Rules
|
|
32
32
|
|
|
33
|
-
- A workflow imports only from `sanoma`, its connectors and relative files, and does the same thing every time it is replayed: `ctx.now()` and `ctx.sleep()`, never `Date` or timers; configuration comes in as input, never from `process.env`. The `check` script holds workflows and data files to this.
|
|
33
|
+
- A workflow imports only from `sanoma`, its connectors and relative files, and does the same thing every time it is replayed: `ctx.now()` and `ctx.sleep()`, never `Date.now()` or `new Date()` (`new Date(await ctx.now())` for a date, read in UTC) or timers; configuration comes in as input, never from `process.env`. The `check` script holds workflows and data files to this.
|
|
34
34
|
- Define each workflow's `name` as a string literal: the app finds the workflow in its file by it.
|
|
35
35
|
- Every operation a workflow calls is listed in its `uses`; add the connector to `sanoma.config.ts` and to `package.json`.
|
|
36
36
|
- Declare the company's own records as collections in `resources/data.ts`, which imports only `collection` from `sanoma/data` and holds nothing else: the runtime imports it, and so does a workflow that names a collection's operations (`import { outbound } from "../resources/data.ts"`, the one file outside `workflows/` a workflow may import). Every other data file is read, never run.
|
package/template/package.json
CHANGED