babel-plugin-transform-taroapi 4.1.9 → 4.1.10-beta.0
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-plugin-transform-taroapi",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.10-beta.0",
|
|
4
4
|
"author": "O2Team",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"test": "vitest run",
|
|
27
27
|
"test:ci": "vitest run --coverage",
|
|
28
28
|
"test:dev": "vitest",
|
|
29
|
-
"updateSnapshot": "vitest run --
|
|
29
|
+
"updateSnapshot": "vitest run --update"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -101,105 +101,3 @@ _getStorage();
|
|
|
101
101
|
_setStorage();
|
|
102
102
|
export { Taro };"
|
|
103
103
|
`;
|
|
104
|
-
|
|
105
|
-
exports[`babel-plugin-transform-taroapi should canIUse support scheme with numeric attributes! 1`] = `
|
|
106
|
-
"import { canIUse as _canUse } from '@tarojs/taro-h5';
|
|
107
|
-
// 入参带有数字属性的对象路径
|
|
108
|
-
true;
|
|
109
|
-
true;"
|
|
110
|
-
`;
|
|
111
|
-
|
|
112
|
-
exports[`babel-plugin-transform-taroapi should canIUse support! 1`] = `
|
|
113
|
-
"import { canIUse as _canUse } from '@tarojs/taro-h5';
|
|
114
|
-
// 对象的属性或方法
|
|
115
|
-
false;
|
|
116
|
-
false;
|
|
117
|
-
false;
|
|
118
|
-
false;
|
|
119
|
-
|
|
120
|
-
// 接口参数、回调或者返回值
|
|
121
|
-
true;
|
|
122
|
-
false;
|
|
123
|
-
false;
|
|
124
|
-
false;
|
|
125
|
-
false;
|
|
126
|
-
true;
|
|
127
|
-
|
|
128
|
-
// 组件的属性
|
|
129
|
-
true;
|
|
130
|
-
true;
|
|
131
|
-
true;"
|
|
132
|
-
`;
|
|
133
|
-
|
|
134
|
-
exports[`babel-plugin-transform-taroapi should canIUse work or skip! 1`] = `
|
|
135
|
-
"import Taro from '@tarojs/taro-h5';
|
|
136
|
-
function canIUse() {}
|
|
137
|
-
false;
|
|
138
|
-
false;
|
|
139
|
-
canIUse('showToast.object.image');"
|
|
140
|
-
`;
|
|
141
|
-
|
|
142
|
-
exports[`babel-plugin-transform-taroapi should leave other apis untouched 1`] = `
|
|
143
|
-
"import Taro from '@tarojs/taro-h5';
|
|
144
|
-
Taro.noop;"
|
|
145
|
-
`;
|
|
146
|
-
|
|
147
|
-
exports[`babel-plugin-transform-taroapi should move static apis under "Taro" 1`] = `
|
|
148
|
-
"import Taro from '@tarojs/taro-h5';
|
|
149
|
-
Taro.noop;
|
|
150
|
-
Taro.noop();"
|
|
151
|
-
`;
|
|
152
|
-
|
|
153
|
-
exports[`babel-plugin-transform-taroapi should not go wrong when using an api twice 1`] = `
|
|
154
|
-
"import Taro, { createAnimation as _createAnimation } from '@tarojs/taro-h5';
|
|
155
|
-
const animation = _createAnimation({
|
|
156
|
-
duration: dura * 1000,
|
|
157
|
-
timingFunction: 'linear'
|
|
158
|
-
});
|
|
159
|
-
const resetAnimation = _createAnimation({
|
|
160
|
-
duration: 0,
|
|
161
|
-
timingFunction: 'linear'
|
|
162
|
-
});"
|
|
163
|
-
`;
|
|
164
|
-
|
|
165
|
-
exports[`babel-plugin-transform-taroapi should not import taro duplicity 1`] = `
|
|
166
|
-
"import Taro, { createAnimation as _createAnimation, initPxTransform as _initPxTransform } from '@tarojs/taro-h5';
|
|
167
|
-
Taro.Component;
|
|
168
|
-
_createAnimation();
|
|
169
|
-
_initPxTransform();"
|
|
170
|
-
`;
|
|
171
|
-
|
|
172
|
-
exports[`babel-plugin-transform-taroapi should preserve assignments in left hands 1`] = `
|
|
173
|
-
"import Taro, { createAnimation as _createAnimation, request as _request } from '@tarojs/taro-h5';
|
|
174
|
-
let animation;
|
|
175
|
-
animation = _createAnimation({
|
|
176
|
-
transformOrigin: "50% 50%",
|
|
177
|
-
duration: 1000,
|
|
178
|
-
timingFunction: "ease",
|
|
179
|
-
delay: 0
|
|
180
|
-
});
|
|
181
|
-
_request();
|
|
182
|
-
Taro.request = '';
|
|
183
|
-
Taro['request'] = '';"
|
|
184
|
-
`;
|
|
185
|
-
|
|
186
|
-
exports[`babel-plugin-transform-taroapi should preserve default imports 1`] = `
|
|
187
|
-
"import Taro from '@tarojs/taro-h5';
|
|
188
|
-
console.log(Taro);"
|
|
189
|
-
`;
|
|
190
|
-
|
|
191
|
-
exports[`babel-plugin-transform-taroapi should support rename of imported names 1`] = `
|
|
192
|
-
"// import { inject as mobxInject, observer as mobxObserver } from '@tarojs/mobx'
|
|
193
|
-
import Taro from '@tarojs/taro-h5';
|
|
194
|
-
export class Connected extends Taro.Component {}"
|
|
195
|
-
`;
|
|
196
|
-
|
|
197
|
-
exports[`babel-plugin-transform-taroapi should work! 1`] = `
|
|
198
|
-
"import Taro, { setStorage as _setStorage, initPxTransform as _initPxTransform, getStorage as _getStorage } from '@tarojs/taro-h5';
|
|
199
|
-
_initPxTransform(Taro.param);
|
|
200
|
-
_initPxTransform();
|
|
201
|
-
_initPxTransform();
|
|
202
|
-
_getStorage();
|
|
203
|
-
_setStorage();
|
|
204
|
-
export { Taro };"
|
|
205
|
-
`;
|
|
@@ -94,98 +94,3 @@ _getStorage();
|
|
|
94
94
|
_setStorage();
|
|
95
95
|
export { Taro };"
|
|
96
96
|
`;
|
|
97
|
-
|
|
98
|
-
exports[`babel-plugin-transform-taroapi should canIUse support! 1`] = `
|
|
99
|
-
"import { canIUse as _canUse } from '@tarojs/taro-h5';
|
|
100
|
-
// 对象的属性或方法
|
|
101
|
-
false;
|
|
102
|
-
false;
|
|
103
|
-
false;
|
|
104
|
-
false;
|
|
105
|
-
|
|
106
|
-
// 接口参数、回调或者返回值
|
|
107
|
-
true;
|
|
108
|
-
false;
|
|
109
|
-
false;
|
|
110
|
-
false;
|
|
111
|
-
false;
|
|
112
|
-
true;
|
|
113
|
-
|
|
114
|
-
// 组件的属性
|
|
115
|
-
true;
|
|
116
|
-
true;
|
|
117
|
-
false;"
|
|
118
|
-
`;
|
|
119
|
-
|
|
120
|
-
exports[`babel-plugin-transform-taroapi should canIUse work or skip! 1`] = `
|
|
121
|
-
"import Taro from '@tarojs/taro-h5';
|
|
122
|
-
function canIUse() {}
|
|
123
|
-
false;
|
|
124
|
-
false;
|
|
125
|
-
canIUse('showToast.object.image');"
|
|
126
|
-
`;
|
|
127
|
-
|
|
128
|
-
exports[`babel-plugin-transform-taroapi should leave other apis untouched 1`] = `
|
|
129
|
-
"import Taro from '@tarojs/taro-h5';
|
|
130
|
-
Taro.noop;"
|
|
131
|
-
`;
|
|
132
|
-
|
|
133
|
-
exports[`babel-plugin-transform-taroapi should move static apis under "Taro" 1`] = `
|
|
134
|
-
"import Taro from '@tarojs/taro-h5';
|
|
135
|
-
Taro.noop;
|
|
136
|
-
Taro.noop();"
|
|
137
|
-
`;
|
|
138
|
-
|
|
139
|
-
exports[`babel-plugin-transform-taroapi should not go wrong when using an api twice 1`] = `
|
|
140
|
-
"import Taro, { createAnimation as _createAnimation } from '@tarojs/taro-h5';
|
|
141
|
-
const animation = _createAnimation({
|
|
142
|
-
duration: dura * 1000,
|
|
143
|
-
timingFunction: 'linear'
|
|
144
|
-
});
|
|
145
|
-
const resetAnimation = _createAnimation({
|
|
146
|
-
duration: 0,
|
|
147
|
-
timingFunction: 'linear'
|
|
148
|
-
});"
|
|
149
|
-
`;
|
|
150
|
-
|
|
151
|
-
exports[`babel-plugin-transform-taroapi should not import taro duplicity 1`] = `
|
|
152
|
-
"import Taro, { createAnimation as _createAnimation, initPxTransform as _initPxTransform } from '@tarojs/taro-h5';
|
|
153
|
-
Taro.Component;
|
|
154
|
-
_createAnimation();
|
|
155
|
-
_initPxTransform();"
|
|
156
|
-
`;
|
|
157
|
-
|
|
158
|
-
exports[`babel-plugin-transform-taroapi should preserve assignments in left hands 1`] = `
|
|
159
|
-
"import Taro, { createAnimation as _createAnimation, request as _request } from '@tarojs/taro-h5';
|
|
160
|
-
let animation;
|
|
161
|
-
animation = _createAnimation({
|
|
162
|
-
transformOrigin: "50% 50%",
|
|
163
|
-
duration: 1000,
|
|
164
|
-
timingFunction: "ease",
|
|
165
|
-
delay: 0
|
|
166
|
-
});
|
|
167
|
-
_request();
|
|
168
|
-
Taro.request = '';
|
|
169
|
-
Taro['request'] = '';"
|
|
170
|
-
`;
|
|
171
|
-
|
|
172
|
-
exports[`babel-plugin-transform-taroapi should preserve default imports 1`] = `
|
|
173
|
-
"import Taro from '@tarojs/taro-h5';
|
|
174
|
-
console.log(Taro);"
|
|
175
|
-
`;
|
|
176
|
-
|
|
177
|
-
exports[`babel-plugin-transform-taroapi should support rename of imported names 1`] = `
|
|
178
|
-
"// import { inject as mobxInject, observer as mobxObserver } from '@tarojs/mobx'
|
|
179
|
-
import Taro from '@tarojs/taro-h5';
|
|
180
|
-
export class Connected extends Taro.Component {}"
|
|
181
|
-
`;
|
|
182
|
-
|
|
183
|
-
exports[`babel-plugin-transform-taroapi should work! 1`] = `
|
|
184
|
-
"import Taro, { setStorage as _setStorage, initPxTransform as _initPxTransform, getStorage as _getStorage } from '@tarojs/taro-h5';
|
|
185
|
-
_initPxTransform(Taro.param);
|
|
186
|
-
_initPxTransform();
|
|
187
|
-
_initPxTransform();
|
|
188
|
-
_getStorage();
|
|
189
|
-
_setStorage();
|
|
190
|
-
export { Taro };"
|
|
191
|
-
`;
|
|
File without changes
|