cvx-kit 0.1.14 → 0.1.16

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.
Files changed (51) hide show
  1. package/README.md +64 -45
  2. package/dist/querying/cursors.d.mts +5 -0
  3. package/dist/querying/cursors.mjs +1 -1
  4. package/dist/querying/cursors.mjs.map +1 -1
  5. package/dist/querying.d.mts +20 -6
  6. package/dist/querying.mjs +1 -1
  7. package/dist/querying.mjs.map +1 -1
  8. package/dist/relations.mjs +1 -1
  9. package/dist/relations.mjs.map +1 -1
  10. package/dist/zod-table.d.mts +59 -2
  11. package/dist/zod-table.mjs +1 -1
  12. package/dist/zod-table.mjs.map +1 -1
  13. package/package.json +10 -3
  14. package/AGENTS.md +0 -47
  15. package/CHANGELOG.md +0 -324
  16. package/ROADMAP.md +0 -126
  17. package/docs/agent-tools.md +0 -41
  18. package/docs/approvals.md +0 -201
  19. package/docs/architecture.md +0 -124
  20. package/docs/auth.md +0 -443
  21. package/docs/command-context.md +0 -150
  22. package/docs/commands-legacy.md +0 -513
  23. package/docs/commands.md +0 -173
  24. package/docs/conventions.md +0 -345
  25. package/docs/crud.md +0 -66
  26. package/docs/domain-contracts.md +0 -148
  27. package/docs/domain-operations.md +0 -615
  28. package/docs/effect.md +0 -403
  29. package/docs/llms.md +0 -324
  30. package/docs/maintainability.md +0 -124
  31. package/docs/migration.md +0 -351
  32. package/docs/oxlint.md +0 -254
  33. package/docs/querying.md +0 -293
  34. package/docs/tenancy.md +0 -176
  35. package/docs/triggers.md +0 -77
  36. package/docs/upgrading.md +0 -287
  37. package/docs/webhooks.md +0 -58
  38. package/docs/zod-table.md +0 -278
  39. package/scripts/convex-config-bridge.mjs +0 -44
  40. package/scripts/convex-smoke-env.mjs +0 -33
  41. package/scripts/extract-changelog.mjs +0 -29
  42. package/scripts/owned-process.mjs +0 -140
  43. package/scripts/owned-process.test.mjs +0 -107
  44. package/scripts/smoke-packed-components.mjs +0 -341
  45. package/scripts/smoke-packed-effect.mjs +0 -439
  46. package/scripts/smoke-packed-querying.mjs +0 -296
  47. package/scripts/test-packed-auth.mjs +0 -72
  48. package/scripts/test-packed-effect.mjs +0 -482
  49. package/scripts/test-packed-ids.mjs +0 -150
  50. package/scripts/test-packed-oxlint.mjs +0 -167
  51. package/scripts/test-packed-querying.mjs +0 -185
