orc-scripts 1.9.0-dev.1 → 2.0.0-dev.3

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.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "orc-scripts",
3
- "version": "1.9.0-dev.1",
3
+ "version": "2.0.0-dev.3",
4
4
  "description": "Scripts toolbox for Orckestra",
5
5
  "type": "commonjs",
6
6
  "bin": {
7
7
  "orc-scripts": "src/index.js"
8
8
  },
9
9
  "engines": {
10
- "node": ">= 10",
11
- "npm": ">= 6.13.4"
10
+ "node": ">= 18",
11
+ "npm": ">= 9.0.0"
12
12
  },
13
13
  "scripts": {
14
14
  "coverage": "node src test --coverage",
@@ -61,7 +61,7 @@
61
61
  "@welldone-software/why-did-you-render": "^4.2.5",
62
62
  "babel-core": "7.0.0-bridge.0",
63
63
  "babel-eslint": "^10.0.1",
64
- "babel-loader": "^8.0.4",
64
+ "babel-loader": "^8.3.0",
65
65
  "babel-plugin-react-intl-auto": "^3.1.0",
66
66
  "babel-plugin-root-import": "^6.5.0",
67
67
  "babel-plugin-styled-components": "^1.10.6",
@@ -70,7 +70,7 @@
70
70
  "core-js": "^3.0.0",
71
71
  "coveralls": "^3.0.2",
72
72
  "cross-spawn": "^7.0.0",
73
- "css-loader": "^3.4.2",
73
+ "css-loader": "^6.8.1",
74
74
  "date-fns": "^2",
75
75
  "dotenv": "^8.0.0",
76
76
  "enzyme": "^3.11.0",
@@ -83,13 +83,13 @@
83
83
  "eslint-plugin-react": "^7.11.1",
84
84
  "eslint-plugin-react-hooks": "^2.5.1",
85
85
  "extract-react-intl-messages": "^4.1.1",
86
- "file-loader": "^6.0.0",
86
+ "file-loader": "^6.2.0",
87
87
  "full-icu": "^1.3.1",
88
88
  "husky": "^4.0.0",
89
89
  "icu4c-data": "^0.64.2",
90
90
  "identity-obj-proxy": "^3.0.0",
91
91
  "imagemin": "^5.0.0",
92
- "img-loader": "^3.0.1",
92
+ "img-loader": "^4.0.0",
93
93
  "immutable": "^3.0.0",
94
94
  "immutable4": "npm:immutable@^4.0.0-rc.12",
95
95
  "is-ci": "^2.0.0",
@@ -127,24 +127,24 @@
127
127
  "rimraf": "^3.0.0",
128
128
  "seamless-immutable": "^7.1.3",
129
129
  "sinon": "^9.0.0",
130
- "style-loader": "^1.1.3",
130
+ "style-loader": "^3.3.3",
131
131
  "styled-components": "5.1.1",
132
132
  "styled-transition-group": "^2.0.0",
133
- "svg-inline-loader": "^0.8.0",
133
+ "svg-inline-loader": "^0.8.2",
134
134
  "ts-jest": "^26.4.0",
135
- "typeface-open-sans": "^0.0.75",
135
+ "typeface-open-sans": "^1.1.13",
136
136
  "typeface-roboto-condensed": "^0.0.75",
137
137
  "unexpected": "^11.1.0",
138
138
  "unexpected-dom": "^4.14.3",
139
139
  "unexpected-immutable": "^0.5.0",
140
140
  "unexpected-reaction": "^2.14.0",
141
141
  "unexpected-sinon": "^10.11.1",
142
- "url-loader": "^4.0.0",
142
+ "url-loader": "^4.1.1",
143
143
  "url-pattern": "^1.0.3",
144
144
  "url-polyfill": "^1.1.0",
145
- "webpack": "^4.25.1",
146
- "webpack-bundle-analyzer": "^3.6.0",
147
- "webpack-dev-server": "^3.1.10",
145
+ "webpack": "^5.89.0",
146
+ "webpack-bundle-analyzer": "^4.10.0",
147
+ "webpack-dev-server": "^4.15.1",
148
148
  "whatwg-fetch": "^3.0.0"
149
149
  },
