babel-plugin-transform-modules-ui5 7.7.0 → 7.7.1
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.7.1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.7.0...v7.7.1) (2025-05-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* autoConvertControllerClass to consider controller.ts file as well (not just .js) ([#140](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/140)) ([788705d](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/788705dde44091cfecb47e9f51a5bd294b39af4b)), closes [#139](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/139)
|
|
12
|
+
* noWrapBeforeImport must wrap first import if no code is before ([#141](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/141)) ([d80c070](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/d80c070e181b03546d381d8ee2fb0ddfc09d4e5a))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
# [7.7.0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.6.2...v7.7.0) (2024-09-16)
|
|
7
19
|
|
|
8
20
|
|
package/dist/classes/visitor.js
CHANGED
|
@@ -203,7 +203,8 @@ function shouldConvertClass(file, node, opts, classInfo) {
|
|
|
203
203
|
if (classInfo.name || classInfo.alias || classInfo.controller || classInfo.namespace) {
|
|
204
204
|
return true;
|
|
205
205
|
}
|
|
206
|
-
|
|
206
|
+
// Convert controller classes
|
|
207
|
+
if (/.*[.]controller[.](js|ts)$/.test(file.opts.filename) && opts.autoConvertControllerClass !== false) {
|
|
207
208
|
return true;
|
|
208
209
|
}
|
|
209
210
|
return false;
|
|
@@ -89,6 +89,11 @@ function wrap(visitor, programNode, opts) {
|
|
|
89
89
|
let reachedFirstImport = false;
|
|
90
90
|
const fullBody = body;
|
|
91
91
|
const newBody = [];
|
|
92
|
+
|
|
93
|
+
// If there is no lastBeforeWrapping, the first import is not marked
|
|
94
|
+
if (!fullBody.find(item => item.lastBeforeWrapping)) {
|
|
95
|
+
reachedFirstImport = true;
|
|
96
|
+
}
|
|
92
97
|
for (const item of fullBody) {
|
|
93
98
|
if (reachedFirstImport) {
|
|
94
99
|
newBody.push(item);
|
package/dist/modules/visitor.js
CHANGED
|
@@ -198,9 +198,13 @@ const ModuleTransformVisitor = exports.ModuleTransformVisitor = {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
// this is the very first import in noWrapBeforeImport mode and there are sibling nodes before this import
|
|
201
|
-
if (opts.noWrapBeforeImport && !this.firstImportMarked && path.inList
|
|
202
|
-
//
|
|
203
|
-
|
|
201
|
+
if (opts.noWrapBeforeImport && !this.firstImportMarked && path.inList) {
|
|
202
|
+
// for the first element there is a special case as we can't mark the previous one
|
|
203
|
+
// therefore we do not mark anything to make clear that there's nothing to exclude
|
|
204
|
+
if (path.key > 0) {
|
|
205
|
+
// mark the direct predecessor as the last one to exclude from wrapping
|
|
206
|
+
path.getSibling(path.key - 1).node.lastBeforeWrapping = true;
|
|
207
|
+
}
|
|
204
208
|
this.firstImportMarked = true;
|
|
205
209
|
}
|
|
206
210
|
path.replaceWithMultiple(deconstructors);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-plugin-transform-modules-ui5",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.1",
|
|
4
4
|
"description": "An unofficial babel plugin for SAP UI5.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"prettier": "^3.3.3",
|
|
97
97
|
"rimraf": "^6.0.1"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "68d15e65c70e6dd5f35fc0fe47660131bb3d1a34"
|
|
100
100
|
}
|