Skip to content

Commit

Permalink
refactor: generate jsx types from types/react
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Jul 26, 2021
1 parent 00980a8 commit 8a984b3
Show file tree
Hide file tree
Showing 22 changed files with 1,817 additions and 2,171 deletions.
2 changes: 1 addition & 1 deletion integration/todo/ui/Header_template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default injectMethod(
<input
class="new-todo"
placeholder="What needs to be done?"
autofocus
autoFocus
value={this.$state.text}
on:keyup={QRL`ui:/Header_addTodo#?value=.target.value&code=.code`}
/>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"integration.server": "node scripts --dev && node integration/devserver.js --port 8080 --mode development",
"integration.server.prod": "tsc && node scripts && node integration/devserver.js --port 8081 --mode production",
"validate.build": "node -r esbuild-register scripts/validate-build.ts",
"jsx.types": "node scripts --jsx",
"prepare": "husky install",
"lint": "eslint \"**/*.ts*\" && npm run prettier-check",
"prettier-check": "prettier --check .",
Expand Down Expand Up @@ -143,7 +144,7 @@
"<rootDir>/node_modules/",
"<rootDir>/tsc-out/"
],
"testRegex": "/src/.*\\.unit\\.(ts|tsx)$"
"testRegex": "/(scripts|src)/.*\\.unit\\.(ts|tsx)$"
},
"lint-staged": {
"*.*": [
Expand Down
5 changes: 5 additions & 0 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { BuildConfig } from './util';
import { buildDevServer } from './devserver';
import { copyFiles } from './copy-files';
import { emptyDir } from './util';
import { generateJsxTypes } from './jsx-types';
import { generatePackageJson } from './package-json';
import { submoduleCore } from './submodule-core';
import { submoduleJsxRuntime } from './submodule-jsx-runtime';
Expand Down Expand Up @@ -39,6 +40,10 @@ export async function build(config: BuildConfig) {
buildDevServer(config),
]);

if (config.jsx) {
await generateJsxTypes(config);
}

await submoduleOptimizer(config);
} catch (e) {
console.error(e);
Expand Down
239 changes: 0 additions & 239 deletions scripts/generate/tsx/types.html

This file was deleted.

Loading

0 comments on commit 8a984b3

Please sign in to comment.