@zohodesk/react-cli 1.1.17 → 1.1.18-exp.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.
- package/README.md +13 -0
- package/bin/cli.js +4 -0
- package/lib/babel/cmjs-plugins-presets.js +11 -6
- package/lib/babel/es-plugins-presets.js +12 -6
- package/lib/configs/webpack.dev.config.js +11 -2
- package/lib/configs/webpack.prod.config.js +5 -1
- package/lib/schemas/index.js +7 -0
- package/npm-shrinkwrap.json +1103 -32
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -44,6 +44,19 @@ Now to run app
|
|
|
44
44
|
|
|
45
45
|
# Change Logs
|
|
46
46
|
|
|
47
|
+
# 1.1.18 (30-01-2024)
|
|
48
|
+
|
|
49
|
+
**Feature:-**
|
|
50
|
+
|
|
51
|
+
- MJS loader support added.
|
|
52
|
+
- We can enable/disable this feature by `npm run start --enableMjsLoader=true/false` default value will be `false`.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
app: {
|
|
56
|
+
enableMjsLoader : true/false
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
47
60
|
# 1.1.17 (24.1.2024)
|
|
48
61
|
|
|
49
62
|
**Feature:-**
|
package/bin/cli.js
CHANGED
|
@@ -300,6 +300,8 @@ switch (option) {
|
|
|
300
300
|
'src',
|
|
301
301
|
'-d',
|
|
302
302
|
'lib',
|
|
303
|
+
'--extensions',
|
|
304
|
+
'.js,.ts,.tsx',
|
|
303
305
|
`--presets=${require.resolve('../lib/babel/cmjs-plugins-presets.js')}`,
|
|
304
306
|
'--copy-files'
|
|
305
307
|
].concat(args),
|
|
@@ -316,6 +318,8 @@ switch (option) {
|
|
|
316
318
|
'src',
|
|
317
319
|
'--out-dir',
|
|
318
320
|
'es',
|
|
321
|
+
'--extensions',
|
|
322
|
+
'.js,.ts,.tsx',
|
|
319
323
|
`--presets=${require.resolve('../lib/babel/es-plugins-presets.js')}`,
|
|
320
324
|
'--copy-files'
|
|
321
325
|
].concat(args),
|
|
@@ -7,18 +7,23 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _utils = require("../utils");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const {
|
|
11
11
|
module: {
|
|
12
12
|
mode
|
|
13
|
+
},
|
|
14
|
+
babelCustomizationForLibrary: {
|
|
15
|
+
babelPlugins
|
|
13
16
|
}
|
|
14
17
|
} = (0, _utils.getOptions)();
|
|
15
|
-
|
|
18
|
+
const isProd = mode.toLowerCase() === 'prod';
|
|
19
|
+
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
|
20
|
+
__DOCS__: false
|
|
21
|
+
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-proposal-optional-chaining'), require.resolve('@babel/plugin-proposal-class-properties')];
|
|
22
|
+
const plugins = [...babelPlugins, ...defaultPlugins];
|
|
16
23
|
|
|
17
24
|
var _default = () => ({
|
|
18
|
-
presets: [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react')],
|
|
19
|
-
plugins:
|
|
20
|
-
__DOCS__: false
|
|
21
|
-
} : {}]]
|
|
25
|
+
presets: [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react'), require.resolve('@babel/preset-typescript')],
|
|
26
|
+
plugins: plugins
|
|
22
27
|
});
|
|
23
28
|
|
|
24
29
|
exports.default = _default;
|
|
@@ -7,13 +7,21 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _utils = require("../utils");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const {
|
|
11
11
|
module: {
|
|
12
12
|
mode,
|
|
13
13
|
disableES5Transpile
|
|
14
|
+
},
|
|
15
|
+
babelCustomizationForLibrary: {
|
|
16
|
+
babelPlugins
|
|
14
17
|
}
|
|
15
18
|
} = (0, _utils.getOptions)();
|
|
16
|
-
|
|
19
|
+
const isProd = mode.toLowerCase() === 'prod';
|
|
20
|
+
const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
|
|
21
|
+
__DOCS__: false
|
|
22
|
+
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-proposal-optional-chaining'), require.resolve('@babel/plugin-proposal-class-properties')];
|
|
23
|
+
const plugins = [...babelPlugins, ...defaultPlugins];
|
|
24
|
+
console.log(disableES5Transpile);
|
|
17
25
|
|
|
18
26
|
var _default = () => ({
|
|
19
27
|
presets: [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
|
|
@@ -25,10 +33,8 @@ var _default = () => ({
|
|
|
25
33
|
}
|
|
26
34
|
} : {
|
|
27
35
|
modules: false
|
|
28
|
-
}], require.resolve('@babel/preset-react')],
|
|
29
|
-
plugins:
|
|
30
|
-
__DOCS__: false
|
|
31
|
-
} : {}], require.resolve('@babel/plugin-syntax-dynamic-import')]
|
|
36
|
+
}], require.resolve('@babel/preset-react'), require.resolve('@babel/preset-typescript')],
|
|
37
|
+
plugins: plugins
|
|
32
38
|
});
|
|
33
39
|
|
|
34
40
|
exports.default = _default;
|
|
@@ -42,7 +42,8 @@ const {
|
|
|
42
42
|
sourcemap,
|
|
43
43
|
crossorigin,
|
|
44
44
|
postCssPluginOrder,
|
|
45
|
-
externals
|
|
45
|
+
externals,
|
|
46
|
+
enableMjsLoader
|
|
46
47
|
}
|
|
47
48
|
} = options;
|
|
48
49
|
const {
|
|
@@ -100,7 +101,11 @@ module.exports = {
|
|
|
100
101
|
|
|
101
102
|
return false;
|
|
102
103
|
}
|
|
103
|
-
},
|
|
104
|
+
}, enableMjsLoader ? {
|
|
105
|
+
test: /\.mjs$/,
|
|
106
|
+
include: /node_modules/,
|
|
107
|
+
type: 'javascript/auto'
|
|
108
|
+
} : null, seperateCssModules ? {
|
|
104
109
|
test: /\.css$/,
|
|
105
110
|
exclude: /\.module\.css$/,
|
|
106
111
|
use: (0, _loaderUtils.getCSSLoaders)({
|
|
@@ -141,6 +146,10 @@ module.exports = {
|
|
|
141
146
|
minimize: true
|
|
142
147
|
}
|
|
143
148
|
}]
|
|
149
|
+
}, {
|
|
150
|
+
test: /\.ts$/,
|
|
151
|
+
use: 'ts-loader',
|
|
152
|
+
include: _path.default.join(appPath, folder)
|
|
144
153
|
}, {
|
|
145
154
|
test: /\.worker.js$/,
|
|
146
155
|
use: {
|
|
@@ -127,7 +127,7 @@ module.exports = {
|
|
|
127
127
|
}
|
|
128
128
|
} : {
|
|
129
129
|
modules: false
|
|
130
|
-
}], require.resolve('@babel/preset-react')],
|
|
130
|
+
}], require.resolve('@babel/preset-react'), require.resolve('@babel/preset-typescript')],
|
|
131
131
|
plugins: disableES5Transpile ? [removeAttribute ? require.resolve('../utils/removeAttributes') : false, require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('babel-plugin-lodash'), require.resolve('@babel/plugin-proposal-object-rest-spread'), shouldRemovePropTypes ? [require.resolve('babel-plugin-transform-react-remove-prop-types'), removePropTypes] : false, devConsoleExculde ? [require.resolve('babel-plugin-transform-remove-console'), {
|
|
132
132
|
exclude: ['error', 'log']
|
|
133
133
|
}] : null].filter(Boolean) : [removeAttribute ? require.resolve('../utils/removeAttributes') : false, shouldRemovePropTypes ? [require.resolve('babel-plugin-transform-react-remove-prop-types'), removePropTypes] : false, [require.resolve('@babel/plugin-transform-runtime'), {
|
|
@@ -230,6 +230,10 @@ module.exports = {
|
|
|
230
230
|
minimize: false
|
|
231
231
|
}
|
|
232
232
|
}]
|
|
233
|
+
}, {
|
|
234
|
+
test: /\.ts$/,
|
|
235
|
+
use: 'ts-loader',
|
|
236
|
+
include: _path.default.join(appPath, folder)
|
|
233
237
|
}, {
|
|
234
238
|
test: /\.worker.js$/,
|
|
235
239
|
use: {
|
package/lib/schemas/index.js
CHANGED
|
@@ -129,6 +129,10 @@ var _default = {
|
|
|
129
129
|
value: '@zohodesk/client_packages_group',
|
|
130
130
|
cli: 'module_resolve_path'
|
|
131
131
|
},
|
|
132
|
+
enableMjsLoader: {
|
|
133
|
+
value: false,
|
|
134
|
+
cli: 'enableMjsLoader'
|
|
135
|
+
},
|
|
132
136
|
customClassNamePrefix: [],
|
|
133
137
|
// this option only for impact testing
|
|
134
138
|
devCssFileBountry: {
|
|
@@ -734,6 +738,9 @@ var _default = {
|
|
|
734
738
|
fileName: null,
|
|
735
739
|
options: null,
|
|
736
740
|
excludeKeys: null
|
|
741
|
+
},
|
|
742
|
+
babelCustomizationForLibrary: {
|
|
743
|
+
babelPlugins: []
|
|
737
744
|
}
|
|
738
745
|
};
|
|
739
746
|
exports.default = _default;
|