Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PabloSzx/bob-esbuild
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bob-tsm@0.4.5
Choose a base ref
...
head repository: PabloSzx/bob-esbuild
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bob-tsm@0.4.6
Choose a head ref
  • 5 commits
  • 16 files changed
  • 4 contributors

Commits on Jan 23, 2022

  1. update

    PabloSzx committed Jan 23, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    renovate-bot Mend Renovate
    Copy the full SHA
    a4a5096 View commit details
  2. --keep-esm-loader option

    PabloSzx committed Jan 23, 2022
    Copy the full SHA
    b349c7e View commit details
  3. remove semver lib dependency

    PabloSzx committed Jan 23, 2022
    Copy the full SHA
    553848a View commit details
  4. Copy the full SHA
    a2b3c92 View commit details
  5. Version Packages (#252)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Jan 23, 2022
    Copy the full SHA
    98bfe97 View commit details
2 changes: 1 addition & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@
"bob-esbuild": "workspace:^3.2.3",
"bob-esbuild-cli": "workspace:^3.0.1",
"bob-ts": "workspace:^3.0.1",
"bob-tsm": "workspace:^0.4.5",
"bob-tsm": "workspace:^0.4.6",
"shared": "workspace:^1.0.0"
},
"publishConfig": {
6 changes: 3 additions & 3 deletions examples/nextjs-custom-server/package.json
Original file line number Diff line number Diff line change
@@ -9,16 +9,16 @@
"start": "cross-env NODE_ENV=production bob-tsm src/server.ts"
},
"dependencies": {
"bob-tsm": "workspace:^0.4.5",
"bob-tsm": "workspace:^0.4.6",
"next": "^12.0.8",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@types/node": "^17.0.7",
"@types/node": "^17.0.10",
"@types/react": "^17.0.38",
"cross-env": "^7.0.3",
"typescript": "^4.5.4"
"typescript": "^4.5.5"
},
"dependenciesMeta": {
"bob-tsm": {
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -27,18 +27,25 @@
"@changesets/config": "^1.6.3",
"@changesets/read": "^0.5.2",
"@manypkg/get-packages": "^1.1.3",
"@types/node": "^17.0.7",
"@types/node": "^17.0.10",
"changesets-github-release": "^0.0.4",
"esbuild": "^0.14.11",
"esbuild": "^0.14.13",
"husky": "^7.0.4",
"prettier": "^2.5.1",
"pretty-quick": "^3.1.3",
"rimraf": "^3.0.2",
"semver": "^7.3.5",
"tsm": "^2.2.1",
"typescript": "^4.5.4"
"typescript": "^4.5.5"
},
"engines": {
"pnpm": ">=6.7.1"
},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"@babel/core"
]
}
}
}
4 changes: 2 additions & 2 deletions packages/bob-cli/package.json
Original file line number Diff line number Diff line change
@@ -39,9 +39,9 @@
"commander": "^8.3.0"
},
"devDependencies": {
"bob-esbuild": "workspace:^3.2.1",
"bob-esbuild": "workspace:^3.2.3",
"changesets-github-release": "^0.0.4",
"typescript": "^4.5.4"
"typescript": "^4.5.5"
},
"engines": {
"node": ">=12.0.0"
12 changes: 6 additions & 6 deletions packages/bob-ts/package.json
Original file line number Diff line number Diff line change
@@ -37,26 +37,26 @@
},
"dependencies": {
"bob-esbuild-plugin": "workspace:^3.1.3",
"rollup": "^2.64.0"
"rollup": "^2.66.0"
},
"devDependencies": {
"@rollup/plugin-json": "^4.1.0",
"@types/node": "^17.0.7",
"@types/node": "^17.0.10",
"bob-esbuild-cli": "workspace:^3.0.1",
"changesets-github-release": "^0.0.4",
"commander": "^8.3.0",
"esbuild": "^0.14.11",
"esbuild": "^0.14.13",
"execa": "^6.0.0",
"globby": "^12.1.0",
"globby": "^12.2.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-node-externals": "^3.1.2",
"rollup-plugin-tsconfig-paths": "^1.1.6",
"tree-kill": "^1.2.2",
"typescript": "^4.5.4"
"typescript": "^4.5.5"
},
"peerDependencies": {
"@types/node": "*",
"esbuild": ">=0.14.11",
"esbuild": ">=0.14.13",
"typescript": "*"
},
"engines": {
6 changes: 6 additions & 0 deletions packages/bob-tsm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# bob-tsm

## 0.4.6

### Patch Changes

- b349c7e: Add "--keep-esm-loader" option, it enables to keep the ESM Loader for forks (It can break certain environments like Next.js custom server)

## 0.4.5

### Patch Changes
2 changes: 1 addition & 1 deletion packages/bob-tsm/build.ts
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ async function main() {
outDir: 'lib',
target: 'node12.20',
sourcemap: false,
external: ['./deps/semver.js', './deps/typescriptPaths.js'],
external: ['./deps/typescriptPaths.js'],
esbuild: {
minify: false,
},
11 changes: 5 additions & 6 deletions packages/bob-tsm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bob-tsm",
"version": "0.4.5",
"version": "0.4.6",
"homepage": "https://github.com/PabloSzx/bob-esbuild",
"bugs": "https://github.com/PabloSzx/bob-esbuild/issues",
"repository": {
@@ -43,17 +43,16 @@
"@types/semver": "^7.3.9",
"bob-esbuild-plugin": "workspace:^3.1.3",
"c8": "^7.11.0",
"chokidar": "^3.5.2",
"chokidar": "^3.5.3",
"commander": "^8.3.0",
"esbuild": "^0.14.11",
"esbuild": "^0.14.13",
"execa": "^6.0.0",
"semver": "^7.3.5",
"tree-kill": "^1.2.2",
"typescript": "^4.5.4",
"typescript": "^4.5.5",
"typescript-paths": "^1.3.1"
},
"peerDependencies": {
"esbuild": ">=0.14.11",
"esbuild": ">=0.14.13",
"typescript": ">=4.1.2"
},
"peerDependenciesMeta": {
10 changes: 9 additions & 1 deletion packages/bob-tsm/src/bin.ts
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ program
.option('--tsmconfig <config>', 'Configuration file path', 'tsm.js')
.option('--watch <patterns...>', 'Enable & specify watch mode')
.option('--ignore <patterns...>', 'Ignore watch patterns')
.option('--keep-esm-loader', 'Keep ESM Loader for forks (It can break certain environments like Next.js custom server)')
.addOption(
new Option(
'--node-env,--node_env <NODE_ENV>',
@@ -44,9 +45,10 @@ program
node_env: 'production' | 'prod' | 'development' | 'dev' | 'test';
quiet?: boolean;
paths?: boolean;
keepEsmLoader?: boolean;
}>();

const { watch, ignore, cjs, node_env, quiet, tsmconfig, paths } = options;
const { watch, ignore, cjs, node_env, quiet, tsmconfig, paths, keepEsmLoader } = options;

const binDirname = dirname(fileURLToPath(import.meta.url));

@@ -89,6 +91,12 @@ program
});
}

if (keepEsmLoader) {
Object.assign((spawnEnv ||= { ...process.env }), {
KEEP_LOADER_ARGV: '1',
});
}

const spawnOptions: SpawnOptions = {
stdio: 'inherit',
env: spawnEnv,
1 change: 0 additions & 1 deletion packages/bob-tsm/src/deps/semver.ts

This file was deleted.

9 changes: 4 additions & 5 deletions packages/bob-tsm/src/loader.ts
Original file line number Diff line number Diff line change
@@ -4,22 +4,21 @@ import { promises } from 'fs';
import { dirname, extname } from 'path';
import { fileURLToPath, pathToFileURL, URL } from 'url';
import type { Config, Extension, Options } from './config';
import semverGtePkg from './deps/semver.js';
import { defaults, fileExists, finalize, getDefault } from './utils';
import { defaults, fileExists, finalize, getNodeVersion } from './utils';

if (!process.env.KEEP_LOADER_ARGV) {
const loaderArgIndex = process.execArgv.findIndex(v => v.startsWith('--loader'));

if (loaderArgIndex !== -1) process.execArgv.splice(loaderArgIndex, 1);
}

const semverGte = getDefault(semverGtePkg);

export const tsconfigPathsHandler = process.env.TSCONFIG_PATHS
? import('./deps/typescriptPaths.js').then(({ createHandler }) => createHandler())
: undefined;

const HAS_UPDATED_HOOKS = semverGte(process.versions.node, '16.12.0');
const { major, minor } = getNodeVersion();

const HAS_UPDATED_HOOKS = major > 16 || (major === 16 && minor >= 12);

let config: Config;
let esbuild: typeof import('esbuild');
13 changes: 13 additions & 0 deletions packages/bob-tsm/src/utils.ts
Original file line number Diff line number Diff line change
@@ -123,3 +123,16 @@ export function debouncePromise<T extends unknown[]>(
export function getDefault<T>(module: T & { default?: T }): T {
return module.default || module;
}

export function getNodeVersion() {
const [major, minor, patch] = process.version
.slice(1)
.split('.')
.map(v => parseInt(v, 10)) as [major: number, minor: number, patch: number];

return {
major,
minor,
patch,
};
}
6 changes: 3 additions & 3 deletions packages/bob-watch/package.json
Original file line number Diff line number Diff line change
@@ -39,10 +39,10 @@
"postpublish": "gh-release"
},
"devDependencies": {
"bob-esbuild": "workspace:^3.2.1",
"bob-esbuild": "workspace:^3.2.3",
"bob-esbuild-cli": "workspace:^3.0.1",
"bob-tsm": "workspace:^0.4.0",
"chokidar": "^3.5.2",
"bob-tsm": "workspace:^0.4.5",
"chokidar": "^3.5.3",
"commander": "^8.3.0",
"execa": "^6.0.0",
"tree-kill": "^1.2.2"
12 changes: 6 additions & 6 deletions packages/bob/package.json
Original file line number Diff line number Diff line change
@@ -33,36 +33,36 @@
"dependencies": {
"@pnpm/types": "^7.9.0",
"bob-esbuild-plugin": "workspace:3.1.3",
"rollup": "^2.64.0"
"rollup": "^2.66.0"
},
"devDependencies": {
"@pnpm/exportable-manifest": "^2.2.4",
"@rollup/plugin-json": "^4.1.0",
"@types/folder-hash": "^4.0.1",
"@types/fs-extra": "^9.0.13",
"@types/lodash.get": "^4.4.6",
"@types/node": "^17.0.7",
"@types/node": "^17.0.10",
"builtin-modules": "^3.2.0",
"chalk": "^5.0.0",
"changesets-github-release": "^0.0.4",
"cosmiconfig": "^7.0.1",
"date-fns": "^2.28.0",
"esbuild": "^0.14.11",
"esbuild": "^0.14.13",
"execa": "^6.0.0",
"fast-glob": "^3.2.11",
"folder-hash": "^4.0.1",
"fs-extra": "^10.0.0",
"globby": "^12.1.0",
"globby": "^12.2.0",
"lodash.get": "^4.4.2",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-node-externals": "^3.1.2",
"rollup-plugin-tsconfig-paths": "^1.1.6",
"tree-kill": "^1.2.2",
"tsconfck": "^1.1.1",
"typescript": "^4.5.4"
"typescript": "^4.5.5"
},
"peerDependencies": {
"esbuild": ">=0.14.11",
"esbuild": ">=0.14.13",
"typescript": "*"
},
"publishConfig": {
6 changes: 3 additions & 3 deletions packages/esbuild-plugin/package.json
Original file line number Diff line number Diff line change
@@ -33,13 +33,13 @@
},
"devDependencies": {
"changesets-github-release": "^0.0.4",
"esbuild": "^0.14.11",
"rollup": "^2.64.0",
"esbuild": "^0.14.13",
"rollup": "^2.66.0",
"tsconfck": "^1.1.1",
"tsup": "^5.11.11"
},
"peerDependencies": {
"esbuild": ">=0.14.11",
"esbuild": ">=0.14.13",
"rollup": "*"
},
"publishConfig": {
Loading