@foro-sh/foro 0.2.0 → 0.9.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.
@@ -78,6 +78,27 @@ export declare const rawManifestCases: readonly [{
78
78
  readonly ok: false;
79
79
  readonly reason: "invalid_build_path";
80
80
  };
81
+ }, {
82
+ readonly name: "bad-build-path-shell-metachar";
83
+ readonly yaml: "name: my-server\nentrypoint: server.py\nbuild_path: \". && whoami\"\n";
84
+ readonly expect: {
85
+ readonly ok: false;
86
+ readonly reason: "invalid_build_path";
87
+ };
88
+ }, {
89
+ readonly name: "bad-build-path-space";
90
+ readonly yaml: "name: my-server\nentrypoint: server.py\nbuild_path: \"my services\"\n";
91
+ readonly expect: {
92
+ readonly ok: false;
93
+ readonly reason: "invalid_build_path";
94
+ };
95
+ }, {
96
+ readonly name: "bad-build-path-newline";
97
+ readonly yaml: "name: my-server\nentrypoint: server.py\nbuild_path: \"app\\nUSER root\"\n";
98
+ readonly expect: {
99
+ readonly ok: false;
100
+ readonly reason: "invalid_build_path";
101
+ };
81
102
  }, {
82
103
  readonly name: "bad-python-version";
83
104
  readonly yaml: "name: my-server\nentrypoint: server.py\npython_version: \"3.9\"\n";
@@ -1 +1 @@
1
- {"version":3,"file":"_generated-manifest-cases.d.ts","sourceRoot":"","sources":["../src/_generated-manifest-cases.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqKnB,CAAA"}
1
+ {"version":3,"file":"_generated-manifest-cases.d.ts","sourceRoot":"","sources":["../src/_generated-manifest-cases.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6LnB,CAAA"}
@@ -93,6 +93,30 @@ export const rawManifestCases = [
93
93
  "reason": "invalid_build_path"
94
94
  }
95
95
  },
96
+ {
97
+ "name": "bad-build-path-shell-metachar",
98
+ "yaml": "name: my-server\nentrypoint: server.py\nbuild_path: \". && whoami\"\n",
99
+ "expect": {
100
+ "ok": false,
101
+ "reason": "invalid_build_path"
102
+ }
103
+ },
104
+ {
105
+ "name": "bad-build-path-space",
106
+ "yaml": "name: my-server\nentrypoint: server.py\nbuild_path: \"my services\"\n",
107
+ "expect": {
108
+ "ok": false,
109
+ "reason": "invalid_build_path"
110
+ }
111
+ },
112
+ {
113
+ "name": "bad-build-path-newline",
114
+ "yaml": "name: my-server\nentrypoint: server.py\nbuild_path: \"app\\nUSER root\"\n",
115
+ "expect": {
116
+ "ok": false,
117
+ "reason": "invalid_build_path"
118
+ }
119
+ },
96
120
  {
97
121
  "name": "bad-python-version",
98
122
  "yaml": "name: my-server\nentrypoint: server.py\npython_version: \"3.9\"\n",
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=manifest-cases.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-cases.test.d.ts","sourceRoot":"","sources":["../src/manifest-cases.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import assert from 'node:assert/strict';
2
+ import { test } from 'node:test';
3
+ import { manifestCases } from './manifest-cases.js';
4
+ // Sanity checks on the shared table itself - the generator
5
+ // (scripts/generate-manifest-cases.mjs) already enforces these invariants at
6
+ // build time, but that only runs when someone builds this package locally.
7
+ // A real `.test.ts` here means CI catches a malformed table on every push,
8
+ // not just when a maintainer happens to run `npm run build`.
9
+ test('manifestCases is non-empty', () => {
10
+ assert.ok(manifestCases.length > 0);
11
+ });
12
+ test('every case name is unique', () => {
13
+ const names = manifestCases.map((c) => c.name);
14
+ assert.equal(new Set(names).size, names.length);
15
+ });
16
+ test('every case has non-empty yaml and a well-formed expect', () => {
17
+ for (const testCase of manifestCases) {
18
+ assert.ok(testCase.yaml.length > 0, `${testCase.name}: empty yaml`);
19
+ if (testCase.expect.ok)
20
+ continue;
21
+ assert.ok(typeof testCase.expect.reason === 'string' && testCase.expect.reason.length > 0, `${testCase.name}: missing rejection reason`);
22
+ }
23
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foro-sh/foro",
3
- "version": "0.2.0",
3
+ "version": "0.9.2",
4
4
  "description": "TypeScript SDK for Foro",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -47,6 +47,7 @@
47
47
  "node": ">=18"
48
48
  },
49
49
  "devDependencies": {
50
+ "@types/node": "^20.11.0",
50
51
  "typescript": "^5.6.3"
51
52
  }
52
53
  }