-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support cjs and esm both by tshy (#279)
BREAKING CHANGE: drop Node.js < 18.19.0 support part of eggjs/egg#3644 eggjs/egg#5257 use https://oclif.io <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Removed pull request template for contributors. - Introduced a new workflow for automating commit publishing. - Added scripts for executing Node.js applications in development mode. - Updated the README to reflect the new package name and other details. - Enhanced command classes for testing and development functionalities. - Added new utility functions for better path handling in tests. - Introduced new interface for package configuration. - Added support for TypeScript with updated configurations. - Implemented a new logging mechanism in hooks for better debugging. - Introduced a new class for managing server readiness in demo applications. - **Bug Fixes** - Adjusted import paths in tests for compatibility with new module structure. - **Documentation** - Updated README and various documentation links to reflect changes in package structure. - **Chores** - Updated package configurations, including versioning and dependencies. - Removed obsolete files and configurations from the project. - Enhanced test suite structure and clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
74 changed files
with
1,459 additions
and
1,222 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Publish Any Commit | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: npm run prepublishOnly --if-present | ||
|
||
- run: npx pkg-pr-new publish |
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
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,3 @@ | ||
@echo off | ||
|
||
node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %* |
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 @@ | ||
#!/usr/bin/env -S node --loader ts-node/esm --disable-warning=ExperimentalWarning --no-deprecation | ||
|
||
import { execute } from '@oclif/core'; | ||
|
||
await execute({ | ||
// development: true, | ||
dir: import.meta.url, | ||
}); |
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,3 @@ | ||
@echo off | ||
|
||
node "%~dp0\run" %* |
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,5 @@ | ||
#!/usr/bin/env node | ||
|
||
import { execute } from '@oclif/core'; | ||
|
||
await execute({ dir: import.meta.url }); |
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,86 +1,122 @@ | ||
{ | ||
"name": "egg-bin", | ||
"version": "6.13.0", | ||
"name": "@eggjs/bin", | ||
"version": "7.0.0-beta.4", | ||
"publishConfig": { | ||
"tag": "latest" | ||
"access": "public" | ||
}, | ||
"description": "egg developer tool", | ||
"files": [ | ||
"dist", | ||
"scripts" | ||
], | ||
"main": "dist/index.js", | ||
"bin": { | ||
"egg-bin": "dist/bin/cli.js" | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:eggjs/bin.git" | ||
}, | ||
"bug": { | ||
"url": "https://github.com/eggjs/egg/issues" | ||
}, | ||
"homepage": "https://github.com/eggjs/bin", | ||
"author": "fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)", | ||
"engines": { | ||
"node": ">= 18.19.0" | ||
}, | ||
"dependencies": { | ||
"@artus-cli/artus-cli": "^0.2.9", | ||
"@artus-cli/plugin-autocomplete": "^0.1.1", | ||
"@artus-cli/plugin-version": "^1.0.1", | ||
"@eggjs/utils": "^4.0.2", | ||
"@eggjs/utils": "^4.1.2", | ||
"@oclif/core": "^4.2.0", | ||
"@types/mocha": "^10.0.10", | ||
"@types/supertest": "^6.0.2", | ||
"c8": "^10.0.0", | ||
"detect-port": "^2.0.0", | ||
"egg-ts-helper": "^2.1.0", | ||
"globby": "^11.1.0", | ||
"jest-changed-files": "^29.4.2", | ||
"mocha": "^10.2.0", | ||
"mocha": "^11.0.1", | ||
"mochawesome-with-mocha": "^7.1.3", | ||
"runscript": "^2.0.0", | ||
"ts-node": "^10.9.2", | ||
"tsconfig-paths": "^4.1.2" | ||
"tsconfig-paths": "^4.1.2", | ||
"utility": "^2.4.0" | ||
}, | ||
"peerDependencies": { | ||
"egg-mock": ">=5.10.2" | ||
"@eggjs/mock": "beta" | ||
}, | ||
"peerDependenciesMeta": { | ||
"egg-mock": { | ||
"@eggjs/mock": { | ||
"optional": true | ||
} | ||
}, | ||
"devDependencies": { | ||
"@eggjs/tsconfig": "^1.3.0", | ||
"@arethetypeswrong/cli": "^0.17.1", | ||
"@eggjs/mock": "beta", | ||
"@eggjs/tsconfig": "1", | ||
"@swc-node/register": "^1.6.1", | ||
"@swc/core": "^1.3.35", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^22.10.1", | ||
"@types/node": "22", | ||
"assert-file": "^1.0.0", | ||
"coffee": "^5.4.0", | ||
"coffee": "^5.5.1", | ||
"cpy": "^8.1.2", | ||
"egg": "^3.9.1", | ||
"egg-mock": "^5.10.2", | ||
"cpy-cli": "^5.0.0", | ||
"cross-env": "^7.0.3", | ||
"egg": "beta", | ||
"esbuild": "^0.17.7", | ||
"esbuild-register": "^3.4.2", | ||
"eslint": "^8.16.0", | ||
"eslint-config-egg": "^13.1.0", | ||
"npminstall": "^7.5.0", | ||
"typescript": "^5.2.2" | ||
"eslint": "8", | ||
"eslint-config-egg": "14", | ||
"npminstall": "^7.12.0", | ||
"rimraf": "6", | ||
"supertest": "^7.0.0", | ||
"tshy": "3", | ||
"tshy-after": "1", | ||
"typescript": "5" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:eggjs/egg-bin.git" | ||
"scripts": { | ||
"postinstall-skip": "node scripts/postinstall.mjs", | ||
"lint": "eslint --cache src test --ext .ts", | ||
"pretest": "npm run clean && npm run lint -- --fix && npm run prepublishOnly", | ||
"test": "node bin/run.js test", | ||
"cov": "c8 --temp-directory node_modules/.c8_output -r text-summary -r json-summary -r json -r lcov -r cobertura node bin/run.js test", | ||
"preci": "npm run clean && npm run lint && npm run prepublishOnly", | ||
"ci": "npm run cov", | ||
"clean": "rimraf dist", | ||
"copyScripts": "rimraf dist/scripts && cpy scripts dist", | ||
"prepublishOnly": "tshy && tshy-after && attw --pack && npm run copyScripts" | ||
}, | ||
"bug": { | ||
"url": "https://github.com/eggjs/egg/issues" | ||
"type": "module", | ||
"tshy": { | ||
"exports": { | ||
".": "./src/index.ts", | ||
"./package.json": "./package.json" | ||
} | ||
}, | ||
"homepage": "https://github.com/eggjs/egg-bin", | ||
"author": "fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)", | ||
"scripts": { | ||
"postinstall": "node scripts/postinstall.js", | ||
"contributor": "git-contributor", | ||
"lint": "eslint . --cache --ext ts", | ||
"test": "npm run lint -- --fix && npm run test-local", | ||
"test-local": "npm run tsc && node dist/bin/cli.js test", | ||
"test-local-with-ts-node-transpile-only": "node -r ts-node/register/transpile-only src/bin/cli.ts test", | ||
"test-local-with-swc": "node -r @swc-node/register src/bin/cli.ts test", | ||
"test-local-with-esbuild": "node -r esbuild-register src/bin/cli.ts test", | ||
"test-tsc": "npm run clean && npm run tsc && node dist/bin/cli.js && node dist/bin/cli.js test --base test/fixtures/example-ts && node dist/bin/cli.js dev --base test/fixtures/example-ts", | ||
"cov": "c8 -r lcov -r text-summary -x 'test/**' npm run test-local -- --timeout 120000", | ||
"ci": "npm run lint && npm run test-local && npm run test-tsc", | ||
"prepublishOnly": "npm run clean && npm run tsc", | ||
"tsc": "tsc", | ||
"clean": "rm -rf dist" | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/esm/index.d.ts", | ||
"default": "./dist/esm/index.js" | ||
}, | ||
"require": { | ||
"types": "./dist/commonjs/index.d.ts", | ||
"default": "./dist/commonjs/index.js" | ||
} | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"engines": { | ||
"node": ">= 16.19.0" | ||
"files": [ | ||
"bin", | ||
"dist", | ||
"src", | ||
"scripts" | ||
], | ||
"bin": { | ||
"egg-bin": "./bin/run.js" | ||
}, | ||
"types": "./dist/commonjs/index.d.ts", | ||
"main": "./dist/commonjs/index.js", | ||
"module": "./dist/esm/index.js", | ||
"oclif": { | ||
"bin": "egg-bin", | ||
"commands": "./dist/esm/commands", | ||
"dirname": "egg-bin", | ||
"topicSeparator": " ", | ||
"additionalHelpFlags": [ | ||
"-h" | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.