fix build
Some checks failed
Publish documentation / docs (push) Failing after 2s
Check Semantic Commit / Validate PR Title (pull_request) Failing after 2s
Test / Test (22.12.x) (pull_request) Has been cancelled

This commit is contained in:
2025-12-12 14:54:10 +01:00
parent 6f0968cdce
commit 75309d0945
4 changed files with 17 additions and 8 deletions

5
.npmignore Normal file
View File

@@ -0,0 +1,5 @@
# npmignore overrides .gitignore for yarn pack
# Only exclude source files, not built files
entry-asar/**/*.mts
entry-asar/**/*.ts
entry-asar/**/tsconfig.json

View File

@@ -1,9 +1,10 @@
{ {
"extends": "../../tsconfig.esm.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"module": "ESNext", "module": "ESNext",
"target":"ESNext", "target":"ESNext",
"outDir": ".", "outDir": ".",
"moduleResolution": "bundler"
}, },
"include": [ "include": [
".", ".",

View File

@@ -19,8 +19,11 @@
}, },
"files": [ "files": [
"dist/*", "dist/*",
"entry-asar/*", "entry-asar/**/*",
"!entry-asar/**/*.{ts,mts}", "!entry-asar/**/has-asar.ts",
"!entry-asar/**/no-asar.ts",
"!entry-asar/**/has-asar.mts",
"!entry-asar/**/no-asar.mts",
"!entry-asar/**/tsconfig.json", "!entry-asar/**/tsconfig.json",
"README.md" "README.md"
], ],
@@ -29,7 +32,7 @@
"provenance": true "provenance": true
}, },
"scripts": { "scripts": {
"build": "tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && tsc -p entry-asar/esm/tsconfig.json && tsc -p entry-asar/cjs/tsconfig.json", "build": "tsc -p tsconfig.json && tsc -p entry-asar/esm/tsconfig.json && tsc -p entry-asar/cjs/tsconfig.json",
"build:docs": "npx typedoc", "build:docs": "npx typedoc",
"lint": "prettier --check \"{src,entry-asar,test}/**/*.ts\" \"*.ts\"", "lint": "prettier --check \"{src,entry-asar,test}/**/*.ts\" \"*.ts\"",
"prettier:write": "prettier --write \"{src,entry-asar,test}/**/*.ts\" \"*.ts\"", "prettier:write": "prettier --write \"{src,entry-asar,test}/**/*.ts\" \"*.ts\"",

View File

@@ -266,13 +266,13 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
// This needs to be a different file depending on if the app entrypoint is CommonJS or ESM. // This needs to be a different file depending on if the app entrypoint is CommonJS or ESM.
if (pj.type === 'module' || pj.main.endsWith('.mjs')) { if (pj.type === 'module' || pj.main.endsWith('.mjs')) {
await fs.promises.cp( await fs.promises.cp(
path.resolve(import.meta.dirname, '..', '..', 'entry-asar', 'esm', 'no-asar.mjs'), path.resolve(import.meta.dirname, '..', 'entry-asar', 'esm', 'no-asar.mjs'),
path.resolve(entryAsar, 'index.mjs'), path.resolve(entryAsar, 'index.mjs'),
); );
pj.main = 'index.mjs'; pj.main = 'index.mjs';
} else { } else {
await fs.promises.cp( await fs.promises.cp(
path.resolve(import.meta.dirname, '..', '..', 'entry-asar', 'cjs', 'no-asar.js'), path.resolve(import.meta.dirname, '..', 'entry-asar', 'cjs', 'no-asar.js'),
path.resolve(entryAsar, 'index.js'), path.resolve(entryAsar, 'index.js'),
); );
pj.main = 'index.js'; pj.main = 'index.js';
@@ -363,13 +363,13 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
// This needs to be a different file depending on if the app entrypoint is CommonJS or ESM. // This needs to be a different file depending on if the app entrypoint is CommonJS or ESM.
if (pj.type === 'module' || pj.main.endsWith('.mjs')) { if (pj.type === 'module' || pj.main.endsWith('.mjs')) {
await fs.promises.cp( await fs.promises.cp(
path.resolve(import.meta.dirname, '..', '..', 'entry-asar', 'esm', 'has-asar.mjs'), path.resolve(import.meta.dirname, '..', 'entry-asar', 'esm', 'has-asar.mjs'),
path.resolve(entryAsar, 'index.mjs'), path.resolve(entryAsar, 'index.mjs'),
); );
pj.main = 'index.mjs'; pj.main = 'index.mjs';
} else { } else {
await fs.promises.cp( await fs.promises.cp(
path.resolve(import.meta.dirname, '..', '..', 'entry-asar', 'cjs', 'has-asar.js'), path.resolve(import.meta.dirname, '..', 'entry-asar', 'cjs', 'has-asar.js'),
path.resolve(entryAsar, 'index.js'), path.resolve(entryAsar, 'index.js'),
); );
pj.main = 'index.js'; pj.main = 'index.js';