chore: refine build

This commit is contained in:
zyc9012 2022-04-25 18:55:14 +08:00
parent 392efbe8b3
commit 361aedebf5
5 changed files with 26 additions and 43 deletions

View File

@ -9,12 +9,12 @@
"license": "MIT",
"scripts": {
"dev": "yarn storybook",
"build": "mv packages/react/tsconfig.build.json packages/react/tsconfig.json && father-build && mv packages/react/tsconfig.json packages/react/tsconfig.build.json",
"build": "node ./scripts/build",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"tsc": "tsc --noEmit",
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx ./packages",
"postinstall": "patch-package",
"postinstall": "patch-package && lerna run build --scope=@fortune-sheet/formula-parser",
"publish": "lerna publish --registry 'https://registry.npmjs.org'",
"test": "jest",
"coverage": "jest --coverage"

View File

@ -1,20 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"removeComments": true,
"moduleResolution": "node",
"noLib": false,
"jsx": "react",
"strict": true,
"strictNullChecks": true,
"skipLibCheck": true,
"lib": ["es5", "dom"],
"baseUrl": "./"
},
"include": ["./src"],
"exclude": ["node_modules", "**/*.test.ts", "**/*.spec.ts", "dist", "lib"]
}

View File

@ -11,6 +11,7 @@ import {
escapeScriptTag,
valueShowEs,
updateCell,
createRangeHightlight,
} from "@fortune-sheet/core";
import React, {
useContext,
@ -25,7 +26,6 @@ import WorkbookContext from "../../context";
import ContentEditable from "./ContentEditable";
import FormulaSearch from "./FormulaSearch";
import FormulaHint from "./FormulaHint";
import { createRangeHightlight } from "../../../../core/src/modules/formula";
const InputBox: React.FC = () => {
const { context, setContext, refs } = useContext(WorkbookContext);

View File

@ -1,20 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"removeComments": true,
"moduleResolution": "node",
"noLib": false,
"jsx": "react",
"strict": true,
"strictNullChecks": true,
"skipLibCheck": true,
"lib": ["es5", "dom"],
"baseUrl": "./"
},
"include": ["./src"],
"exclude": ["node_modules", "**/*.test.ts", "**/*.spec.ts", "dist", "lib"]
}

23
scripts/build.js Normal file
View File

@ -0,0 +1,23 @@
const fs = require("fs");
const { spawnSync } = require("child_process");
const tsconfig = JSON.parse(fs.readFileSync("tsconfig.json"));
delete tsconfig.compilerOptions.paths;
tsconfig.include = ["./src"];
tsconfig.exclude = [
"node_modules",
"**/*.test.ts",
"**/*.spec.ts",
"dist",
"lib",
];
const tsconfigJson = JSON.stringify(tsconfig);
fs.writeFileSync("packages/core/tsconfig.json", tsconfigJson);
fs.writeFileSync("packages/react/tsconfig.json", tsconfigJson);
spawnSync("father-build", { stdio: "inherit" });
fs.rmSync("packages/core/tsconfig.json");
fs.rmSync("packages/react/tsconfig.json");