Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/1-prisma-cloud/2-shared-modules/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"./service": {
"types": "./dist/service.d.mts",
"default": "./dist/service.mjs"
"./storage-service": {
"types": "./dist/storage-service.d.mts",
"default": "./dist/storage-service.mjs"
},
"./storage-entrypoint": {
"types": "./dist/storage-entrypoint.d.mts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function storageService(opts: { bucket: string }) {
deps: { db: postgres(), credentials: s3Credentials() },
params: { bucket: string({ default: opts.bucket }) },
build: node({
module: new URL('./service.mjs', import.meta.url).href,
module: new URL('./storage-service.mjs', import.meta.url).href,
entry: './storage-entrypoint.mjs',
}),
expose: { store: s3Contract },
Expand Down
17 changes: 7 additions & 10 deletions packages/1-prisma-cloud/2-shared-modules/storage/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import { baseConfig } from '@internal/tsdown-config';
import { defineConfig } from 'tsdown';

// index + the service node in ONE pass at the dist root so any shared chunk
// sits beside them. The service node's file is emitted as `service.mjs` (NOT
// `storage-service.mjs`): @prisma/compose/node's assemble() re-bundles
// `build.module` and requires the output basename to be `service.*` — so
// `build.module` points at `./service.mjs` and resolves it from the calling
// code (import.meta.url). storage-entrypoint stands alone and is fully inlined
// (assemble() copies it out with no siblings); `bun` stays external (a runtime
// builtin, ADR-0008), so `import { SQL } from 'bun'` and Bun.serve resolve at
// runtime, not at build.
// index + storage-service in ONE pass at the dist root so any shared chunk
// sits beside them — storageService resolves `./storage-service.mjs` from the
// code that calls it (import.meta.url). storage-entrypoint stands alone and is
// fully inlined (assemble() copies it out with no siblings); `bun` stays
// external (a runtime builtin, ADR-0008), so `import { SQL } from 'bun'` and
// Bun.serve resolve at runtime, not at build.
export default defineConfig([
{
...baseConfig,
entry: { index: 'src/index.ts', service: 'src/storage-service.ts' },
entry: { index: 'src/index.ts', 'storage-service': 'src/storage-service.ts' },
exports: false,
clean: true,
},
Expand Down
4 changes: 1 addition & 3 deletions packages/9-public/compose-prisma-cloud/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ export default defineConfig([
...baseConfig,
dts: false,
entry: {
// Emitted as `service.mjs` — @prisma/compose/node's assemble() requires
// the service node's `build.module` basename to be `service.*`.
service: `${storageDist}/service.mjs`,
'storage-service': `${storageDist}/storage-service.mjs`,
'storage-entrypoint': `${storageDist}/storage-entrypoint.mjs`,
},
outDir: 'dist/storage',
Expand Down
Loading