@foro-sh/foro 0.9.2 → 0.10.0
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/_generated-manifest-cases.d.ts +61 -6
- package/dist/_generated-manifest-cases.d.ts.map +1 -1
- package/dist/_generated-manifest-cases.js +69 -6
- package/dist/manifest-cases.d.ts +1 -1
- package/dist/manifest-cases.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/manifest-cases.test.d.ts +0 -2
- package/dist/manifest-cases.test.d.ts.map +0 -1
- package/dist/manifest-cases.test.js +0 -23
|
@@ -12,13 +12,13 @@ export declare const rawManifestCases: readonly [{
|
|
|
12
12
|
};
|
|
13
13
|
}, {
|
|
14
14
|
readonly name: "all-fields";
|
|
15
|
-
readonly yaml: "name: my-server\nentrypoint: server.py\nbuild_path: app\
|
|
15
|
+
readonly yaml: "name: my-server\nentrypoint: server.py\nbuild_path: app\nruntime: python\nruntime_version: \"3.11\"\nport: 9000\ndependency_manager: poetry\n";
|
|
16
16
|
readonly expect: {
|
|
17
17
|
readonly ok: true;
|
|
18
18
|
};
|
|
19
19
|
}, {
|
|
20
|
-
readonly name: "unquoted-
|
|
21
|
-
readonly yaml: "name: my-server\nentrypoint: server.py\
|
|
20
|
+
readonly name: "unquoted-runtime-version";
|
|
21
|
+
readonly yaml: "name: my-server\nentrypoint: server.py\nruntime_version: 3.12\n";
|
|
22
22
|
readonly expect: {
|
|
23
23
|
readonly ok: true;
|
|
24
24
|
};
|
|
@@ -100,11 +100,39 @@ export declare const rawManifestCases: readonly [{
|
|
|
100
100
|
readonly reason: "invalid_build_path";
|
|
101
101
|
};
|
|
102
102
|
}, {
|
|
103
|
-
readonly name: "bad-
|
|
104
|
-
readonly yaml: "name: my-server\nentrypoint: server.py\
|
|
103
|
+
readonly name: "bad-runtime-version";
|
|
104
|
+
readonly yaml: "name: my-server\nentrypoint: server.py\nruntime_version: \"3.9\"\n";
|
|
105
105
|
readonly expect: {
|
|
106
106
|
readonly ok: false;
|
|
107
|
-
readonly reason: "
|
|
107
|
+
readonly reason: "invalid_runtime_version";
|
|
108
|
+
};
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "bad-runtime";
|
|
111
|
+
readonly yaml: "name: my-server\nentrypoint: server.py\nruntime: node\n";
|
|
112
|
+
readonly expect: {
|
|
113
|
+
readonly ok: false;
|
|
114
|
+
readonly reason: "invalid_runtime";
|
|
115
|
+
};
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "runtime-version-from-another-runtime";
|
|
118
|
+
readonly yaml: "name: my-server\nentrypoint: server.py\nruntime: python\nruntime_version: \"22\"\n";
|
|
119
|
+
readonly expect: {
|
|
120
|
+
readonly ok: false;
|
|
121
|
+
readonly reason: "invalid_runtime_version";
|
|
122
|
+
};
|
|
123
|
+
}, {
|
|
124
|
+
readonly name: "unknown-field-stale-python-version";
|
|
125
|
+
readonly yaml: "name: my-server\nentrypoint: server.py\npython_version: \"3.13\"\n";
|
|
126
|
+
readonly expect: {
|
|
127
|
+
readonly ok: false;
|
|
128
|
+
readonly reason: "unknown_field";
|
|
129
|
+
};
|
|
130
|
+
}, {
|
|
131
|
+
readonly name: "unknown-field-typo";
|
|
132
|
+
readonly yaml: "name: my-server\nentrypoint: server.py\nentrypoints: server.py\n";
|
|
133
|
+
readonly expect: {
|
|
134
|
+
readonly ok: false;
|
|
135
|
+
readonly reason: "unknown_field";
|
|
108
136
|
};
|
|
109
137
|
}, {
|
|
110
138
|
readonly name: "bad-port-too-low";
|
|
@@ -162,5 +190,32 @@ export declare const rawManifestCases: readonly [{
|
|
|
162
190
|
readonly ok: false;
|
|
163
191
|
readonly reason: "invalid_shape";
|
|
164
192
|
};
|
|
193
|
+
}, {
|
|
194
|
+
readonly name: "bad-entrypoint-leading-dash";
|
|
195
|
+
readonly yaml: "name: my-server\nentrypoint: --isolated\n";
|
|
196
|
+
readonly expect: {
|
|
197
|
+
readonly ok: false;
|
|
198
|
+
readonly reason: "invalid_entrypoint";
|
|
199
|
+
};
|
|
200
|
+
}, {
|
|
201
|
+
readonly name: "bad-entrypoint-leading-dash-nested";
|
|
202
|
+
readonly yaml: "name: my-server\nentrypoint: src/-rf.py\n";
|
|
203
|
+
readonly expect: {
|
|
204
|
+
readonly ok: false;
|
|
205
|
+
readonly reason: "invalid_entrypoint";
|
|
206
|
+
};
|
|
207
|
+
}, {
|
|
208
|
+
readonly name: "bad-build-path-leading-dash";
|
|
209
|
+
readonly yaml: "name: my-server\nentrypoint: server.py\nbuild_path: -rf\n";
|
|
210
|
+
readonly expect: {
|
|
211
|
+
readonly ok: false;
|
|
212
|
+
readonly reason: "invalid_build_path";
|
|
213
|
+
};
|
|
214
|
+
}, {
|
|
215
|
+
readonly name: "hyphen-inside-a-path-segment-is-fine";
|
|
216
|
+
readonly yaml: "name: my-server\nentrypoint: my-tools/mcp-server.py\n";
|
|
217
|
+
readonly expect: {
|
|
218
|
+
readonly ok: true;
|
|
219
|
+
};
|
|
165
220
|
}];
|
|
166
221
|
//# sourceMappingURL=_generated-manifest-cases.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_generated-manifest-cases.d.ts","sourceRoot":"","sources":["../src/_generated-manifest-cases.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"_generated-manifest-cases.d.ts","sourceRoot":"","sources":["../src/_generated-manifest-cases.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4PnB,CAAA"}
|
|
@@ -17,14 +17,14 @@ export const rawManifestCases = [
|
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"name": "all-fields",
|
|
20
|
-
"yaml": "name: my-server\nentrypoint: server.py\nbuild_path: app\
|
|
20
|
+
"yaml": "name: my-server\nentrypoint: server.py\nbuild_path: app\nruntime: python\nruntime_version: \"3.11\"\nport: 9000\ndependency_manager: poetry\n",
|
|
21
21
|
"expect": {
|
|
22
22
|
"ok": true
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
"name": "unquoted-
|
|
27
|
-
"yaml": "name: my-server\nentrypoint: server.py\
|
|
26
|
+
"name": "unquoted-runtime-version",
|
|
27
|
+
"yaml": "name: my-server\nentrypoint: server.py\nruntime_version: 3.12\n",
|
|
28
28
|
"expect": {
|
|
29
29
|
"ok": true
|
|
30
30
|
}
|
|
@@ -118,11 +118,43 @@ export const rawManifestCases = [
|
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
"name": "bad-
|
|
122
|
-
"yaml": "name: my-server\nentrypoint: server.py\
|
|
121
|
+
"name": "bad-runtime-version",
|
|
122
|
+
"yaml": "name: my-server\nentrypoint: server.py\nruntime_version: \"3.9\"\n",
|
|
123
123
|
"expect": {
|
|
124
124
|
"ok": false,
|
|
125
|
-
"reason": "
|
|
125
|
+
"reason": "invalid_runtime_version"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "bad-runtime",
|
|
130
|
+
"yaml": "name: my-server\nentrypoint: server.py\nruntime: node\n",
|
|
131
|
+
"expect": {
|
|
132
|
+
"ok": false,
|
|
133
|
+
"reason": "invalid_runtime"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "runtime-version-from-another-runtime",
|
|
138
|
+
"yaml": "name: my-server\nentrypoint: server.py\nruntime: python\nruntime_version: \"22\"\n",
|
|
139
|
+
"expect": {
|
|
140
|
+
"ok": false,
|
|
141
|
+
"reason": "invalid_runtime_version"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "unknown-field-stale-python-version",
|
|
146
|
+
"yaml": "name: my-server\nentrypoint: server.py\npython_version: \"3.13\"\n",
|
|
147
|
+
"expect": {
|
|
148
|
+
"ok": false,
|
|
149
|
+
"reason": "unknown_field"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "unknown-field-typo",
|
|
154
|
+
"yaml": "name: my-server\nentrypoint: server.py\nentrypoints: server.py\n",
|
|
155
|
+
"expect": {
|
|
156
|
+
"ok": false,
|
|
157
|
+
"reason": "unknown_field"
|
|
126
158
|
}
|
|
127
159
|
},
|
|
128
160
|
{
|
|
@@ -188,5 +220,36 @@ export const rawManifestCases = [
|
|
|
188
220
|
"ok": false,
|
|
189
221
|
"reason": "invalid_shape"
|
|
190
222
|
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "bad-entrypoint-leading-dash",
|
|
226
|
+
"yaml": "name: my-server\nentrypoint: --isolated\n",
|
|
227
|
+
"expect": {
|
|
228
|
+
"ok": false,
|
|
229
|
+
"reason": "invalid_entrypoint"
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"name": "bad-entrypoint-leading-dash-nested",
|
|
234
|
+
"yaml": "name: my-server\nentrypoint: src/-rf.py\n",
|
|
235
|
+
"expect": {
|
|
236
|
+
"ok": false,
|
|
237
|
+
"reason": "invalid_entrypoint"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "bad-build-path-leading-dash",
|
|
242
|
+
"yaml": "name: my-server\nentrypoint: server.py\nbuild_path: -rf\n",
|
|
243
|
+
"expect": {
|
|
244
|
+
"ok": false,
|
|
245
|
+
"reason": "invalid_build_path"
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"name": "hyphen-inside-a-path-segment-is-fine",
|
|
250
|
+
"yaml": "name: my-server\nentrypoint: my-tools/mcp-server.py\n",
|
|
251
|
+
"expect": {
|
|
252
|
+
"ok": true
|
|
253
|
+
}
|
|
191
254
|
}
|
|
192
255
|
];
|
package/dist/manifest-cases.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
/** Mirrors `ManifestRejectionReason` in foro-sh/platform's `@foro/types`.
|
|
16
16
|
* Kept in sync deliberately: it is what makes a reason added on one side a
|
|
17
17
|
* compile error on the other. */
|
|
18
|
-
export type ManifestRejectionReason = 'missing_manifest' | 'unsupported_language' | 'invalid_yaml' | 'invalid_shape' | 'invalid_name' | 'invalid_entrypoint' | 'invalid_build_path' | '
|
|
18
|
+
export type ManifestRejectionReason = 'missing_manifest' | 'unsupported_language' | 'invalid_yaml' | 'invalid_shape' | 'invalid_name' | 'invalid_entrypoint' | 'invalid_build_path' | 'invalid_runtime' | 'invalid_runtime_version' | 'invalid_port' | 'invalid_dependency_manager' | 'unsupported_project' | 'unknown_field';
|
|
19
19
|
export interface ManifestCase {
|
|
20
20
|
/** Stable identifier, unique across the table - use it as the test name. */
|
|
21
21
|
readonly name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-cases.d.ts","sourceRoot":"","sources":["../src/manifest-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;kCAEkC;AAClC,MAAM,MAAM,uBAAuB,GAC/B,kBAAkB,GAClB,sBAAsB,GACtB,cAAc,GACd,eAAe,GACf,cAAc,GACd,oBAAoB,GACpB,oBAAoB,GACpB,
|
|
1
|
+
{"version":3,"file":"manifest-cases.d.ts","sourceRoot":"","sources":["../src/manifest-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;kCAEkC;AAClC,MAAM,MAAM,uBAAuB,GAC/B,kBAAkB,GAClB,sBAAsB,GACtB,cAAc,GACd,eAAe,GACf,cAAc,GACd,oBAAoB,GACpB,oBAAoB,GACpB,iBAAiB,GACjB,yBAAyB,GACzB,cAAc,GACd,4BAA4B,GAC5B,qBAAqB,GACrB,eAAe,CAAA;AAEnB,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EACX;QAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;KAAE,GACrB;QAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAA;KAAE,CAAA;CACrE;AAED,eAAO,MAAM,aAAa,EAAE,SAAS,YAAY,EAAqB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foro-sh/foro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "TypeScript SDK for Foro",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"!dist/**/*.test.*"
|
|
22
23
|
],
|
|
23
24
|
"scripts": {
|
|
24
25
|
"build": "node scripts/generate-manifest-cases.mjs && tsc -p tsconfig.json",
|
|
25
26
|
"prepublishOnly": "npm run build",
|
|
26
|
-
"test": "node --test dist
|
|
27
|
+
"test": "node --test dist/*.test.js"
|
|
27
28
|
},
|
|
28
29
|
"publishConfig": {
|
|
29
30
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-cases.test.d.ts","sourceRoot":"","sources":["../src/manifest-cases.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
});
|