Skip to content

Commit d3a06fa

Browse files
committed
feat: 支持新的 JSX 转换 (Close #38)
1 parent 69fd4b9 commit d3a06fa

File tree

26 files changed

+2582
-2519
lines changed

26 files changed

+2582
-2519
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 变更说明
22

3+
## v0.14.0 - 2021.3.25
4+
5+
- feat: 支持新的 JSX 转换 ([#38](https://github.com/sinoui/ts-lib-scripts/issues/38))
6+
37
## v0.13.11 - 2021.3.24
48

59
- fix(ts-lib-tools): 修复代码中引入 node_modules 中的 css 文件,导致 jest 单元测试执行失败的缺陷

e2e/eslint/react-props-type.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import React from 'react';
22

3-
const Demo: React.FunctionComponent = ({ children }) => {
4-
return <div>{children}</div>;
5-
};
3+
const Demo: React.FunctionComponent = ({ children }) => <div>{children}</div>;
64

75
export default Demo;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# node.js
2+
node_modules
3+
4+
# testing
5+
coverage
6+
7+
# source code
8+
src
9+
10+
# cache
11+
.cache
12+
.docz
13+
14+
# typescript
15+
*.tsbuildinfo
16+
17+
# misc
18+
.DS_Store
19+
__MACOSX
20+
.env.local
21+
.env.development.local
22+
.env.test.local
23+
.env.production.local
24+
25+
# logs
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
lerna-debug.log*
30+
.progress-estimator
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ts-lib-scripts-example
2+
3+
ts-lib-scripts 示例。
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "new-jsx-transform-demo",
3+
"version": "0.13.11",
4+
"private": true,
5+
"dependencies": {
6+
"rc-pagination": "^1.20.11",
7+
"ts-lib-tools": "^0.13.11",
8+
"react": "^17.0.2",
9+
"react-dom": "^17.0.2"
10+
},
11+
"scripts": {
12+
"test": "ts-lib-tools test",
13+
"build": "ts-lib-tools build",
14+
"format": "ts-lib-tools format",
15+
"lint": "ts-lib-tools lint"
16+
},
17+
"devDependencies": {
18+
"@types/react": "^17.0.3",
19+
"@types/react-dom": "^17.0.3"
20+
},
21+
"module": "dist/new-jsx-transform-demo.esm.js",
22+
"types": "types/index.d.ts"
23+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import ReactDOM from 'react-dom';
2+
3+
ReactDOM.render(
4+
<div>Hello, new jsx transform demo!</div>,
5+
document.getElementById('root'),
6+
);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"include": ["src", "src/**/*.json"],
3+
"exclude": ["node_modules"],
4+
"compilerOptions": {
5+
"target": "es5",
6+
"module": "esnext",
7+
"lib": ["dom", "esnext", "WebWorker"],
8+
"importHelpers": true,
9+
"declaration": true,
10+
"sourceMap": true,
11+
"strict": true,
12+
"noImplicitAny": true,
13+
"strictNullChecks": true,
14+
"strictFunctionTypes": true,
15+
"strictPropertyInitialization": true,
16+
"noImplicitThis": true,
17+
"alwaysStrict": true,
18+
"noUnusedLocals": true,
19+
"noUnusedParameters": true,
20+
"noImplicitReturns": true,
21+
"noFallthroughCasesInSwitch": true,
22+
"moduleResolution": "node",
23+
"jsx": "react-jsx",
24+
"esModuleInterop": true,
25+
"allowJs": false,
26+
"baseUrl": "./",
27+
"rootDir": "./src",
28+
"declarationDir": "./types",
29+
"incremental": true,
30+
"composite": true,
31+
"outDir": "dist",
32+
"skipLibCheck": true,
33+
"resolveJsonModule": true,
34+
"plugins": [{ "name": "typescript-plugin-css-modules" }]
35+
}
36+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"emitDeclarationOnly": true,
5+
"declarationDir": "types",
6+
"declaration": true,
7+
"skipLibCheck": true,
8+
"tsBuildInfoFile": "release.tsbuildinfo"
9+
}
10+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": [
4+
"node_modules",
5+
"**/__tests__/**",
6+
"**/*.spec.ts",
7+
"**/*.spec.tsx",
8+
"**/*.test.ts",
9+
"**/*.test.tsx"
10+
],
11+
"compilerOptions": {
12+
"target": "ES2020",
13+
"module": "esnext",
14+
"declaration": true,
15+
"sourceMap": false,
16+
"outDir": "./build/es6",
17+
"declarationDir": "./build/types",
18+
"tsBuildInfoFile": "./build/tsconfig.tsbuildinfo"
19+
}
20+
}

examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"lint-staged": "^8.1.7",
2020
"react": "^16.8.6",
2121
"rimraf": "^2.6.3",
22-
"typescript": "^4.0.2"
22+
"typescript": "^4.2.3"
2323
},
2424
"prettier": {
2525
"printWidth": 80,

0 commit comments

Comments
 (0)