@geonosis/testbed 1.0.0 → 1.1.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/bin/geonosis-testbed.mjs +24 -1
- package/package.json +14 -4
package/bin/geonosis-testbed.mjs
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Committed, so `pnpm install` can link the bin on a fresh clone — before `pnpm build` has
|
|
3
3
|
// produced dist/. A bin that only exists after a build is a bin that is missing when you need it.
|
|
4
|
-
|
|
4
|
+
//
|
|
5
|
+
// In the repo, `src/` sits beside `dist/`, and a dist older than src answered for a fix it did not
|
|
6
|
+
// carry once (#62). The published package ships no src, so there the check is skipped.
|
|
7
|
+
import { existsSync, readdirSync, statSync } from 'node:fs'
|
|
8
|
+
import { dirname, join } from 'node:path'
|
|
9
|
+
import { fileURLToPath } from 'node:url'
|
|
10
|
+
|
|
11
|
+
const here = dirname(fileURLToPath(import.meta.url))
|
|
12
|
+
const newest = (dir) =>
|
|
13
|
+
existsSync(dir)
|
|
14
|
+
? readdirSync(dir, { withFileTypes: true }).reduce((most, entry) => {
|
|
15
|
+
const at = join(dir, entry.name)
|
|
16
|
+
return Math.max(most, entry.isDirectory() ? newest(at) : statSync(at).mtimeMs)
|
|
17
|
+
}, 0)
|
|
18
|
+
: 0
|
|
19
|
+
const src = join(here, '..', 'src')
|
|
20
|
+
if (existsSync(src) && newest(src) > newest(join(here, '..', 'dist'))) {
|
|
21
|
+
process.stderr.write(
|
|
22
|
+
'geonosis-testbed: dist is older than src — run pnpm build before trusting this bin.\n',
|
|
23
|
+
)
|
|
24
|
+
process.exit(2)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
await import('../dist/cli.js')
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geonosis/testbed",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"types": "./dist/index.d.ts",
|
|
4
5
|
"description": "The fixtures law as code, one adapter contract for an integration harness, and the conformance suite an adapter has to pass. Extracted from dielime's Medusa runner and during.day's workerd cell.",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"testing",
|
|
@@ -20,9 +21,18 @@
|
|
|
20
21
|
"type": "module",
|
|
21
22
|
"main": "dist/index.js",
|
|
22
23
|
"exports": {
|
|
23
|
-
".":
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./medusa-built": {
|
|
29
|
+
"types": "./dist/medusa-built/index.d.ts",
|
|
30
|
+
"default": "./dist/medusa-built/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./workerd": {
|
|
33
|
+
"types": "./dist/workerd/index.d.ts",
|
|
34
|
+
"default": "./dist/workerd/index.js"
|
|
35
|
+
}
|
|
26
36
|
},
|
|
27
37
|
"files": [
|
|
28
38
|
"bin",
|