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: jaywcjlove/tsbb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.2
Choose a base ref
...
head repository: jaywcjlove/tsbb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.0.3
Choose a head ref
  • 2 commits
  • 21 files changed
  • 1 contributor

Commits on Mar 29, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cbd4670 View commit details
  2. released v4.0.3

    jaywcjlove committed Mar 29, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    213c387 View commit details
4 changes: 2 additions & 2 deletions examples/babel-transform-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@template/babel-transform-ts",
"private": true,
"version": "4.0.2",
"version": "4.0.3",
"description": "Transform Typescript Example.",
"scripts": {
"watch": "tsbb watch 'src/**/*.ts' --use-babel --no-esm",
@@ -17,6 +17,6 @@
"keywords": [],
"license": "MIT",
"devDependencies": {
"tsbb": "4.0.2"
"tsbb": "4.0.3"
}
}
4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@template/basic",
"version": "4.0.2",
"version": "4.0.3",
"description": "Basic Example.",
"license": "MIT",
"private": true,
@@ -17,6 +17,6 @@
},
"keywords": [],
"devDependencies": {
"tsbb": "4.0.2"
"tsbb": "4.0.3"
}
}
4 changes: 2 additions & 2 deletions examples/express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@template/express",
"version": "4.0.2",
"version": "4.0.3",
"private": true,
"description": "Express Example.",
"scripts": {
@@ -31,7 +31,7 @@
"@types/http-errors": "~2.0.1",
"nodemon": "~2.0.22",
"ts-node-dev": "~2.0.0",
"tsbb": "4.0.2"
"tsbb": "4.0.3"
},
"dependencies": {
"compression": "~1.7.4",
4 changes: 2 additions & 2 deletions examples/hapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@template/hapi",
"version": "4.0.2",
"version": "4.0.3",
"private": true,
"description": "hapi Example.",
"main": "index.js",
@@ -29,7 +29,7 @@
},
"devDependencies": {
"nodemon": "~2.0.22",
"tsbb": "4.0.2"
"tsbb": "4.0.3"
},
"dependencies": {
"@hapi/hapi": "^21.3.0"
4 changes: 2 additions & 2 deletions examples/koa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@template/koa",
"version": "4.0.2",
"version": "4.0.3",
"private": true,
"description": "Koa Example",
"scripts": {
@@ -28,7 +28,7 @@
"devDependencies": {
"@types/koa": "^2.13.5",
"nodemon": "~2.0.22",
"tsbb": "4.0.2"
"tsbb": "4.0.3"
},
"dependencies": {
"koa": "^2.14.1"
4 changes: 2 additions & 2 deletions examples/react-component-tsx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@template/react-component-tsx",
"version": "4.0.2",
"version": "4.0.3",
"description": "React Component Example for TypeScript.",
"private": true,
"main": "lib/index.js",
@@ -51,7 +51,7 @@
"prettier": "^2.8.6",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"tsbb": "4.0.2"
"tsbb": "4.0.3"
},
"eslintConfig": {
"extends": [
8 changes: 4 additions & 4 deletions examples/react-component/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@template/react-component",
"version": "4.0.2",
"version": "4.0.3",
"private": true,
"description": "React Component Example.",
"scripts": {
"watch": "tsbb watch src/*.{jsx,js,d.ts} --useBabel",
"build": "tsbb build src/*.{jsx,js,d.ts} --useBabel && npm run css:build && npm run css:build:dist",
"watch": "tsbb watch src/*.{jsx,js} --useBabel",
"build": "tsbb build src/*.{jsx,js} --useBabel && npm run css:build && npm run css:build:dist",
"css:build": "compile-less -d src -o esm",
"css:watch": "compile-less -d src -o esm --watch",
"css:build:dist": "compile-less -d src --combine dist/markdown-editor.css --rm-global",
@@ -43,7 +43,7 @@
"less": "~4.1.3",
"parcel": "~2.8.3",
"react-test-renderer": "~18.2.0",
"tsbb": "4.0.2"
"tsbb": "4.0.3"
},
"dependencies": {
"@parcel/transformer-react-refresh-wrap": "~2.8.3",
1 change: 1 addition & 0 deletions examples/react-component/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function Demo3(): void;
3 changes: 3 additions & 0 deletions examples/react-component/src/good.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"a": 1
}
4 changes: 2 additions & 2 deletions examples/typenexus/package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"name": "@template/typenexus",
"private": true,
"type": "module",
"version": "4.0.2",
"version": "4.0.3",
"description": "TypeNexus Example.",
"scripts": {
"start": "npm run build && node dist/main.js",
@@ -32,6 +32,6 @@
"supertest": "^6.3.3",
"supertest-session": "^4.1.0",
"ts-node": "^10.9.1",
"tsbb": "4.0.2"
"tsbb": "4.0.3"
}
}
4 changes: 2 additions & 2 deletions examples/umd/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@template/umd",
"private": true,
"version": "4.0.2",
"version": "4.0.3",
"description": "UMD Example.",
"scripts": {
"watch": "tsbb watch",
@@ -16,6 +16,6 @@
"keywords": [],
"license": "MIT",
"devDependencies": {
"tsbb": "4.0.2"
"tsbb": "4.0.3"
}
}
4 changes: 2 additions & 2 deletions examples/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@template/vue",
"private": true,
"version": "4.0.2",
"version": "4.0.3",
"description": "",
"main": "./cjs/index.js",
"module": "./esm/index.js",
@@ -15,6 +15,6 @@
"vue": "^3.0.0"
},
"devDependencies": {
"tsbb": "4.0.2"
"tsbb": "4.0.3"
}
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.0.2",
"version": "4.0.3",
"packages": ["examples/*", "packages/*"],
"useWorkspaces": true
}
4 changes: 2 additions & 2 deletions packages/babel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tsbb/babel",
"version": "4.0.2",
"version": "4.0.3",
"description": "TSBB is a zero-config CLI that helps you develop, test, and publish modern TypeScript project.",
"author": "kenny wang <wowohoo@qq.com>",
"homepage": "https://jaywcjlove.github.io/tsbb",
@@ -38,7 +38,7 @@
"@babel/preset-env": "~7.20.2",
"@babel/preset-react": "~7.18.6",
"@babel/preset-typescript": "~7.21.0",
"@tsbb/typescript": "4.0.2",
"@tsbb/typescript": "4.0.3",
"@types/babel__core": "^7.20.0",
"@types/semver": "~7.3.13",
"@vue/babel-plugin-jsx": "~1.1.1",
8 changes: 4 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tsbb/core",
"version": "4.0.2",
"version": "4.0.3",
"description": "TSBB is a zero-config CLI that helps you develop, test, and publish modern TypeScript project.",
"author": "kenny wang <wowohoo@qq.com>",
"homepage": "https://jaywcjlove.github.io/tsbb",
@@ -32,9 +32,9 @@
"node": ">=16.0.0"
},
"dependencies": {
"@tsbb/babel": "4.0.2",
"@tsbb/jest": "4.0.2",
"@tsbb/typescript": "4.0.2",
"@tsbb/babel": "4.0.3",
"@tsbb/jest": "4.0.3",
"@tsbb/typescript": "4.0.3",
"@types/fs-extra": "^11.0.1",
"chokidar": "~3.5.3",
"fs-extra": "^11.1.1",
54 changes: 27 additions & 27 deletions packages/core/src/watcher/babelTransform.ts
Original file line number Diff line number Diff line change
@@ -11,36 +11,36 @@ export function babelTransform(options: CompileOptions = {}) {
const rootDirsRelative = [...new Set(getRootsFolderName(options.entry))];
const entry = rootDirsRelative.map((item) => path.resolve(item));
const onFilesChange: CopyFilesOptions['onFilesChange'] = (eventName, filepath, stats) => {
if (/\.(m?js|jsx?|m?ts|tsx?|c?js)$/i.test(filepath)) {
const log = new Log().name();
const dt = getOutputPath(filepath, options);
if (/^(add|change)$/.test(eventName) && !/\.d\.ts$/i.test(filepath)) {
const log = new Log().name();
const dt = getOutputPath(filepath, options);
if (/\.(m?ts|m?js|jsx?|tsx?|c?js)(?<!\.d\.ts)$/i.test(filepath)) {
if (/^(add|change)$/.test(eventName)) {
babelCompile(filepath, { ...options });
} else if (/\.d\.ts$/i.test(filepath)) {
if (typeof cjs !== 'boolean') {
fs.ensureDirSync(path.dirname(dt.cjs.path));
fs.copyFile(filepath, dt.cjs.path);
log
.icon('🐶')
.success(
`${getExt(filepath)}┈┈▶ \x1b[32;1m${dt.folderFilePath}\x1b[0m => \x1b[34;1m${dt.cjs.tsFileName}\x1b[0m`,
);
}
if (typeof esm !== 'boolean') {
fs.ensureDirSync(path.dirname(dt.esm.path));
fs.copyFile(filepath, dt.esm.path);
log
.icon('🐶')
.success(
`${getExt(filepath)}┈┈▶ \x1b[32;1m${dt.folderFilePath}\x1b[0m => \x1b[34;1m${dt.esm.tsFileName}\x1b[0m`,
);
}
}
if (/^(unlink|unlinkDir)$/.test(eventName)) {
fs.remove(dt.cjs.path);
fs.remove(dt.esm.path);
log.icon('🗑️').success(`┈┈▶ \x1b[32;1m${path.relative(process.cwd(), filepath)}\x1b[0m`);
} else if (/^(add|change)$/.test(eventName)) {
if (typeof cjs !== 'boolean') {
fs.ensureDirSync(path.dirname(dt.cjs.path));
fs.copyFile(filepath, dt.cjs.path);
log
.icon('🐶')
.success(
`${getExt(filepath)}┈┈▶ \x1b[32;1m${dt.folderFilePath}\x1b[0m => \x1b[34;1m${dt.cjs.tsFileName}\x1b[0m`,
);
}
if (typeof esm !== 'boolean') {
fs.ensureDirSync(path.dirname(dt.esm.path));
fs.copyFile(filepath, dt.esm.path);
log
.icon('🐶')
.success(
`${getExt(filepath)}┈┈▶ \x1b[32;1m${dt.folderFilePath}\x1b[0m => \x1b[34;1m${dt.esm.tsFileName}\x1b[0m`,
);
}
}
if (/^(unlink|unlinkDir)$/.test(eventName)) {
fs.remove(dt.cjs.path);
fs.remove(dt.esm.path);
log.icon('🗑️').success(`┈┈▶ \x1b[32;1m${path.relative(process.cwd(), filepath)}\x1b[0m`);
}
};
const onReady = () => {
4 changes: 2 additions & 2 deletions packages/create-tsbb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-tsbb",
"version": "4.0.2",
"version": "4.0.3",
"description": "Creates a TSBB application using the command line.",
"homepage": "https://jaywcjlove.github.io/tsbb/create-tsbb.html",
"author": "Kenny Wong <wowohoo@qq.com> (https://github.com/jaywcjlove)",
@@ -55,6 +55,6 @@
},
"devDependencies": {
"cpy": "^9.0.1",
"tsbb": "4.0.2"
"tsbb": "4.0.3"
}
}
2 changes: 1 addition & 1 deletion packages/jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tsbb/jest",
"version": "4.0.2",
"version": "4.0.3",
"description": "TSBB is a zero-config CLI that helps you develop, test, and publish modern TypeScript project.",
"author": "kenny wang <wowohoo@qq.com>",
"homepage": "https://jaywcjlove.github.io/tsbb",
4 changes: 2 additions & 2 deletions packages/tsbb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tsbb",
"version": "4.0.2",
"version": "4.0.3",
"description": "TSBB is a zero-config CLI that helps you develop, test, and publish modern TypeScript project.",
"author": "kenny wang <wowohoo@qq.com>",
"homepage": "https://jaywcjlove.github.io/tsbb",
@@ -33,6 +33,6 @@
"node": ">=16.0.0"
},
"dependencies": {
"@tsbb/core": "4.0.2"
"@tsbb/core": "4.0.3"
}
}
2 changes: 1 addition & 1 deletion packages/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tsbb/typescript",
"version": "4.0.2",
"version": "4.0.3",
"description": "TSBB is a zero-config CLI that helps you develop, test, and publish modern TypeScript project.",
"author": "kenny wang <wowohoo@qq.com>",
"homepage": "https://jaywcjlove.github.io/tsbb",
1 change: 1 addition & 0 deletions packages/typescript/src/utils.ts
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ export const getExt = (extname: string) => {
if (/^TS/.test(ext)) {
return `\x1b[36;1m${ext}\x1b[0m`;
}
return ext;
};

export const getEmojiIcon = (fileName: string) => {