mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 09:07:40 +00:00
linear-sdk.ts loads the SDK through createRequire, which the orcad bundle cannot follow, and nothing staged the package beside it. Bundle the SDK into node_modules/@linear/sdk/index.js at build time and list it as an orcad artifact so templates and installs carry it. Co-authored-by: thukabjj <31043997+thukabjj@users.noreply.github.com>
26 lines
773 B
JavaScript
26 lines
773 B
JavaScript
import { build } from 'esbuild'
|
|
import { join } from 'node:path'
|
|
import { ORCAD_LINEAR_SDK_ENTRY } from '../../src/shared/orcad-artifacts.ts'
|
|
|
|
/**
|
|
* @linear/sdk as one CommonJS file where orcad's lazy `require('@linear/sdk')` resolves it.
|
|
* Why bundled rather than copied: the package ships hashed chunk names that change every release.
|
|
*/
|
|
export async function stageOrcadLinearSdk(root, outputDir) {
|
|
await build({
|
|
stdin: {
|
|
contents: "module.exports = require('@linear/sdk')",
|
|
resolveDir: root,
|
|
sourcefile: 'orcad-linear-sdk-entry.js'
|
|
},
|
|
bundle: true,
|
|
platform: 'node',
|
|
target: 'node18',
|
|
format: 'cjs',
|
|
outfile: join(outputDir, ORCAD_LINEAR_SDK_ENTRY),
|
|
minify: true,
|
|
sourcemap: false,
|
|
logLevel: 'error'
|
|
})
|
|
}
|