@kodentuzo/spotcraft 0.0.0-stage → 0.6.1
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/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +81 -2
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +196 -0
- package/dist/project.d.ts +41 -0
- package/dist/project.js +152 -0
- package/dist/provision.d.ts +57 -0
- package/dist/provision.js +163 -0
- package/dist/stack.d.ts +87 -0
- package/dist/stack.js +317 -0
- package/package.json +56 -4
package/dist/stack.js
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { createHash, randomBytes } from 'node:crypto';
|
|
3
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { createServer } from 'node:net';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { appRoleName, INSTANCE } from "./provision.js";
|
|
7
|
+
/**
|
|
8
|
+
* The local stack of one repository (ADR 0037): Postgres set up like the Spotcraft server's,
|
|
9
|
+
* the user pool, and Mailpit to catch email, as the Compose project
|
|
10
|
+
* `spotcraft-dev-<repo>-<hash>`. Tests keep the values below equal to the server's files.
|
|
11
|
+
*/
|
|
12
|
+
export const PROJECT_PREFIX = 'spotcraft-dev-';
|
|
13
|
+
/**
|
|
14
|
+
* A new stack's Compose project: the repository folder's slug and 6 hex characters of a hash of
|
|
15
|
+
* its absolute path, so two checkouts with the same folder name get their own stacks.
|
|
16
|
+
*/
|
|
17
|
+
export function projectName(root, slug) {
|
|
18
|
+
const hash = createHash('sha256').update(root).digest('hex').slice(0, 6);
|
|
19
|
+
return `${PROJECT_PREFIX}${slug}-${hash}`;
|
|
20
|
+
}
|
|
21
|
+
/** A name Compose accepts as a project name. */
|
|
22
|
+
const isProjectName = (name) => typeof name === 'string' && /^[a-z0-9][a-z0-9_-]*$/.test(name);
|
|
23
|
+
/** The server's Postgres image (infra/server/compose.yaml). */
|
|
24
|
+
export const POSTGRES_IMAGE = 'postgres:18.7-trixie@sha256:2ea8630df176ad090ec92136dee850397c5af8781e4bcf2e4162593691c61bbc';
|
|
25
|
+
/** Catches every email apps send (SMTP), with a web inbox. */
|
|
26
|
+
export const MAILPIT_IMAGE = 'axllent/mailpit:v1.33.1@sha256:aef2aacc11f075ec0fb6874275ee4a421e688e11a96ebb296134d1735c7761ce';
|
|
27
|
+
/** The user pool runs from the Spotcraft image of the same version as this CLI. */
|
|
28
|
+
export const SPOTCRAFT_IMAGE = 'vindotski/spotcraft';
|
|
29
|
+
/** The local pool's `iss`; it names the pool, it is not an address. */
|
|
30
|
+
export const LOCAL_ISSUER = 'http://localhost/pools/main';
|
|
31
|
+
/** The server's Postgres login rules (infra/server/pg_hba.conf). */
|
|
32
|
+
export const PG_HBA = `# TYPE DATABASE USER ADDRESS METHOD
|
|
33
|
+
local all postgres peer
|
|
34
|
+
local all all reject
|
|
35
|
+
host all postgres all reject
|
|
36
|
+
host all all all scram-sha-256
|
|
37
|
+
`;
|
|
38
|
+
/** The agent's role, exactly as the deploy script sets it up (infra/remote-deploy.sh). */
|
|
39
|
+
export const ADMIN_SQL = `SELECT NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'spotcraft_agent') AS missing \\gset
|
|
40
|
+
\\if :missing
|
|
41
|
+
CREATE ROLE spotcraft_agent LOGIN CREATEDB CREATEROLE PASSWORD :'pw';
|
|
42
|
+
\\else
|
|
43
|
+
ALTER ROLE spotcraft_agent LOGIN CREATEDB CREATEROLE NOSUPERUSER PASSWORD :'pw';
|
|
44
|
+
\\endif
|
|
45
|
+
-- Roles the agent creates (one per app) are ones it may SET ROLE to, which Postgres requires
|
|
46
|
+
-- to make them a database's owner; it doesn't inherit their rights.
|
|
47
|
+
ALTER ROLE spotcraft_agent SET createrole_self_grant = 'set';
|
|
48
|
+
-- Apps get CONNECT on their own database only; the built-in ones are the agent's.
|
|
49
|
+
REVOKE CONNECT ON DATABASE postgres, template1 FROM PUBLIC;
|
|
50
|
+
GRANT CONNECT ON DATABASE postgres TO spotcraft_agent;
|
|
51
|
+
-- The database apps share (ADR 0034), owned by the agent, and the group every app role joins.
|
|
52
|
+
-- The agent may grant the group to the app roles it makes, without inheriting its rights.
|
|
53
|
+
SELECT NOT EXISTS (SELECT FROM pg_database WHERE datname = 'apps') AS missing \\gset
|
|
54
|
+
\\if :missing
|
|
55
|
+
CREATE DATABASE apps OWNER spotcraft_agent;
|
|
56
|
+
\\endif
|
|
57
|
+
REVOKE ALL ON DATABASE apps FROM PUBLIC;
|
|
58
|
+
SELECT NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'spotcraft_app') AS missing \\gset
|
|
59
|
+
\\if :missing
|
|
60
|
+
CREATE ROLE spotcraft_app NOLOGIN;
|
|
61
|
+
\\endif
|
|
62
|
+
GRANT spotcraft_app TO spotcraft_agent WITH ADMIN OPTION, INHERIT FALSE;
|
|
63
|
+
-- The user pool's role (ADR 0035): it owns the auth schema in apps, and nothing else.
|
|
64
|
+
SELECT NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'spotcraft_auth') AS missing \\gset
|
|
65
|
+
\\if :missing
|
|
66
|
+
CREATE ROLE spotcraft_auth LOGIN PASSWORD :'auth_pw';
|
|
67
|
+
\\else
|
|
68
|
+
ALTER ROLE spotcraft_auth LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE PASSWORD :'auth_pw';
|
|
69
|
+
\\endif
|
|
70
|
+
GRANT CONNECT ON DATABASE apps TO spotcraft_auth;
|
|
71
|
+
\\c apps
|
|
72
|
+
REVOKE ALL ON SCHEMA public FROM PUBLIC;
|
|
73
|
+
CREATE SCHEMA IF NOT EXISTS auth AUTHORIZATION spotcraft_auth;
|
|
74
|
+
`;
|
|
75
|
+
// Fixed local passwords keep DATABASE_URL the same across runs (and in .env). Acceptable only
|
|
76
|
+
// because every port is bound to 127.0.0.1 and the data is throwaway.
|
|
77
|
+
const SUPERUSER_PASSWORD = 'spotcraft-dev-superuser';
|
|
78
|
+
const ADMIN_PASSWORD = 'spotcraft-dev-admin-password';
|
|
79
|
+
const AUTH_PASSWORD = 'spotcraft-dev-auth-password';
|
|
80
|
+
export const appPassword = (name) => `local-${name}-password`;
|
|
81
|
+
/** A free port on 127.0.0.1, as the system hands one out. */
|
|
82
|
+
function freePort() {
|
|
83
|
+
return new Promise((resolve, reject) => {
|
|
84
|
+
const server = createServer();
|
|
85
|
+
server.once('error', reject);
|
|
86
|
+
server.listen(0, '127.0.0.1', () => {
|
|
87
|
+
const address = server.address();
|
|
88
|
+
server.close(() => typeof address === 'object' && address
|
|
89
|
+
? resolve(address.port)
|
|
90
|
+
: reject(new Error('no port')));
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The repository's stack, from `.spotcraft/dev.json`, or a new one: free ports and the project
|
|
96
|
+
* name picked once and kept, so URLs in `.env` stay the same. A `dev.json` from 0.6.0 has no
|
|
97
|
+
* project name; it keeps that version's `spotcraft-dev-<slug>`, now written down.
|
|
98
|
+
* `.spotcraft/` ignores itself in git.
|
|
99
|
+
*/
|
|
100
|
+
export async function loadStack(root, slug, ports = freePort) {
|
|
101
|
+
const stateDir = join(root, '.spotcraft');
|
|
102
|
+
const file = join(stateDir, 'dev.json');
|
|
103
|
+
const save = async (stack) => {
|
|
104
|
+
const { stateDir: _, ...saved } = stack;
|
|
105
|
+
await writeFile(file, `${JSON.stringify(saved, null, 2)}\n`);
|
|
106
|
+
};
|
|
107
|
+
try {
|
|
108
|
+
const saved = JSON.parse(await readFile(file, 'utf8'));
|
|
109
|
+
if (saved.ports && saved.authSecret) {
|
|
110
|
+
const { ports, authSecret } = saved;
|
|
111
|
+
if (isProjectName(saved.project))
|
|
112
|
+
return { project: saved.project, stateDir, ports, authSecret };
|
|
113
|
+
const stack = { project: `${PROJECT_PREFIX}${slug}`, stateDir, ports, authSecret };
|
|
114
|
+
await save(stack);
|
|
115
|
+
return stack;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
if (error.code !== 'ENOENT' && !(error instanceof SyntaxError))
|
|
120
|
+
throw error;
|
|
121
|
+
}
|
|
122
|
+
const picked = new Set();
|
|
123
|
+
const next = async () => {
|
|
124
|
+
for (;;) {
|
|
125
|
+
const port = await ports();
|
|
126
|
+
if (!picked.has(port)) {
|
|
127
|
+
picked.add(port);
|
|
128
|
+
return port;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const stack = {
|
|
133
|
+
project: projectName(root, slug),
|
|
134
|
+
stateDir,
|
|
135
|
+
ports: { postgres: await next(), auth: await next(), smtp: await next(), mail: await next() },
|
|
136
|
+
authSecret: randomBytes(32).toString('hex'),
|
|
137
|
+
};
|
|
138
|
+
await mkdir(stateDir, { recursive: true });
|
|
139
|
+
await writeFile(join(stateDir, '.gitignore'), '*\n');
|
|
140
|
+
await save(stack);
|
|
141
|
+
return stack;
|
|
142
|
+
}
|
|
143
|
+
export const adminUrl = (stack) => `postgres://spotcraft_agent:${ADMIN_PASSWORD}@127.0.0.1:${stack.ports.postgres}/postgres`;
|
|
144
|
+
/**
|
|
145
|
+
* What the app gets, as on the server but on localhost: the instance database, or the app's own
|
|
146
|
+
* one if it still has it (from before ADR 0034).
|
|
147
|
+
*/
|
|
148
|
+
export function databaseUrl(stack, name, database = INSTANCE.database) {
|
|
149
|
+
return `postgres://${appRoleName(name)}:${appPassword(name)}@127.0.0.1:${stack.ports.postgres}/${database}`;
|
|
150
|
+
}
|
|
151
|
+
/** Where apps reach the local pool, mail and its inbox. */
|
|
152
|
+
export const poolUrl = (stack) => `http://localhost:${stack.ports.auth}/_spotcraft/auth`;
|
|
153
|
+
export const smtpUrl = (stack) => `smtp://localhost:${stack.ports.smtp}`;
|
|
154
|
+
export const mailUrl = (stack) => `http://localhost:${stack.ports.mail}`;
|
|
155
|
+
const container = (stack, service) => `${stack.project}-${service}-1`;
|
|
156
|
+
/** The pool's image: SPOTCRAFT_DEV_IMAGE (e.g. a local build), else this CLI's version. */
|
|
157
|
+
export function poolImage(version, env = process.env) {
|
|
158
|
+
return env.SPOTCRAFT_DEV_IMAGE?.trim() || `${SPOTCRAFT_IMAGE}:${version}`;
|
|
159
|
+
}
|
|
160
|
+
/** The Compose file, as JSON (valid YAML), passed to Docker on stdin. */
|
|
161
|
+
export function composeFile(stack, image) {
|
|
162
|
+
const local = (port, inside) => `127.0.0.1:${port}:${inside}`;
|
|
163
|
+
return JSON.stringify({
|
|
164
|
+
name: stack.project,
|
|
165
|
+
services: {
|
|
166
|
+
postgres: {
|
|
167
|
+
image: POSTGRES_IMAGE,
|
|
168
|
+
restart: 'unless-stopped',
|
|
169
|
+
environment: { POSTGRES_PASSWORD: SUPERUSER_PASSWORD },
|
|
170
|
+
command: [
|
|
171
|
+
'postgres',
|
|
172
|
+
'-c',
|
|
173
|
+
'hba_file=/etc/postgresql/pg_hba.conf',
|
|
174
|
+
'-c',
|
|
175
|
+
'password_encryption=scram-sha-256',
|
|
176
|
+
],
|
|
177
|
+
configs: [{ source: 'pg_hba', target: '/etc/postgresql/pg_hba.conf' }],
|
|
178
|
+
ports: [local(stack.ports.postgres, 5432)],
|
|
179
|
+
volumes: ['data:/var/lib/postgresql'],
|
|
180
|
+
healthcheck: {
|
|
181
|
+
test: ['CMD', 'pg_isready', '-q', '-h', '/var/run/postgresql', '-U', 'postgres'],
|
|
182
|
+
interval: '2s',
|
|
183
|
+
timeout: '5s',
|
|
184
|
+
retries: 30,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
// The user pool, as on the server, with plain HTTP and apps' dev servers trusted.
|
|
188
|
+
auth: {
|
|
189
|
+
image,
|
|
190
|
+
restart: 'unless-stopped',
|
|
191
|
+
working_dir: '/app/auth',
|
|
192
|
+
command: ['src/index.ts'],
|
|
193
|
+
environment: {
|
|
194
|
+
PORT: '3000',
|
|
195
|
+
AUTH_DATABASE_URL: `postgres://spotcraft_auth:${AUTH_PASSWORD}@postgres:5432/${INSTANCE.database}`,
|
|
196
|
+
AUTH_SECRET: stack.authSecret,
|
|
197
|
+
AUTH_ISSUER: LOCAL_ISSUER,
|
|
198
|
+
AUTH_PROTOCOL: 'http',
|
|
199
|
+
AUTH_LOCAL_ORIGINS: '1',
|
|
200
|
+
},
|
|
201
|
+
ports: [local(stack.ports.auth, 3000)],
|
|
202
|
+
depends_on: { postgres: { condition: 'service_healthy' } },
|
|
203
|
+
healthcheck: {
|
|
204
|
+
test: [
|
|
205
|
+
'CMD',
|
|
206
|
+
'/nodejs/bin/node',
|
|
207
|
+
'-e',
|
|
208
|
+
"fetch('http://127.0.0.1:3000/health').then((r) => process.exit(r.ok ? 0 : 1), () => process.exit(1))",
|
|
209
|
+
],
|
|
210
|
+
interval: '2s',
|
|
211
|
+
timeout: '3s',
|
|
212
|
+
retries: 60,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
mailpit: {
|
|
216
|
+
image: MAILPIT_IMAGE,
|
|
217
|
+
restart: 'unless-stopped',
|
|
218
|
+
ports: [local(stack.ports.smtp, 1025), local(stack.ports.mail, 8025)],
|
|
219
|
+
healthcheck: {
|
|
220
|
+
test: ['CMD', '/mailpit', 'readyz'],
|
|
221
|
+
interval: '2s',
|
|
222
|
+
timeout: '3s',
|
|
223
|
+
retries: 30,
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
volumes: { data: {} },
|
|
228
|
+
configs: { pg_hba: { content: PG_HBA } },
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/** Runs a command without a shell, optionally feeding `input` on stdin. */
|
|
232
|
+
export function run(file, args, input) {
|
|
233
|
+
return new Promise((resolve) => {
|
|
234
|
+
const child = spawn(file, args, { stdio: ['pipe', 'pipe', 'pipe'] });
|
|
235
|
+
let stdout = '';
|
|
236
|
+
let stderr = '';
|
|
237
|
+
child.stdout.on('data', (chunk) => {
|
|
238
|
+
stdout += chunk;
|
|
239
|
+
});
|
|
240
|
+
child.stderr.on('data', (chunk) => {
|
|
241
|
+
stderr += chunk;
|
|
242
|
+
});
|
|
243
|
+
child.on('error', (error) => resolve({ code: 127, stdout, stderr: error.message }));
|
|
244
|
+
child.on('close', (code) => resolve({ code: code ?? 1, stdout, stderr }));
|
|
245
|
+
child.stdin.end(input ?? '');
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
export class StackError extends Error {
|
|
249
|
+
}
|
|
250
|
+
/** Docker Compose for the stack; the file comes on stdin. */
|
|
251
|
+
function compose(stack, image, runner, args) {
|
|
252
|
+
return runner('docker', ['compose', '-p', stack.project, '-f', '-', ...args], composeFile(stack, image));
|
|
253
|
+
}
|
|
254
|
+
function fail(what, result) {
|
|
255
|
+
throw new StackError(`${what}\n${`${result.stderr}${result.stdout}`.trim()}`);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Starts the stack (what isn't running yet): Postgres first, then the roles and schemas the
|
|
259
|
+
* deploy script makes on a server, then the user pool and Mailpit, waiting until all are healthy.
|
|
260
|
+
*/
|
|
261
|
+
export async function up(stack, image, runner = run) {
|
|
262
|
+
const docker = await runner('docker', ['version', '--format', '{{.Server.Version}}']);
|
|
263
|
+
if (docker.code !== 0)
|
|
264
|
+
fail('Docker is not running (the local stack needs it).', docker);
|
|
265
|
+
const wait = ['up', '-d', '--wait', '--wait-timeout', '180'];
|
|
266
|
+
const postgres = await compose(stack, image, runner, [...wait, 'postgres']);
|
|
267
|
+
if (postgres.code !== 0)
|
|
268
|
+
fail('Could not start the local Postgres.', postgres);
|
|
269
|
+
// As the OS user `postgres`: the superuser only logs in over the socket with `peer`.
|
|
270
|
+
const roles = await runner('docker', [
|
|
271
|
+
'exec',
|
|
272
|
+
'-i',
|
|
273
|
+
'-u',
|
|
274
|
+
'postgres',
|
|
275
|
+
container(stack, 'postgres'),
|
|
276
|
+
'psql',
|
|
277
|
+
'-q',
|
|
278
|
+
'-v',
|
|
279
|
+
'ON_ERROR_STOP=1',
|
|
280
|
+
'-U',
|
|
281
|
+
'postgres',
|
|
282
|
+
'-d',
|
|
283
|
+
'postgres',
|
|
284
|
+
], `\\set pw ${ADMIN_PASSWORD}\n\\set auth_pw ${AUTH_PASSWORD}\n${ADMIN_SQL}`);
|
|
285
|
+
if (roles.code !== 0)
|
|
286
|
+
fail("Could not set up the agent's and the user pool's roles.", roles);
|
|
287
|
+
const rest = await compose(stack, image, runner, wait);
|
|
288
|
+
if (rest.code !== 0) {
|
|
289
|
+
fail(`Could not start the user pool or Mailpit (the pool's image is ${image}).`, rest);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/** Stops the stack; the data stays in its volume. */
|
|
293
|
+
export async function down(stack, image, runner = run) {
|
|
294
|
+
const stopped = await compose(stack, image, runner, ['stop']);
|
|
295
|
+
if (stopped.code !== 0)
|
|
296
|
+
fail('Could not stop the local stack.', stopped);
|
|
297
|
+
}
|
|
298
|
+
/** Whether the stack's Postgres is running. */
|
|
299
|
+
export async function isRunning(stack, runner = run) {
|
|
300
|
+
const state = await runner('docker', [
|
|
301
|
+
'inspect',
|
|
302
|
+
'--format',
|
|
303
|
+
'{{.State.Running}}',
|
|
304
|
+
container(stack, 'postgres'),
|
|
305
|
+
]);
|
|
306
|
+
return state.code === 0 && state.stdout.trim() === 'true';
|
|
307
|
+
}
|
|
308
|
+
/** Every repository's stack on this machine, running or not, with its state. */
|
|
309
|
+
export async function listStacks(runner = run) {
|
|
310
|
+
const listed = await runner('docker', ['compose', 'ls', '--all', '--format', 'json']);
|
|
311
|
+
if (listed.code !== 0)
|
|
312
|
+
fail('Could not list the local stacks.', listed);
|
|
313
|
+
const projects = JSON.parse(listed.stdout || '[]');
|
|
314
|
+
return projects
|
|
315
|
+
.filter((p) => p.Name.startsWith(PROJECT_PREFIX))
|
|
316
|
+
.map((p) => ({ name: p.Name.slice(PROJECT_PREFIX.length), status: p.Status }));
|
|
317
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kodentuzo/spotcraft",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.6.1",
|
|
4
|
+
"description": "The spotcraft command: a local stack that matches a Spotcraft server, per repository",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"spotcraft",
|
|
7
|
+
"cli",
|
|
8
|
+
"postgres",
|
|
9
|
+
"local-development"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://spotcraft.dev",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/kodentuzo/spotcraft/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/kodentuzo/spotcraft.git",
|
|
18
|
+
"directory": "packages/cli"
|
|
19
|
+
},
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=24"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"NOTICE",
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"bin": {
|
|
31
|
+
"spotcraft": "./dist/cli.js"
|
|
32
|
+
},
|
|
33
|
+
"exports": {
|
|
34
|
+
"./provision": {
|
|
35
|
+
"spotcraft-source": "./src/provision.ts",
|
|
36
|
+
"types": "./dist/provision.d.ts",
|
|
37
|
+
"default": "./dist/provision.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -p tsconfig.build.json",
|
|
45
|
+
"typecheck": "tsc",
|
|
46
|
+
"test": "node --conditions=spotcraft-source --test 'test/**/*.test.ts'",
|
|
47
|
+
"spotcraft": "node --conditions=spotcraft-source src/cli.ts",
|
|
48
|
+
"prepack": "node -e \"const fs = require('node:fs'); if (!fs.existsSync('dist')) throw new Error('Build first: pnpm --recursive run build'); for (const f of ['LICENSE', 'NOTICE']) fs.copyFileSync('../../' + f, f)\""
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"pg": "^8.23.1"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "catalog:",
|
|
55
|
+
"@types/pg": "^8.23.1",
|
|
56
|
+
"typescript": "catalog:"
|
|
57
|
+
}
|
|
58
|
+
}
|