Skip to content

Commit

Permalink
Update all
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloSzx committed Jan 2, 2024
1 parent 510d126 commit 2a0dc9f
Show file tree
Hide file tree
Showing 21 changed files with 1,504 additions and 1,298 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm pretty-quick --staged
pnpx lint-staged
6 changes: 3 additions & 3 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"shared": "workspace:^1.0.0"
},
"devDependencies": {
"@types/node": "^18.7.9",
"esbuild": "^0.17.18",
"typescript": "^5.0.4"
"@types/node": "^20.10.6",
"esbuild": "^0.19.11",
"typescript": "^5.3.3"
},
"publishConfig": {
"directory": "lib",
Expand Down
10 changes: 5 additions & 5 deletions examples/nextjs-custom-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
},
"dependencies": {
"bob-tsm": "workspace:^1.1.2",
"next": "^12.3.4",
"next": "^14.0.4",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^18.7.9",
"@types/react": "^18.0.17",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"cross-env": "^7.0.3",
"esbuild": "^0.17.18",
"typescript": "^5.0.4"
"esbuild": "^0.19.11",
"typescript": "^5.3.3"
},
"dependenciesMeta": {
"bob-tsm": {
Expand Down
4 changes: 2 additions & 2 deletions examples/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"bob-esbuild-cli": "workspace:^4.0.0"
},
"devDependencies": {
"esbuild": "^0.17.18",
"typescript": "^5.0.4"
"esbuild": "^0.19.11",
"typescript": "^5.3.3"
},
"dependenciesMeta": {
"bob-esbuild-cli": {
Expand Down
31 changes: 17 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@
"types": "pnpm --filter bob-esbuild build:types"
},
"devDependencies": {
"@changesets/apply-release-plan": "^6.0.4",
"@changesets/assemble-release-plan": "^5.2.1",
"@changesets/cli": "^2.24.3",
"@changesets/config": "^2.1.1",
"@changesets/read": "^0.5.7",
"@manypkg/get-packages": "^1.1.3",
"@types/node": "^18.7.9",
"@changesets/apply-release-plan": "^7.0.0",
"@changesets/assemble-release-plan": "^6.0.0",
"@changesets/cli": "^2.27.1",
"@changesets/config": "^3.0.0",
"@changesets/read": "^0.6.0",
"@manypkg/get-packages": "^2.2.0",
"@types/node": "^20.10.6",
"changesets-github-release": "^0.1.0",
"esbuild": "^0.17.18",
"husky": "^8.0.1",
"prettier": "^2.7.1",
"esbuild": "^0.19.11",
"husky": "^8.0.3",
"prettier": "^3.1.1",
"pretty-quick": "^3.1.3",
"rimraf": "^3.0.2",
"semver": "^7.3.7",
"tsm": "^2.2.2",
"typescript": "^5.0.4"
"rimraf": "^5.0.5",
"semver": "^7.5.4",
"tsx": "^4.7.0",
"typescript": "^5.3.3"
},
"engines": {
"pnpm": ">=8.4.0"
Expand All @@ -50,5 +50,8 @@
"overrides": {
"ramda": "0.27.2"
}
},
"lint-staged": {
"*.{js,css,md}": "prettier --write"
}
}
6 changes: 3 additions & 3 deletions packages/bob-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
],
"scripts": {
"dev": "node bin/run.mjs watch",
"prepare": "node -r tsm self-build.ts",
"prepare": "bun self-build.ts",
"postpublish": "gh-release"
},
"dependencies": {
"commander": "^9.4.0"
"commander": "^11.1.0"
},
"devDependencies": {
"bob-esbuild": "workspace:^4.0.3",
"changesets-github-release": "^0.1.0",
"typescript": "^5.0.4"
"typescript": "^5.3.3"
},
"peerDependencies": {
"bob-esbuild": "workspace:^4.0.0"
Expand Down
20 changes: 10 additions & 10 deletions packages/bob-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@
"/lib"
],
"scripts": {
"prepare": "node -r tsm self-build.ts",
"prepare": "bun self-build.ts",
"postpublish": "gh-release"
},
"dependencies": {
"bob-esbuild-plugin": "workspace:^4.0.0",
"rollup": "^2.78.1"
"rollup": "^4.9.2"
},
"devDependencies": {
"@rollup/plugin-json": "^4.1.0",
"@types/node": "^18.7.9",
"@rollup/plugin-json": "^6.1.0",
"@types/node": "^20.10.6",
"bob-esbuild-cli": "workspace:^4.0.0",
"changesets-github-release": "^0.1.0",
"commander": "^9.4.0",
"esbuild": "^0.17.18",
"commander": "^11.1.0",
"esbuild": "^0.19.11",
"execa": "^6.1.0",
"globby": "^13.1.2",
"globby": "^14.0.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-node-externals": "^4.1.1",
"rollup-plugin-tsconfig-paths": "^1.3.0",
"rollup-plugin-node-externals": "^6.1.2",
"rollup-plugin-tsconfig-paths": "^1.5.2",
"tree-kill": "^1.2.2",
"typescript": "^5.0.4"
"typescript": "^5.3.3"
},
"peerDependencies": {
"@types/node": "*",
Expand Down
7 changes: 3 additions & 4 deletions packages/bob-ts/src/rollupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ export const getRollupConfig = async ({
)
).filter(file => !!file.match(/\.(js|cjs|mjs|ts|tsx|cts|mts|ctsx|mtsx)$/));

const customPluginsAwaited = (await customPlugins) || [];

const plugins: InputOptions['plugins'] = [
...(customPlugins || []),
...Array.from(Array.isArray(customPluginsAwaited) ? customPluginsAwaited : [customPluginsAwaited]),
externals({
packagePath: resolve(process.cwd(), 'package.json'),
deps: true,
Expand Down Expand Up @@ -348,7 +350,6 @@ export const getRollupConfig = async ({
preserveModules: true,
exports: 'auto',
sourcemap,
preferConst: true,
...rollup,
},
{
Expand All @@ -358,7 +359,6 @@ export const getRollupConfig = async ({
preserveModules: true,
exports: 'auto',
sourcemap,
preferConst: true,
...rollup,
},
]
Expand All @@ -370,7 +370,6 @@ export const getRollupConfig = async ({
preserveModules: true,
exports: 'auto',
sourcemap,
preferConst: true,
...rollup,
},
];
Expand Down
18 changes: 9 additions & 9 deletions packages/bob-tsm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@
"scripts": {
"dev": "node ../bob-watch/bin/bob-watch.mjs --watch=src -c \"pnpm i\"",
"playground": "node ../bob-watch/bin/bob-watch.mjs --watch src playground -c \"pnpm prepare && node bin/bob-tsm.mjs playground/index.ts\"",
"prepare": "node -r tsm build.ts",
"prepare": "bun build.ts",
"postpublish": "gh-release",
"test": "node -r tsm build.ts && c8 node -r tsm ./test/test.cjs"
"test": "bun build.ts && c8 bun ./test/test.cjs"
},
"devDependencies": {
"@types/semver": "^7.3.12",
"@types/semver": "^7.5.6",
"bob-esbuild-plugin": "workspace:^4.0.0",
"c8": "^7.12.0",
"c8": "^8.0.1",
"chokidar": "^3.5.3",
"commander": "^9.4.0",
"esbuild": "^0.17.18",
"commander": "^11.1.0",
"esbuild": "^0.19.11",
"execa": "^6.1.0",
"tree-kill": "^1.2.2",
"typescript": "^5.0.4",
"typescript-paths": "^1.4.0"
"typescript": "^5.3.3",
"typescript-paths": "^1.5.1"
},
"peerDependencies": {
"esbuild": ">=0.14.39",
Expand All @@ -61,7 +61,7 @@
}
},
"optionalDependencies": {
"fsevents": "~2.3.2"
"fsevents": "~2.3.3"
},
"engines": {
"node": ">=14.13.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/bob-watch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
"bob-esbuild-cli": "workspace:^4.0.0",
"bob-tsm": "workspace:^1.1.0",
"chokidar": "^3.5.3",
"commander": "^9.4.0",
"commander": "^11.1.0",
"execa": "^6.1.0",
"tree-kill": "^1.2.2"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
"fsevents": "~2.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
44 changes: 22 additions & 22 deletions packages/bob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,41 @@
"lib"
],
"scripts": {
"build:types": "node -r tsm build-types.ts",
"dev": "node -r tsm self-watch.ts",
"prepare": "node -r tsm self-build.ts",
"build:types": "bun build-types.ts",
"dev": "bun self-watch.ts",
"prepare": "bun self-build.ts",
"postpublish": "gh-release"
},
"dependencies": {
"@pnpm/types": "^8.5.0",
"@pnpm/types": "^9.4.2",
"bob-esbuild-plugin": "workspace:4.0.0",
"rollup": "^2.78.1"
"rollup": "^4.9.2"
},
"devDependencies": {
"@pnpm/exportable-manifest": "^3.1.2",
"@rollup/plugin-json": "^4.1.0",
"@types/folder-hash": "^4.0.2",
"@types/fs-extra": "^9.0.13",
"@types/lodash.get": "^4.4.7",
"@types/node": "^18.7.9",
"@pnpm/exportable-manifest": "^5.0.11",
"@rollup/plugin-json": "^6.1.0",
"@types/folder-hash": "^4.0.4",
"@types/fs-extra": "^11.0.4",
"@types/lodash.get": "^4.4.9",
"@types/node": "^20.10.6",
"builtin-modules": "^3.3.0",
"chalk": "^5.0.1",
"chalk": "^5.3.0",
"changesets-github-release": "^0.1.0",
"cosmiconfig": "^7.0.1",
"date-fns": "^2.29.2",
"esbuild": "^0.17.18",
"date-fns": "^3.0.6",
"esbuild": "^0.19.11",
"execa": "^6.1.0",
"fast-glob": "^3.2.11",
"folder-hash": "^4.0.2",
"fs-extra": "^10.1.0",
"globby": "^13.1.2",
"fast-glob": "^3.3.2",
"folder-hash": "^4.0.4",
"fs-extra": "^11.2.0",
"globby": "^14.0.0",
"lodash.get": "^4.4.2",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-node-externals": "^4.1.1",
"rollup-plugin-tsconfig-paths": "^1.3.0",
"rollup-plugin-node-externals": "^6.1.2",
"rollup-plugin-tsconfig-paths": "^1.5.2",
"tree-kill": "^1.2.2",
"tsconfck": "^2.0.1",
"typescript": "^5.0.4"
"tsconfck": "^3.0.0",
"typescript": "^5.3.3"
},
"peerDependencies": {
"esbuild": ">=0.14.39",
Expand Down
2 changes: 1 addition & 1 deletion packages/bob/src/config/packageBuildConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface PackageBuildConfig {
}

export async function GetPackageBuildConfig(cwd: string = process.cwd()): Promise<PackageBuildConfig> {
const pkg: PackageJSON = await readJSON(resolve(cwd, 'package.json'));
const pkg: PackageJSON = (await readJSON(resolve(cwd, 'package.json'))) as PackageJSON;

if (!pkg.name) throw Error('Invalid "name" field for package.json in ' + cwd);

Expand Down
4 changes: 2 additions & 2 deletions packages/bob/src/config/packageJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { rewriteExports } from './rewrite-exports';
import type { ProjectManifest } from '@pnpm/types';
import type { PackageBuildConfig } from './packageBuildConfig';

export interface PackageJSON extends ProjectManifest, Record<string, unknown> {
export interface PackageJSON extends Omit<ProjectManifest, 'exports'>, Record<string, unknown> {
files?: string[];
type?: string;
exports?: Record<string, string | { require?: string; import?: string }>;
Expand Down Expand Up @@ -142,7 +142,7 @@ export async function writePackageJson({
const distDirPath = resolve(cwd, distDir);
await ensureDir(distDirPath);

const pkg = (await makePublishManifest(cwd, rewritePackageJson(packageJson, distDir, cwd))) as PackageJSON;
const pkg = (await makePublishManifest(cwd, rewritePackageJson(packageJson, distDir, cwd) as ProjectManifest)) as PackageJSON;

await writeJSON(resolve(distDirPath, 'package.json'), rewritePackage ? await rewritePackage(pkg) : pkg, {
spaces: 2,
Expand Down
2 changes: 0 additions & 2 deletions packages/bob/src/config/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ export async function getRollupConfig(optionsArg: ConfigOptions = {}) {
preserveModules: true,
exports: 'auto',
sourcemap: false,
preferConst: true,
...cleanObject(options.outputOptions),
...cleanObject(globalOptions.outputOptions),
};
Expand All @@ -256,7 +255,6 @@ export async function getRollupConfig(optionsArg: ConfigOptions = {}) {
entryFileNames: typeModule ? '[name].js' : '[name].mjs',
preserveModules: true,
sourcemap: false,
preferConst: true,
...cleanObject(options.outputOptions),
...cleanObject(globalOptions.outputOptions),
};
Expand Down
9 changes: 4 additions & 5 deletions packages/bob/src/config/rollupBin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,15 @@ export const rollupBin = (buildConfig: PackageBuildConfig, cwd: string = process
const binOutputFile = resolve(cwd, distDir, pkgBin);
await bundle.write({
banner: `#!/usr/bin/env node`,
preferConst: true,
sourcemap: false,
file: binOutputFile,
format: binOutputFile.endsWith('.mjs')
? 'es'
: binOutputFile.endsWith('.cjs')
? 'cjs'
: buildConfig.pkg.type === 'module'
? 'es'
: 'cjs',
? 'cjs'
: buildConfig.pkg.type === 'module'
? 'es'
: 'cjs',
});

debug(`Bin ${alias} built in ${binOutputFile}`);
Expand Down
Loading

0 comments on commit 2a0dc9f

Please sign in to comment.