Skip to content

Commit

Permalink
test: setup test workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 12, 2024
1 parent 6486547 commit 91fac39
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 13 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:

jobs:
build:
test:
runs-on: ubuntu-latest

steps:
Expand All @@ -16,3 +16,12 @@ jobs:
run: yarn
- name: Build
run: yarn build
- name: Examples
run: |-
cd examples
yarn
yarn workspace @dunble-examples/cross-platform build
yarn workspace @dunble-examples/node-classic build
yarn workspace @dunble-examples/node-hybrid build
yarn workspace @dunble-examples/node-next build
yarn workspace @dunble-examples/wildcard build
2 changes: 1 addition & 1 deletion examples/cross-platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"build": "tsc -b && dunble"
},
"devDependencies": {
"dunble": "^0.1.0",
"dunble": "^0.1.2",
"esbuild": "^0.19.0",
"typescript": "^5.3.2"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/node-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "tsc -b && dunble"
},
"devDependencies": {
"dunble": "^0.1.0",
"dunble": "^0.1.2",
"esbuild": "^0.19.0",
"typescript": "^5.3.2"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/node-hybrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"build": "tsc -b && dunble"
},
"devDependencies": {
"dunble": "^0.1.0",
"dunble": "^0.1.2",
"esbuild": "^0.19.0",
"typescript": "^5.3.2"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/node-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "tsc -b && dunble"
},
"devDependencies": {
"dunble": "^0.1.0",
"dunble": "^0.1.2",
"esbuild": "^0.19.0",
"typescript": "^5.3.2"
}
Expand Down
11 changes: 11 additions & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@dunble-examples/workspace",
"version": "1.0.0",
"private": true,
"workspaces": [
"packages/*"
],
"resolutions": {
"dunble": "portal:.."
}
}
2 changes: 1 addition & 1 deletion examples/wildcard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "tsc -b && dunble"
},
"devDependencies": {
"dunble": "^0.1.0",
"dunble": "^0.1.2",
"esbuild": "^0.19.0",
"typescript": "^5.3.2"
}
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
{
"name": "dunble",
"description": "Zero-configuration bundler with TypeScript and esbuild",
"version": "0.1.0",
"version": "0.1.2",
"type": "module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"bin": "lib/bin.js",
"files": [
"lib",
"src"
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/shigma/dunble.git"
"url": "git+https://github.com/cordiverse/dunble.git"
},
"bugs": {
"url": "https://github.com/shigma/dunble/issues"
"url": "https://github.com/cordiverse/dunble/issues"
},
"homepage": "https://github.com/shigma/dunble",
"homepage": "https://github.com/cordiverse/dunble",
"author": "Shigma <[email protected]>",
"license": "MIT",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { dirname, extname, isAbsolute, join, relative, resolve } from 'node:path'
import { isBuiltin } from 'node:module'
import { TsConfig } from 'tsconfig-utils'
import { build, BuildFailure, BuildOptions, Message, Platform, Plugin } from 'esbuild'
import * as fs from 'node:fs/promises'
Expand Down Expand Up @@ -69,7 +70,7 @@ const externalPlugin = ({ cwd, manifest, exports }: dunble.Data): Plugin => ({

build.onResolve({ filter: /^[@\w].+$/ }, (args) => {
if (isAbsolute(args.path)) return null
if (args.path.includes(':')) return { external: true }
if (isBuiltin(args.path)) return { external: true }
const name = args.path.startsWith('@')
? args.path.split('/', 2).join('/')
: args.path.split('/', 1)[0]
Expand Down

0 comments on commit 91fac39

Please sign in to comment.