@preventive/triage 1.0.0-alpha.36 → 1.0.0-alpha.37
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/package.json
CHANGED
|
@@ -58,7 +58,7 @@ export async function buildStasisBundle({ input, github, token, maxBytes, scopes
|
|
|
58
58
|
} }
|
|
59
59
|
// Upstream's disk cache keeps the npm tarballs and version documents, and
|
|
60
60
|
// the repo's tree, in `cacheDir`; without one (Vercel), nothing is kept on
|
|
61
|
-
// disk. This fresh worker inherits no application credentials.
|
|
61
|
+
// disk. This fresh worker inherits no application credentials but NPM_TOKEN.
|
|
62
62
|
setCacheDir(cacheDir ?? false)
|
|
63
63
|
progress('build')
|
|
64
64
|
const project = await projectDirectory(input, github, buildClient)
|
|
@@ -99,7 +99,7 @@ export interface BuiltBundle { bytes: Uint8Array; directory: string; filename: s
|
|
|
99
99
|
export interface BuildRequest {
|
|
100
100
|
input: BundleBuildInput; github: string; token: string | null; maxBytes: number; scopes: (string | null)[]
|
|
101
101
|
// Upstream's disk cache for what a build fetches (setCacheDir), or null for
|
|
102
|
-
// none, as on Vercel. Resolved here: the worker
|
|
102
|
+
// none, as on Vercel. Resolved here: the worker's env holds NPM_TOKEN alone.
|
|
103
103
|
cacheDir: string | null
|
|
104
104
|
}
|
|
105
105
|
// An extra per-process ceiling; admission must also hold the shared DB lease.
|
|
@@ -152,8 +152,12 @@ export async function buildRepositoryBundle(userId: string, request: BuildReques
|
|
|
152
152
|
try {
|
|
153
153
|
workerUrl = new URL('./bundle-build-worker.js', import.meta.url)
|
|
154
154
|
log('started')
|
|
155
|
+
// Upstream reads NPM_TOKEN from the env for scoped packages, which npm
|
|
156
|
+
// answers with 404 when private and asked without it. Nothing else passes.
|
|
157
|
+
const npmToken = process.env['NPM_TOKEN']
|
|
158
|
+
const env = npmToken ? { NPM_TOKEN: npmToken } : {}
|
|
155
159
|
worker = new Worker(workerUrl, {
|
|
156
|
-
workerData: { ...request, type: 'managed-bundle-build' }, env
|
|
160
|
+
workerData: { ...request, type: 'managed-bundle-build' }, env, execArgv: [], resourceLimits: { maxOldGenerationSizeMb: 512 },
|
|
157
161
|
})
|
|
158
162
|
const running = worker
|
|
159
163
|
return await new Promise((resolve, reject) => {
|