@@ -1,296 +0,0 @@
1
- import assert from 'node:assert/strict'
2
- import { execFileSync } from 'node:child_process'
3
- import { runOwnedProcess, collectOwnedCleanup } from './owned-process.mjs'
4
- import { createHash } from 'node:crypto'
5
- import {
6
- cpSync,
7
- existsSync,
8
- mkdtempSync,
9
- readFileSync,
10
- readdirSync,
11
- symlinkSync,
12
- writeFileSync,
13
- } from 'node:fs'
14
- import { createServer } from 'node:net'
15
- import { join, resolve, relative } from 'node:path'
16
- import {
17
- localConvexEnvironment,
18
- assertIsolatedConvexFixture,
19
- assertLocalConvexState,
20
- } from './convex-smoke-env.mjs'
21
-
22
- // Run against the retained installed peer of the exact packed stress candidate.
23
- const packed = resolve(process.argv[2] ?? '')
24
- const identity = JSON.parse(readFileSync(join(packed, 'package-identity.json'), 'utf8'))
25
- const hash = (bytes) => createHash('sha256').update(bytes).digest('hex')
26
- assert.equal(hash(readFileSync(identity.tarball)), identity.sha256)
27
- const source = join(packed, 'installed')
28
- assert.equal(
29
- JSON.parse(readFileSync(join(source, 'node_modules/convex/package.json'), 'utf8')).version,
30
- '1.46.0',
31
- )
32
- const fixture = mkdtempSync('/tmp/cvx-relational-engine-native-')
33
- console.log(`U8 native retained proof: ${fixture}`)
34
- cpSync(join(source, 'convex'), join(fixture, 'convex'), { recursive: true })
35
- symlinkSync(join(source, 'node_modules'), join(fixture, 'node_modules'), 'dir')
36
- writeFileSync(
37
- join(fixture, 'package.json'),
38
- JSON.stringify({
39
- private: true,
40
- type: 'module',
41
- dependencies: { convex: '1.46.0', 'cvx-kit': identity.version },
42
- }),
43
- )
44
- cpSync(join(source, 'register.mjs'), join(fixture, 'register.mjs'))
45
- cpSync(
46
- resolve(import.meta.dirname, '../test/fixture-packed-querying/audit-native.mjs.template'),
47
- join(fixture, 'audit.mjs'),
48
- )
49
- cpSync(join(source, 'tsconfig.json'), join(fixture, 'tsconfig.json'))
50
- writeFileSync(join(fixture, 'package-identity.json'), JSON.stringify(identity, null, 2))
51
- // Native representative runs under central defaults, rather than the stress ceilings.
52
- writeFileSync(
53
- join(fixture, 'convex/querying.ts'),
54
- `import { createQueryEngine } from 'cvx-kit/querying'
55
- import schema from './schema'
56
- import { relations } from './relations'
57
- import { cursor } from './functions'
58
- export const querying = createQueryEngine({ schema, relations, cursor })
59
- `,
60
- )
61
- const originalRelations = readFileSync(join(fixture, 'convex/relations.ts'), 'utf8')
62
- writeFileSync(join(fixture, 'convex/relations.ts'), originalRelations)
63
- writeFileSync(join(fixture, 'convex/relationsEquivalent.ts'), originalRelations)
64
- writeFileSync(
65
- join(fixture, 'convex/relationsChanged.ts'),
66
- originalRelations.replace(
67
- 'aliasLabels: r.many.labels({ from: r.tasks._id.through(r.edges.task), to: r.labels._id.through(r.edges.label) })',
68
- 'aliasLabels: r.many.labels({ from: r.tasks._id, to: r.labels.task })',
69
- ),
70
- )
71
- writeFileSync(
72
- join(fixture, 'convex/api/probes.ts'),
73
- `import { createQueryEngine } from 'cvx-kit/querying'
74
- import { authQuery } from '../functions'
75
- import { relations as equivalent } from '../relationsEquivalent'
76
- import { relations as changed } from '../relationsChanged'
77
- import schema from '../schema'
78
- import { cursor } from '../functions'
79
- import { contract } from '../domain/tasks/contracts'
80
- const eq = createQueryEngine({ schema, relations: equivalent, cursor })
81
- const different = createQueryEngine({ schema, relations: changed, cursor })
82
- export const resume = authQuery({ args: contract.queries.list.input, returns: contract.queries.list.result, handler: (ctx,args) => eq(ctx).tasks.paginate(args) })
83
- export const reject = authQuery({ args: contract.queries.list.input, returns: contract.queries.list.result, handler: (ctx,args) => different(ctx).tasks.paginate(args) })
84
- `,
85
- )
86
- writeFileSync(
87
- join(fixture, 'convex/seed.ts'),
88
- `import { internalMutation } from './_generated/server'
89
- export const seed = internalMutation({ args: {}, handler: async (ctx) => {
90
- const tasks = []
91
- for(let ordinal=0;ordinal<24;ordinal++) tasks.push(await ctx.db.insert('tasks',{ordinal,tenant:'a',department:'support',status:'open',active:false,priority:0,code:'',authorized:ordinal>=5,secret:'NATIVE_PRIVATE'}))
92
- const labels=[]
93
- for(let ordinal=0;ordinal<6;ordinal++) labels.push(await ctx.db.insert('labels',{ordinal,tenant:'a',authorized:ordinal!==5,name:'native-label-'+ordinal,task:tasks[5]}))
94
- await ctx.db.patch(tasks[5],{reference:tasks[0],required:labels[0]})
95
- for(let ordinal=0;ordinal<6;ordinal++) await ctx.db.insert('edges',{ordinal,task:tasks[5],label:labels[ordinal],authorized:ordinal!==4})
96
- await ctx.db.insert('edges',{ordinal:6,task:tasks[5],label:labels[1],authorized:true})
97
- return {tasks,labels}
98
- } })
99
- `,
100
- )
101
- // Generated by the native CLI before deployment; initial binding supports the HTTP seed route.
102
- const serverPath = join(fixture, 'convex/_generated/server.ts')
103
- writeFileSync(
104
- serverPath,
105
- readFileSync(serverPath, 'utf8') +
106
- "\nexport { httpActionGeneric as httpAction } from 'convex/server'\n",
107
- )
108
- writeFileSync(
109
- join(fixture, 'convex/http.ts'),
110
- `import { httpRouter } from 'convex/server'
111
- import { httpAction } from './_generated/server'
112
- import { makeFunctionReference } from 'convex/server'
113
- const router=httpRouter()
114
- router.route({path:'/seed',method:'POST',handler:httpAction(async ctx=>new Response(JSON.stringify(await ctx.runMutation(makeFunctionReference<'mutation'>('seed:seed'),{})),{headers:{'content-type':'application/json'}}))})
115
- export default router
116
- `,
117
- )
118
- // Metadata comes from actual native registered functions, not a reduced hand-written validator.
119
- writeFileSync(
120
- join(fixture, 'metadata.mjs'),
121
- `import { writeFileSync } from 'node:fs'; import * as api from './convex/api/tasks.ts';
122
- for(const [name, fn] of Object.entries(api)) writeFileSync('validator-'+name+'.json',JSON.stringify({args:JSON.parse(fn.exportArgs()),returns:JSON.parse(fn.exportReturns())}));
123
- `,
124
- )
125
- writeFileSync(
126
- join(fixture, 'verify.mjs'),
127
- `import assert from 'node:assert/strict';import {readFileSync,writeFileSync} from 'node:fs';import {spawnSync} from 'node:child_process';
128
- const key=JSON.parse(readFileSync('.convex/local/default/config.json')).adminKey;
129
- const who={subject:'native-reader',issuer:'https://fixture.test',tokenIdentifier:'https://fixture.test|native-reader',org_id:'a',role:'reader'};
130
- const url='http://127.0.0.1:'+process.argv[2];const records=[];
131
- async function call(path,label,args,valid=true,identity=who){
132
- const started=performance.now();const res=await fetch(url+'/api/query',{method:'POST',headers:{'content-type':'application/json',...(identity?{Authorization:'Convex '+key+':'+Buffer.from(JSON.stringify(identity)).toString('base64')}:{})},body:JSON.stringify({path,args,format:'json'})});const raw=await res.text();writeFileSync('http-'+records.length+'-'+label+'.json',raw);const body=JSON.parse(raw);assert.equal(res.status,200);assert.equal(body.status,valid?'success':'error',label+': '+raw);assert.ok(!raw.includes('NATIVE_PRIVATE'));records.push({path,label,args,status:body.status,milliseconds:performance.now()-started,bytes:Buffer.byteLength(raw)});writeFileSync('native-results.json',JSON.stringify(records,null,2));return body;
133
- }
134
- // Local deployment registration also consumes the backend write-rate window.
135
- await new Promise(resolve=>setTimeout(resolve,2000));
136
- const seedResponse=await fetch('http://127.0.0.1:'+process.argv[3]+'/seed',{method:'POST'});const seedRaw=await seedResponse.text();writeFileSync('seed-envelope.json',seedRaw);assert.equal(seedResponse.status,200);const ids=JSON.parse(seedRaw);
137
- for(const order of ['asc','desc']){let cursor=null;const actual=[];for(let page=0;page<30;page++){const body=await call('api/tasks:conditional','conditional-'+order+'-'+page,{numItems:7,cursor,order,filters:{active:false}});actual.push(...body.value.page.map(r=>r._id));if(body.value.isDone)break;assert.notEqual(body.value.continueCursor,cursor);cursor=body.value.continueCursor;}const expected=ids.tasks.slice(5);if(order==='desc')expected.reverse();assert.deepEqual(actual,expected);}
138
- const first=(await call('api/tasks:list','first',{numItems:1,cursor:null})).value;
139
- assert.match(first.continueCursor,/^pc\\./);assert.ok(!first.continueCursor.includes(ids.tasks[5]));
140
- await call('api/probes:resume','equivalent-registry',{numItems:7,cursor:first.continueCursor});
141
- await call('api/probes:reject','changed-registry',{numItems:7,cursor:first.continueCursor},false);
142
- for(const [label,args,identity] of [['tamper',{numItems:1,cursor:first.continueCursor+'!'},who],['filter',{numItems:1,cursor:first.continueCursor,filters:{ordinal:6}},who],['order',{numItems:1,cursor:first.continueCursor,order:'desc'},who],['tenant',{numItems:1,cursor:first.continueCursor},{...who,org_id:'b'}],['principal',{numItems:1,cursor:first.continueCursor},{...who,subject:'other',tokenIdentifier:'other'}]]){const body=await call('api/tasks:list',label,args,false,identity);assert.match(body.errorMessage,/Invalid cursor/);}
143
- await call('api/tasks:list','no-identity',{numItems:1,cursor:null},false,null);
144
- await call('api/tasks:list','unsupported-role',{numItems:1,cursor:null},false,{...who,role:'unknown'});
145
- const expanded=(await call('api/tasks:expanded','expanded',{numItems:7,cursor:null,filters:{ordinal:5}})).value.page[0];assert.equal(expanded.referenceTask,null);assert.equal(expanded.requiredLabel._id,ids.labels[0]);assert.equal(expanded.labels.page.length,5);assert.ok(expanded.labels.page.every(r=>r.owner._id===ids.tasks[5]));assert.deepEqual(expanded.labels.page.map(r=>r._id),expanded.aliasLabels.page.map(r=>r._id));
146
- const predicate=(await call('api/tasks:list','nested-predicate',{numItems:7,cursor:null,filters:{labels:{some:{ordinal:1,owner:{ordinal:5}}}}})).value;assert.deepEqual(predicate.page.map(r=>r._id),[ids.tasks[5]]);
147
- let cursor=null;const child=[];for(let page=0;page<10;page++){const value=(await call('api/tasks:next','child-'+page,{parent:ids.tasks[5],numItems:1,cursor})).value;child.push(...value.page.map(r=>r._id));if(value.isDone)break;cursor=value.continueCursor;}assert.deepEqual(child,[...ids.labels.slice(0,4),ids.labels[1]]);
148
- await call('api/tasks:next','cross-parent',{parent:ids.tasks[6],numItems:1,cursor},false);
149
- for(const [label,args] of [['wrong-scalar',{numItems:1,cursor:null,filters:{referenceTask:{ordinal:'wrong'}}}],['unknown-operator',{numItems:1,cursor:null,filters:{ordinal:{bad:1}}}],['bad-options',{numItems:0,cursor:null}],['unknown-field',{numItems:1,cursor:null,filters:{unknown:1}}]])await call('api/tasks:list',label,args,false);
150
- const wrongTable=await call('api/tasks:next','wrong-table-parent',{parent:ids.labels[0],numItems:1,cursor:null},false);assert.match(wrongTable.errorMessage,/ArgumentValidationError/);assert.ok(!wrongTable.errorMessage.includes('Invalid cursor'));
151
- const split=(await call('api/tasks:list','native-limit',{numItems:100,cursor:null,maximumRowsRead:8})).value;assert.match(split.splitCursor,/^pc\\./);assert.ok(['SplitRequired','SplitRecommended'].includes(split.pageStatus));
152
- const left=(await call('api/tasks:list','end-left',{numItems:100,cursor:null,endCursor:split.splitCursor})).value;const right=(await call('api/tasks:list','end-right',{numItems:100,cursor:split.splitCursor,endCursor:split.continueCursor})).value;assert.deepEqual([...left.page,...right.page],split.page);
153
- const cli=spawnSync(process.execPath,['node_modules/convex/bin/main.js','run','api/tasks:list',JSON.stringify({numItems:1,cursor:null}),'--identity',JSON.stringify(who)],{encoding:'utf8',timeout:30000});writeFileSync('cli-identity.stdout.log',cli.stdout);writeFileSync('cli-identity.stderr.log',cli.stderr);assert.equal(cli.status,0);assert.equal(JSON.parse(cli.stdout).page[0]._id,ids.tasks[5]);
154
- writeFileSync('NATIVE_SUCCESS',JSON.stringify({cases:records.length,cliIdentity:true}));console.log(records.length+' native HTTP envelopes passed');
155
- `,
156
- )
157
- const files = (dir) =>
158
- readdirSync(dir, { withFileTypes: true }).flatMap((e) =>
159
- e.isDirectory() ? files(join(dir, e.name)) : [join(dir, e.name)],
160
- )
161
- const paths = files(join(fixture, 'convex')).filter((p) => !p.includes('/_generated/'))
162
- const hashes = () =>
163
- Object.fromEntries(paths.map((p) => [relative(fixture, p), hash(readFileSync(p))]))
164
- const before = hashes()
165
- writeFileSync(join(fixture, 'source-before.json'), JSON.stringify(before, null, 2))
166
- execFileSync(process.execPath, ['--import', './register.mjs', 'metadata.mjs'], {
167
- cwd: fixture,
168
- stdio: 'pipe',
169
- })
170
- const metadata = files(fixture).filter((p) => /validator-.*\.json$/.test(p))
171
- writeFileSync(
172
- join(fixture, 'native-validator-hashes.json'),
173
- JSON.stringify(
174
- metadata.map((p) => ({
175
- path: relative(fixture, p),
176
- bytes: readFileSync(p).length,
177
- sha256: hash(readFileSync(p)),
178
- })),
179
- null,
180
- 2,
181
- ),
182
- )
183
- const env = localConvexEnvironment()
184
- assertIsolatedConvexFixture(fixture)
185
- async function freePort(requested = 0) {
186
- const server = createServer()
187
- await new Promise((done, fail) => {
188
- server.once('error', fail)
189
- server.listen(requested, '127.0.0.1', done)
190
- })
191
- const port = server.address().port
192
- await new Promise((done) => server.close(done))
193
- return port
194
- }
195
- const cloud = await freePort()
196
- let site = await freePort()
197
- while (site === cloud) site = await freePort()
198
- const commands = []
199
- const processes = []
200
- async function run(label, args) {
201
- commands.push([process.execPath, 'node_modules/convex/bin/main.js', ...args])
202
- writeFileSync(join(fixture, 'commands.json'), JSON.stringify(commands, null, 2))
203
- const result = await runOwnedProcess({
204
- command: process.execPath,
205
- args: commands.at(-1).slice(1),
206
- cwd: fixture,
207
- env,
208
- onSpawn: (pid) => processes.push(pid),
209
- })
210
- const { stdout, stderr, ...evidence } = result
211
- writeFileSync(join(fixture, label + '.stdout.log'), stdout)
212
- writeFileSync(join(fixture, label + '.stderr.log'), stderr)
213
- writeFileSync(join(fixture, label + '-result.json'), JSON.stringify(evidence, null, 2))
214
- assert.equal(result.code, 0, label + ' failed; retained logs')
215
- assert.equal(result.timedOut, false, label + ' timed out; retained logs')
216
- assert.equal(result.cleanup?.alive, false, label + ' owned group survived cleanup')
217
- console.log(label + ': exit 0')
218
- }
219
- let originalFailure
220
- try {
221
- await run('deploy', [
222
- 'dev',
223
- '--once',
224
- '--typecheck=disable',
225
- '--local-cloud-port',
226
- String(cloud),
227
- '--local-site-port',
228
- String(site),
229
- ])
230
- assertLocalConvexState(fixture)
231
- const cfg = JSON.parse(readFileSync(join(fixture, '.convex/local/default/config.json')))
232
- assert.equal(cfg.ports.cloud, cloud)
233
- assert.equal(cfg.ports.site, site)
234
- writeFileSync(
235
- join(fixture, 'local-binding.json'),
236
- JSON.stringify({ ports: cfg.ports, backendVersion: cfg.backendVersion }),
237
- )
238
- execFileSync(join(source, 'node_modules/.bin/tsc'), ['--project', 'tsconfig.json'], {
239
- cwd: fixture,
240
- stdio: 'pipe',
241
- })
242
- writeFileSync(
243
- join(fixture, 'strict-types-result.json'),
244
- JSON.stringify({ exitCode: 0, strict: true, skipLibCheck: false }),
245
- )
246
- await run('runtime', [
247
- 'dev',
248
- '--once',
249
- '--typecheck=disable',
250
- '--start',
251
- `node verify.mjs ${cloud} ${site}`,
252
- ])
253
- assert.ok(existsSync(join(fixture, 'NATIVE_SUCCESS')))
254
- const rows = JSON.parse(readFileSync(join(fixture, 'native-results.json')))
255
- assert.ok(rows.length >= 25)
256
- assert.equal(files(fixture).filter((p) => /http-\d+-.*\.json$/.test(p)).length, rows.length)
257
- const key = JSON.parse(readFileSync(join(fixture, '.convex/local/default/config.json'))).adminKey
258
- for (const path of files(fixture).filter(
259
- (p) => /\.(log|json)$/.test(p) && !p.includes('/.convex/'),
260
- )) {
261
- const bytes = readFileSync(path, 'utf8')
262
- assert.ok(!bytes.includes(key))
263
- assert.ok(!bytes.includes('Authorization: Convex'))
264
- }
265
- assert.deepEqual(hashes(), before)
266
- assert.equal(hash(readFileSync(identity.tarball)), identity.sha256)
267
- writeFileSync(join(fixture, 'source-after.json'), JSON.stringify(hashes(), null, 2))
268
- } catch (error) {
269
- originalFailure = error
270
- throw error
271
- } finally {
272
- const cleanup = await collectOwnedCleanup({
273
- pids: processes,
274
- ports: [cloud, site],
275
- checkPort: freePort,
276
- failure: originalFailure,
277
- })
278
- writeFileSync(join(fixture, 'cleanup.json'), JSON.stringify(cleanup, null, 2))
279
- // Preserve the original proof error; cleanup diagnostics remain independently recorded.
280
- if (!originalFailure) {
281
- assert.ok(
282
- cleanup.groups.every((group) => !group.alive && !group.error && group.errors.length === 0),
283
- 'Owned process cleanup failed',
284
- )
285
- assert.ok(
286
- cleanup.ports.every((port) => port.closed),
287
- 'Owned ports remain occupied',
288
- )
289
- }
290
- }
291
- writeFileSync(
292
- join(fixture, 'SUCCESS'),
293
- 'Bounded exact packed default runtime integrated proof passed.\n',
294
- )
295
- execFileSync(process.execPath, ['audit.mjs'], { cwd: fixture, stdio: 'pipe' })
296
- console.log(`Native proof complete: ${fixture}`)
@@ -1,72 +0,0 @@
1
- import { execFileSync } from 'node:child_process'
2
- import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
3
- import { tmpdir } from 'node:os'
4
- import { basename, join, resolve } from 'node:path'
5
-
6
- const root = resolve(import.meta.dirname, '..')
7
- const manifest = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'))
8
- const temporary = mkdtempSync(join(tmpdir(), 'cvx-kit-auth-'))
9
- function run(command, args, cwd) {
10
- try {
11
- return execFileSync(command, args, { cwd, encoding: 'utf8', stdio: 'pipe' })
12
- } catch (error) {
13
- if (!args.includes('install')) {
14
- process.stderr.write(error.stdout ?? '')
15
- process.stderr.write(error.stderr ?? '')
16
- }
17
- throw new Error(`${command} ${args.join(' ')} failed in ${basename(cwd)}`, {
18
- cause: error.code,
19
- })
20
- }
21
- }
22
- try {
23
- run('bun', ['pm', 'pack', '--ignore-scripts', '--destination', temporary], root)
24
- const tarball = join(temporary, `${manifest.name}-${manifest.version}.tgz`)
25
- // 1.45 is a declaration regression target, below the current workflow peer floor.
26
- for (const convex of ['1.45.0', '1.46.0']) {
27
- const fixture = mkdtempSync(join(temporary, `convex-${convex}-`))
28
- writeFileSync(
29
- join(fixture, 'package.json'),
30
- JSON.stringify({
31
- private: true,
32
- type: 'module',
33
- dependencies: {
34
- 'cvx-kit': `file:${tarball}`,
35
- convex,
36
- 'convex-helpers': manifest.devDependencies['convex-helpers'],
37
- effect: manifest.devDependencies.effect,
38
- zod: manifest.devDependencies.zod,
39
- typescript: manifest.devDependencies.typescript,
40
- '@types/node': manifest.devDependencies['@types/node'],
41
- },
42
- }),
43
- )
44
- writeFileSync(
45
- join(fixture, 'auth.ts'),
46
- readFileSync(join(root, 'test/auth-native-context-types.ts')),
47
- )
48
- writeFileSync(
49
- join(fixture, 'shared-auth.ts'),
50
- readFileSync(join(root, 'test/effect-auth-types.ts')),
51
- )
52
- writeFileSync(
53
- join(fixture, 'tsconfig.json'),
54
- JSON.stringify({
55
- compilerOptions: {
56
- strict: true,
57
- noEmit: true,
58
- skipLibCheck: true,
59
- target: 'ES2025',
60
- module: 'ESNext',
61
- moduleResolution: 'bundler',
62
- },
63
- include: ['auth.ts', 'shared-auth.ts'],
64
- }),
65
- )
66
- run('bun', ['install', '--ignore-scripts'], fixture)
67
- run('bun', ['x', '--no-install', 'tsc', '--project', 'tsconfig.json'], fixture)
68
- console.log(`Packed auth native contexts pass on Convex ${convex}`)
69
- }
70
- } finally {
71
- rmSync(temporary, { recursive: true, force: true })
72
- }