forked from wooorm/import-meta-resolve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bundle as commonjs and release as dual
- Loading branch information
Showing
8 changed files
with
126 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/config/schema.json", | ||
"commit": false, | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "fork-release", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Rebase | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
rebase: | ||
name: Rebase and Push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: fork-release | ||
|
||
- name: Set Git Info | ||
run: | | ||
git config --global user.email [email protected] | ||
git config --global user.name JounQin | ||
git remote add upstream https://github.com/wooorm/import-meta-resolve.git | ||
- name: Rebase and Push | ||
run: | | ||
git fetch upstream main:main | ||
git rebase upstream/main | ||
git push -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- fork-release | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js LTS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Publish to npm | ||
uses: changesets/action@v1 | ||
with: | ||
publish: npx @changesets/cli publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Sync to cnpm | ||
run: npx cnpm sync @dual-bundle/import-meta-resolve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ coverage/ | |
/node_modules | ||
test/baseline*.js | ||
yarn.lock | ||
/index.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,50 @@ | ||
{ | ||
"name": "import-meta-resolve", | ||
"name": "@dual-bundle/import-meta-resolve", | ||
"version": "4.0.0", | ||
"description": "Resolve things like Node.js — ponyfill for `import.meta.resolve`", | ||
"description": "A fork of `import-meta-resolve` with commonjs + ESM support at the same time, AKA dual package.", | ||
"license": "MIT", | ||
"keywords": [ | ||
"resolve", | ||
"node", | ||
"esm", | ||
"module" | ||
"module", | ||
"import", | ||
"import-meta-resolve" | ||
], | ||
"repository": "wooorm/import-meta-resolve", | ||
"repository": "un-es/import-meta-resolve", | ||
"bugs": "https://github.com/wooorm/import-meta-resolve/issues", | ||
"funding": { | ||
"type": "github", | ||
"url": "https://github.com/sponsors/wooorm" | ||
}, | ||
"author": "Titus Wormer <[email protected]> (https://wooorm.com)", | ||
"maintainers": [ | ||
"JounQin <[email protected]> (https://www.1stG.me)" | ||
], | ||
"contributors": [ | ||
"Titus Wormer <[email protected]> (https://wooorm.com)" | ||
], | ||
"sideEffects": false, | ||
"type": "module", | ||
"main": "index.js", | ||
"main": "index.cjs", | ||
"module": "index.js", | ||
"types": "index.d.ts", | ||
"exports": { | ||
"types": "./index.d.ts", | ||
"require": "./index.cjs", | ||
"default": "./index.js" | ||
}, | ||
"files": [ | ||
"lib/", | ||
"index.d.ts", | ||
"index.cjs", | ||
"index.js" | ||
], | ||
"devDependencies": { | ||
"@types/node": "^20.0.0", | ||
"@types/semver": "^7.0.0", | ||
"c8": "^8.0.0", | ||
"esbuild": "^0.20.1", | ||
"prettier": "^3.0.0", | ||
"remark-cli": "^11.0.0", | ||
"remark-preset-wooorm": "^9.0.0", | ||
|
@@ -43,7 +56,7 @@ | |
"scripts": { | ||
"prepack": "npm run generate && npm run build && npm run format", | ||
"generate": "node --conditions development script.js", | ||
"build": "tsc --build --clean && tsc --build && type-coverage", | ||
"build": "tsc --build --clean && tsc --build && type-coverage && esbuild --bundle --outfile=index.cjs --platform=node --format=cjs index.js", | ||
"format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", | ||
"test-api": "node --experimental-import-meta-resolve test/baseline.js && node --experimental-import-meta-resolve test/baseline-async.js && node test/index.js", | ||
"test-coverage": "c8 --check-coverage --branches 75 --functions 75 --lines 75 --statements 75 --reporter lcov npm run test-api", | ||
|
@@ -79,6 +92,10 @@ | |
[ | ||
"remark-lint-maximum-heading-length", | ||
false | ||
], | ||
[ | ||
"remark-lint-no-multiple-toplevel-headings", | ||
false | ||
] | ||
] | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters