@xfe-repo/web-app 1.6.4 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +118 -1
  2. package/client.d.ts +1 -0
  3. package/deploy/.drone.yml +13 -4
  4. package/deploy/Dockerfile +15 -6
  5. package/deploy/helm/templates/deployment.yaml +5 -18
  6. package/deploy/helm/templates/svc.yaml +1 -1
  7. package/dist/cli.js +577 -416
  8. package/dist/cli.mjs +562 -256
  9. package/dist/config.d.mts +30 -6
  10. package/dist/config.d.ts +30 -6
  11. package/dist/config.js +142 -298
  12. package/dist/config.mjs +124 -2
  13. package/dist/framework.d.mts +10 -0
  14. package/dist/framework.d.ts +10 -0
  15. package/dist/framework.js +220 -0
  16. package/dist/framework.mjs +182 -0
  17. package/dist/node-dev.d.mts +2 -0
  18. package/dist/node-dev.d.ts +2 -0
  19. package/dist/node-dev.js +358 -0
  20. package/dist/node-dev.mjs +332 -0
  21. package/dist/node.d.mts +27 -0
  22. package/dist/node.d.ts +27 -0
  23. package/dist/node.js +381 -0
  24. package/dist/node.mjs +343 -0
  25. package/dist/react-router-config.d.mts +11 -0
  26. package/dist/react-router-config.d.ts +11 -0
  27. package/dist/react-router-config.js +111 -0
  28. package/dist/react-router-config.mjs +77 -0
  29. package/dist/root.d.mts +17 -0
  30. package/dist/root.d.ts +17 -0
  31. package/dist/root.js +61 -0
  32. package/dist/root.mjs +34 -0
  33. package/dist/serve.d.mts +10 -0
  34. package/dist/serve.d.ts +10 -0
  35. package/dist/serve.js +71 -0
  36. package/dist/serve.mjs +36 -0
  37. package/dist/vite.d.mts +10 -0
  38. package/dist/vite.d.ts +10 -0
  39. package/dist/vite.js +182 -0
  40. package/dist/vite.mjs +146 -0
  41. package/package.json +27 -72
  42. package/tsconfig.json +4 -1
  43. package/config/env.js +0 -104
  44. package/config/getHttpsConfig.js +0 -66
  45. package/config/jest/babelTransform.js +0 -29
  46. package/config/jest/cssTransform.js +0 -14
  47. package/config/jest/fileTransform.js +0 -40
  48. package/config/modules.js +0 -133
  49. package/config/paths.js +0 -65
  50. package/config/webpack/persistentCache/createEnvironmentHash.js +0 -9
  51. package/config/webpack/webpack.config.js +0 -737
  52. package/config/webpack/webpackDevServer.config.js +0 -122
  53. package/deploy/nginx.conf +0 -62
  54. package/dist/chunk-75BJNL7E.mjs +0 -239
  55. package/scripts/build.js +0 -217
  56. package/scripts/dev.js +0 -162
