mirror of https://github.com/alibaba/ice.git
fix: bump @swc/helpers to 0.5.1 (#6213)
* fix: bump @swc/helpers to 0.5.1 * fix: cjs path of @swc/helpers * fix: test case
This commit is contained in:
parent
6e9c822af8
commit
b226e3566f
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@ice/webpack-config': patch
|
||||
---
|
||||
|
||||
fix: use standard cjs module
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@ice/app': patch
|
||||
---
|
||||
|
||||
fix: bump @swc/helpers to 0.5.1
|
|
@ -42,7 +42,7 @@
|
|||
"@ice/route-manifest": "1.1.1",
|
||||
"@ice/runtime": "^1.1.5",
|
||||
"@ice/webpack-config": "1.0.12",
|
||||
"@swc/helpers": "0.4.14",
|
||||
"@swc/helpers": "0.5.1",
|
||||
"@types/express": "^4.17.14",
|
||||
"address": "^1.1.2",
|
||||
"build-scripts": "^2.1.0",
|
||||
|
|
|
@ -43,7 +43,7 @@ const transformImport = async (source: string, coreJsPath: string) => {
|
|||
if (matchImport) {
|
||||
const [,identifier] = matchImport;
|
||||
const replaceModule = `var ${identifier} = require('${targetImport.n.replace(/@swc\/helpers\/src\/(.*).mjs$/,
|
||||
(_, matched) => `@swc/helpers/lib/${matched}.js`)}').default`;
|
||||
(_, matched) => `@swc/helpers/cjs/${matched}.cjs`)}')._`;
|
||||
str().overwrite(targetImport.ss, targetImport.se, replaceModule);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,6 @@ describe('transform core js path', () => {
|
|||
it('@swc/helpers cjs', async () => {
|
||||
const orignalCode = fs.readFileSync(path.join(__dirname, './fixtures/transformImport/swc.js'), 'utf-8');
|
||||
expect(await transformImport(orignalCode, coreJsPath))
|
||||
.toBe('var _object_spread = require(\'@swc/helpers/lib/_object_spread.js\').default;module.exports = {};');
|
||||
.toBe('var _object_spread = require(\'@swc/helpers/cjs/_object_spread.cjs\')._;module.exports = {};');
|
||||
});
|
||||
});
|
|
@ -988,7 +988,7 @@ importers:
|
|||
'@ice/route-manifest': 1.1.1
|
||||
'@ice/runtime': ^1.1.5
|
||||
'@ice/webpack-config': 1.0.12
|
||||
'@swc/helpers': 0.4.14
|
||||
'@swc/helpers': 0.5.1
|
||||
'@types/babel__generator': ^7.6.4
|
||||
'@types/babel__traverse': ^7.17.1
|
||||
'@types/cross-spawn': ^6.0.2
|
||||
|
@ -1040,7 +1040,7 @@ importers:
|
|||
'@ice/route-manifest': link:../route-manifest
|
||||
'@ice/runtime': link:../runtime
|
||||
'@ice/webpack-config': link:../webpack-config
|
||||
'@swc/helpers': 0.4.14
|
||||
'@swc/helpers': 0.5.1
|
||||
'@types/express': 4.17.17
|
||||
address: 1.2.2
|
||||
build-scripts: 2.1.0
|
||||
|
@ -6507,6 +6507,12 @@ packages:
|
|||
tslib: 2.5.0
|
||||
dev: false
|
||||
|
||||
/@swc/helpers/0.5.1:
|
||||
resolution: {integrity: sha512-sJ902EfIzn1Fa+qYmjdQqh8tPsoxyBz+8yBKC2HKUxyezKJFwPGOn7pv4WY6QuQW//ySQi5lJjA/ZT9sNWWNTg==}
|
||||
dependencies:
|
||||
tslib: 2.5.0
|
||||
dev: false
|
||||
|
||||
/@szmarczak/http-timer/1.1.2:
|
||||
resolution: {integrity: sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==}
|
||||
engines: {node: '>=6'}
|
||||
|
|
Loading…
Reference in New Issue