Skip to content

Commit

Permalink
Refactor build tasks (#5719)
Browse files Browse the repository at this point in the history
* Remove dts generator plugin from build core

* Remove dts generator plugin from build react

* Remove dts generator plugin from build knockout

* Remove dts generator plugin from core presets

* Remove dts generator plugin from react presets

* Delete webpack dts generator
  • Loading branch information
dk981234 authored Jul 22, 2024
1 parent ceb3346 commit bd51e00
Show file tree
Hide file tree
Showing 22 changed files with 55 additions and 346 deletions.
19 changes: 7 additions & 12 deletions packages/creator-presets-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"experimentalDecorators": true,
"importHelpers": true,
"moduleResolution": "node",
"jsx": "react",
"baseUrl": ".",
"declaration": true,
"declarationDir": "build/typings/",
"paths": {
"survey-core": [
"./node_modules/survey-core"
Expand All @@ -20,18 +21,12 @@
"creator-presets-core": [
"./src/entries/index.ts"
],
"tslib" : ["./node_modules/tslib/tslib.d.ts"]
}
"tslib": [
"./node_modules/tslib/tslib.d.ts"
]
}
},
"exclude": [
"node_modules",
"build",
"**/node_modules",
"**/tests",
"**/*.spec.ts",
"**/*.test.ts"
],
"include": [
"src/**/*.ts"
"./src/entries/index.ts",
]
}
2 changes: 2 additions & 0 deletions packages/creator-presets-core/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"declaration": false,
"declarationDir": null
},
"exclude": [
"src/entries/**/*.ts"
Expand Down
34 changes: 0 additions & 34 deletions packages/creator-presets-core/tsconfig.typing.json

This file was deleted.

20 changes: 1 addition & 19 deletions packages/creator-presets-core/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var webpack = require("webpack");
var path = require("path");
var MiniCssExtractPlugin = require("mini-css-extract-plugin");
var FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
const DtsGeneratorPlugin = require("../../webpack-plugins/webpack-dts-generator");
var packageJson = require("./package.json");
var fs = require("fs");

Expand Down Expand Up @@ -45,7 +44,7 @@ var buildPlatformJson = {
engines: {
node: ">=0.10.0",
},
typings: packageJson.name + ".d.ts",
typings: "./typings/entries/index.d.ts",
peerDependencies: {
"ace-builds": "^1.4.12",
"survey-core": packageJson.version
Expand Down Expand Up @@ -102,18 +101,6 @@ module.exports = function (options) {
test: /\.(ts|tsx)$/,
loader: "ts-loader",
},
{
test: /\.css$/,
loader: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: {
sourceMap: options.buildType !== "prod",
},
},
],
},
{
test: /\.s(c|a)ss$/,
loader: [
Expand Down Expand Up @@ -162,11 +149,6 @@ module.exports = function (options) {
},
plugins: [
new webpack.ProgressPlugin(percentage_handler),
new DtsGeneratorPlugin({
webpack: webpack,
filePath: "build/creator-presets-core.d.ts",
moduleName: "creator-presets-core"
}),
new webpack.DefinePlugin({
"process.env.ENVIRONMENT": JSON.stringify(options.buildType),
"process.env.VERSION": JSON.stringify(packageJson.version),
Expand Down
15 changes: 4 additions & 11 deletions packages/creator-presets-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"moduleResolution": "node",
"jsx": "react",
"baseUrl": ".",
"declaration": true,
"declarationDir": "build/typings/",
"paths": {
"survey-core": [
"./node_modules/survey-core"
Expand All @@ -28,16 +30,7 @@
]
}
},
"exclude": [
"node_modules",
"build",
"**/*.js",
"**/node_modules",
"**/tests",
"**/*.spec.ts",
"**/*.test.ts"
],
"include": [
"src/**/*.ts"
]
"./src/entries/index.ts",
],
}
4 changes: 3 additions & 1 deletion packages/creator-presets-react/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"compilerOptions": {
"noImplicitAny": false,
"esModuleInterop": true,
"allowJs": true
"allowJs": true,
"declaration": false,
"declarationDir": null
}
}
45 changes: 0 additions & 45 deletions packages/creator-presets-react/tsconfig.typing.json

This file was deleted.

20 changes: 1 addition & 19 deletions packages/creator-presets-react/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const webpack = require("webpack");
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const DtsGeneratorPlugin = require("../../webpack-plugins/webpack-dts-generator");
const packageJson = require("./package.json");
const fs = require("fs");

Expand Down Expand Up @@ -43,7 +42,7 @@ const buildPlatformJson = {
engines: {
node: ">=0.10.0"
},
typings: packageJson.name + ".d.ts",
typings: "./typings/entries/index.d.ts",
peerDependencies: {
"ace-builds": "^1.4.12",
"react": "^16.5.0 || ^17.0.1 || ^18.1.0",
Expand Down Expand Up @@ -102,18 +101,6 @@ module.exports = function (options) {
test: /\.(ts|tsx)$/,
loader: "ts-loader",
},
{
test: /\.css$/,
loader: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: {
sourceMap: options.buildType !== "prod"
}
}
]
},
{
test: /\.s(c|a)ss$/,
loader: [
Expand Down Expand Up @@ -218,11 +205,6 @@ module.exports = function (options) {
config.devtool = "source-map";
config.plugins = config.plugins.concat([
new webpack.LoaderOptionsPlugin({ debug: true }),
new DtsGeneratorPlugin({
webpack: webpack,
filePath: "build/creator-presets-react.d.ts",
moduleName: "creator-presets-react"
})
]);
config.devServer = {
contentBase: __dirname,
Expand Down
2 changes: 1 addition & 1 deletion packages/survey-creator-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
"tag": true
}
}
}
}
12 changes: 12 additions & 0 deletions packages/survey-creator-core/tsconfig.i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": false,
"declarationDir": null,
"paths": {
"survey-creator-core": [
"./src/editorLocalization.ts"
],
},
}
}
10 changes: 3 additions & 7 deletions packages/survey-creator-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@
"experimentalDecorators": true,
"importHelpers": true,
"moduleResolution": "node",
"jsx": "react",
"baseUrl": ".",
"paths": {
"survey-creator-core": [
"./src/editorLocalization.ts"
],
}
"declaration": true,
"declarationDir": "build/typings/"
},
"include": [
"src/**/*.ts"
"./src/entries/index.ts"
]
}
6 changes: 5 additions & 1 deletion packages/survey-creator-core/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"declaration": false,
"declarationDir": null,
"paths": {
"survey-creator-core": [
"./src/editorLocalization.ts"
],
"tslib" : ["./node_modules/tslib/tslib.d.ts"]
"tslib": [
"./node_modules/tslib/tslib.d.ts"
]
}
},
"exclude": [
Expand Down
26 changes: 0 additions & 26 deletions packages/survey-creator-core/tsconfig.typing.json

This file was deleted.

Loading

0 comments on commit bd51e00

Please sign in to comment.