package/scripts/dev.js DELETED
@@ -1,162 +0,0 @@
1
- "use strict";
2
-
3
- // Do this as the first thing so that any code reading it knows the right env.
4
- process.env.BABEL_ENV = "development";
5
- process.env.NODE_ENV = "development";
6
-
7
- // Makes the script crash on unhandled rejections instead of silently
8
- // ignoring them. In the future, promise rejections that are not handled will
9
- // terminate the Node.js process with a non-zero exit code.
10
- process.on("unhandledRejection", (err) => {
11
- throw err;
12
- });
13
-
14
- // Ensure environment variables are read.
15
- require("../config/env");
16
-
17
- const fs = require("fs");
18
- const chalk = require("react-dev-utils/chalk");
19
- const webpack = require("webpack");
20
- const WebpackDevServer = require("webpack-dev-server");
21
- const clearConsole = require("react-dev-utils/clearConsole");
22
- // modify 覆写 关闭 CRA/webpack 开发脚本的默认清屏逻辑,避免 turbo 并行任务日志被擦掉
23
- const shouldClearConsole = process.env.XFE_WEB_CLEAR_CONSOLE === 'true'
24
- if (shouldClearConsole) {
25
- const clearConsolePath = require.resolve('react-dev-utils/clearConsole')
26
- if (require.cache[clearConsolePath]) {
27
- require.cache[clearConsolePath].exports = () => {}
28
- }
29
- }
30
- const checkRequiredFiles = require("react-dev-utils/checkRequiredFiles");
31
- const {
32
- choosePort,
33
- createCompiler,
34
- prepareProxy,
35
- prepareUrls,
36
- } = require("react-dev-utils/WebpackDevServerUtils");
37
- const openBrowser = require("react-dev-utils/openBrowser");
38
- const semver = require("semver");
39
- const paths = require("../config/paths");
40
- const configFactory = require("../config/webpack/webpack.config");
41
- const createDevServerConfig = require("../config/webpack/webpackDevServer.config");
42
- const getClientEnvironment = require("../config/env");
43
- const react = require(require.resolve("react", { paths: [paths.appPath] }));
44
-
45
- const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));
46
- const useYarn = fs.existsSync(paths.yarnLockFile);
47
- const isInteractive = process.stdout.isTTY;
48
-
49
- // Warn and crash if required files are missing
50
- if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
51
- process.exit(1);
52
- }
53
-
54
- // Tools like Cloud9 rely on this.
55
- const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
56
- const HOST = process.env.HOST || "0.0.0.0";
57
-
58
- if (process.env.HOST) {
59
- console.log(
60
- chalk.cyan(
61
- `Attempting to bind to HOST environment variable: ${chalk.yellow(
62
- chalk.bold(process.env.HOST)
63
- )}`
64
- )
65
- );
66
- console.log(
67
- `If this was unintentional, check that you haven't mistakenly set it in your shell.`
68
- );
69
- console.log(
70
- `Learn more here: ${chalk.yellow("https://cra.link/advanced-config")}`
71
- );
72
- console.log();
73
- }
74
-
75
- // We require that you explicitly set browsers and do not fall back to
76
- // browserslist defaults.
77
- const { checkBrowsers } = require("react-dev-utils/browsersHelper");
78
- checkBrowsers(paths.appPath, isInteractive)
79
- .then(() => {
80
- // We attempt to use the default port but if it is busy, we offer the user to
81
- // run on a different port. `choosePort()` Promise resolves to the next free port.
82
- return choosePort(HOST, DEFAULT_PORT);
83
- })
84
- .then((port) => {
85
- if (port == null) {
86
- // We have not found a port.
87
- return;
88
- }
89
-
90
- const config = configFactory("development");
91
- const protocol = process.env.HTTPS === "true" ? "https" : "http";
92
- const appName = require(paths.appPackageJson).name;
93
-
94
- const useTypeScript = fs.existsSync(paths.appTsConfig);
95
- const urls = prepareUrls(
96
- protocol,
97
- HOST,
98
- port,
99
- paths.publicUrlOrPath.slice(0, -1)
100
- );
101
- // Create a webpack compiler that is configured with custom messages.
102
- const compiler = createCompiler({
103
- appName,
104
- config,
105
- urls,
106
- useYarn,
107
- useTypeScript,
108
- webpack,
109
- });
110
- // Load proxy config
111
- const proxySetting = require(paths.appPackageJson).proxy;
112
- const proxyConfig = prepareProxy(
113
- proxySetting,
114
- paths.appPublic,
115
- paths.publicUrlOrPath
116
- );
117
- // Serve webpack assets generated by the compiler over a web server.
118
- const serverConfig = {
119
- ...createDevServerConfig(proxyConfig, urls.lanUrlForConfig),
120
- host: HOST,
121
- port,
122
- };
123
- const devServer = new WebpackDevServer(serverConfig, compiler);
124
- // Launch WebpackDevServer.
125
- devServer.startCallback(() => {
126
- if (isInteractive) {
127
- clearConsole();
128
- }
129
-
130
- if (env.raw.FAST_REFRESH && semver.lt(react.version, "16.10.0")) {
131
- console.log(
132
- chalk.yellow(
133
- `Fast Refresh requires React 16.10 or higher. You are using React ${react.version}.`
134
- )
135
- );
136
- }
137
-
138
- console.log(chalk.cyan("Starting the development server...\n"));
139
- openBrowser(urls.localUrlForBrowser);
140
- });
141
-
142
- ["SIGINT", "SIGTERM"].forEach(function (sig) {
143
- process.on(sig, function () {
144
- devServer.close();
145
- process.exit();
146
- });
147
- });
148
-
149
- if (process.env.CI !== "true") {
150
- // Gracefully exit when stdin ends
151
- process.stdin.on("end", function () {
152
- devServer.close();
153
- process.exit();
154
- });
155
- }
156
- })
157
- .catch((err) => {
158
- if (err && err.message) {
159
- console.log(err.message);
160
- }
161
- process.exit(1);
162
- });