150
150
  "sideEffects": false,
@@ -28,17 +28,16 @@ const config = {
28
28
  module: {
29
29
  rules: [
30
30
  {
31
- resource: {
32
- test: /\.js$/, // Only JavaScript files
33
- or: [
34
- // One of these conditions must be true
35
- { not: [/node_modules/] }, // No dependencies unless explicitly allowed by whitelist
36
- ].concat(
31
+ test: /\.js$/, // Only JavaScript files
32
+ exclude: {
33
+ and: [/node_modules/], // Exclude libraries in node_modules ...
34
+ not: [
35
+ // Except for a few of them that needs to be transpiled because they use modern syntax
37
36
  // Allowed by whitelist
38
37
  babelWhitelist.map(
39
38
  lib => new RegExp("node_modules(?:/|\\\\)" + lib.replace("/", "(?:/|\\\\)") + "(?:/|\\\\)"),
40
39
  ),
41
- ),
40
+ ]
42
41
  },
43
42
  use: [
44
43
  {
@@ -61,12 +60,7 @@ const config = {
61
60
  },
62
61
  {
63
62
  test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
64
- use: {
65
- loader: "url-loader",
66
- options: {
67
- limit: 50000,
68
- },
69
- },
63
+ type: 'asset/inline',
70
64
  },
71
65
  ],
72
66
  },
@@ -95,8 +89,10 @@ if (parseEnv("NODE_ENV") === "production") {
95
89
  config.mode = "production";
96
90
  } else {
97
91
  config.devtool = "inline-source-map";
98
- config.optimization = { usedExports: true };
99
- config.plugins.push(new webpack.NamedModulesPlugin(), new webpack.HotModuleReplacementPlugin());
92
+ config.optimization = {
93
+ usedExports: true,
94
+ moduleIds: 'named',
95
+ };
100
96
  config.mode = "development";
101
97
  }
102
98
 
package/src/index.js CHANGED
File without changes
@@ -1,4 +1,4 @@
1
- const webpackDevServer = require("webpack-dev-server");
1
+ const DevServer = require("webpack-dev-server");
2
2
  const webpack = require("webpack");
3
3
 
4
4
  const HOST = process.env.HOSTNAME || "localhost";
@@ -9,37 +9,27 @@ const PORT = argPort || process.env.PORT || 5000;
9
9
 
10
10
  const config = require("../config/webpack.config.js");
11
11
  const options = {
12
- contentBase: "./dist",
13
- publicPath: process.env.WEBPACK_PUBLIC_PATH || "/",
14
12
  historyApiFallback: true,
15
- hotOnly: true,
13
+ hot: "only",
16
14
  port: PORT,
17
15
  host: HOST,
16
+ static: './dist',
17
+ devMiddleware: {
18
+ publicPath: process.env.WEBPACK_PUBLIC_PATH || "/",
19
+ },
18
20
  };
19
21
 
20
22
  if (HOST !== "localhost") {
21
23
  options.public = HOST;
22
24
  }
23
25
  if (HOST !== "localhost" || args.indexOf("--https") !== -1 || process.env.HTTPS) {
24
- options.https = true;
26
+ options.server = 'https';
25
27
  }
26
28
 
27
- const location = "http" + (options.https ? "s" : "") + "://" + HOST + ":" + PORT;
28
-
29
- // /mockData/ contains json files to simulate API endpoints
30
- options.before = (app, server) => {
31
- app.get("/mockData/*", (req, res, next) => {
32
- const parsedUrl = new URL(req.url, location);
33
- parsedUrl.pathname = parsedUrl.pathname + ".json";
34
- req.url = parsedUrl.href.replace(location, "");
35
- next();
36
- });
37
- };
38
-
39
- webpackDevServer.addDevServerEntrypoints(config, options);
40
29
  const compiler = webpack(config);
41
- const server = new webpackDevServer(compiler, options);
42
30
 
43
- server.listen(PORT, "localhost", () => {
44
- console.log("dev server listening at " + location);
45
- });
31
+ const server = new DevServer(options, compiler);
32
+
33
+ (async () => {
34
+ await server.start();
35
+ })();