Skip to content

Commit 64c3deb

Browse files
authored
Merge branch 'develop' into pre-req-workspace
2 parents 10a4fbc + a15e649 commit 64c3deb

15 files changed

Lines changed: 135 additions & 128 deletions

File tree

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
runtime = electron
2-
target = 28.0.0
2+
target = 29.0.0
33
disturl = https://electronjs.org/headers
44
playwright_skip_browser_download=true
55
engine-strict=true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.18.2
1+
20.9.0

package-lock.json

Lines changed: 80 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
},
1212
"homepage": "https://github.com/kong/insomnia#readme",
1313
"engines": {
14-
"node": ">=18.18.2 <20",
15-
"npm": ">=8.19.0"
14+
"node": ">=20.9 <22",
15+
"npm": ">=10"
1616
},
1717
"workspaces": [
1818
"packages/openapi-2-kong",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dist
22
bin
33
coverage
4+
verify-pkg.js

packages/insomnia-inso/esbuild.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { build, type BuildOptions, context } from 'esbuild';
2-
import { nodeExternalsPlugin } from 'esbuild-node-externals';
32

43
const isProd = Boolean(process.env.NODE_ENV === 'production');
54
const watch = Boolean(process.env.ESBUILD_WATCH);
@@ -9,20 +8,34 @@ const config: BuildOptions = {
98
bundle: true,
109
platform: 'node',
1110
minify: isProd,
12-
target: 'node18',
11+
target: 'node20',
1312
sourcemap: true,
1413
format: 'cjs',
1514
tsconfig: 'tsconfig.json',
1615
plugins: [
17-
// Exclude node_modules from the bundle since they will be packaged with the cli
18-
nodeExternalsPlugin(),
16+
// taken from https://github.com/tjx666/awesome-vscode-extension-boilerplate/blob/main/scripts/esbuild.ts
17+
{
18+
name: 'umd2esm',
19+
setup(build) {
20+
build.onResolve({ filter: /^(vscode-.*|estree-walker|jsonc-parser)/ }, args => {
21+
const pathUmdMay = require.resolve(args.path, {
22+
paths: [args.resolveDir],
23+
});
24+
// Call twice the replace is to solve the problem of the path in Windows
25+
const pathEsm = pathUmdMay
26+
.replace('/umd/', '/esm/')
27+
.replace('\\umd\\', '\\esm\\');
28+
return { path: pathEsm };
29+
});
30+
},
31+
},
1932
],
2033
define: {
2134
'process.env.DEFAULT_APP_NAME': JSON.stringify(isProd ? 'Insomnia' : 'insomnia-app'),
2235
'process.env.VERSION': JSON.stringify(isProd ? version : 'dev'),
2336
'__DEV__': JSON.stringify(!isProd),
2437
},
25-
external: ['@getinsomnia/node-libcurl', 'mocha'],
38+
external: ['@getinsomnia/node-libcurl', 'insomnia-send-request', 'fsevents', 'mocha'],
2639
entryPoints: ['./src/index.ts'],
2740
};
2841

packages/insomnia-inso/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
"build": "esr esbuild.ts",
3030
"build:production": "cross-env NODE_ENV=production esr esbuild.ts",
3131
"start": "ESBUILD_WATCH=true esr esbuild.ts",
32-
"prepackage": "npm run build:production",
33-
"package": "npx -y pkg@5.8.1 . --output binaries/inso --targets host",
34-
"postpackage": "esr src/scripts/verify-pkg.ts",
32+
"prepackage": "npm run build:production && rm -rf binaries/inso",
33+
"package": "npx -y @yao-pkg/pkg@5.11.5 . --output binaries/inso --targets host",
34+
"postpackage": "node src/scripts/verify-pkg.js",
3535
"artifacts": "esr src/scripts/artifacts.ts"
3636
},
3737
"devDependencies": {
@@ -41,7 +41,6 @@
4141
"concurrently": "^8.2.2",
4242
"cross-env": "^7.0.3",
4343
"esbuild": "^0.20.2",
44-
"esbuild-node-externals": "^1.13.0",
4544
"esbuild-runner": "^2.2.2",
4645
"execa": "^5.0.0",
4746
"jest": "^29.7.0",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// import { spawn } from 'child_process';
2+
// import { resolve } from 'path';
3+
const spawn = require('child_process').spawn;
4+
const resolve = require('path').resolve;
5+
const basePath = resolve('binaries/inso');
6+
const childProcess = spawn(basePath, ['--help']);
7+
childProcess.stdout.on('data', data => {
8+
console.log(`stdout: ${data}`);
9+
});
10+
childProcess.on('error', err => {
11+
console.error(`Error: ${err.message}`);
12+
});
13+
childProcess.on('exit', (code, signal) => {
14+
if (code !== 0) {
15+
console.error(`Child process exited with code ${code} and signal ${signal}`);
16+
} else {
17+
console.log('Child process finished successfully');
18+
}
19+
});

0 commit comments

Comments
 (0)