babel-plugin-transform-modules-ui5 7.8.1 → 7.10.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/CHANGELOG.md +99 -152
- package/README.md +5 -0
- package/dist/classes/helpers/classes.js +18 -3
- package/dist/classes/helpers/jsdoc.js +25 -19
- package/dist/index.js +2 -0
- package/dist/modules/helpers/wrapper.js +9 -3
- package/dist/modules/visitor.js +13 -2
- package/dist/utils/ast.js +4 -5
- package/package.json +32 -38
- package/LICENSE +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,305 +1,252 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
3
|
+
## 7.10.0
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
### Minor Changes
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
- [#154](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/154) [`f62f9fb`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/f62f9fba1a64dea2673662dd163fcc1eb5cff540) Thanks [@bbogovich-sap](https://github.com/bbogovich-sap)! - Add two comment pragmas to opt out of module transformation:
|
|
9
8
|
|
|
9
|
+
- `/* @ui5-no-wrap */` (file level) leaves a module completely unwrapped —
|
|
10
|
+
no `sap.ui.define`/`sap.ui.require` and no import/export rewriting — while
|
|
11
|
+
still stripping TypeScript types. Intended for modules consumed as native
|
|
12
|
+
ES modules, e.g. web workers.
|
|
13
|
+
- `/* @ui5-ignore-import */` (statement level) excludes a single static
|
|
14
|
+
`import` or dynamic `import()` from being converted into a UI5 dependency.
|
|
10
15
|
|
|
16
|
+
Note: `@ui5-ignore-import` on a static import only yields valid output in an
|
|
17
|
+
unwrapped module (no exports, or together with `@ui5-no-wrap`); a leftover
|
|
18
|
+
ES `import` inside a `sap.ui.define` factory is not valid at runtime.
|
|
11
19
|
|
|
20
|
+
## 7.9.0
|
|
12
21
|
|
|
22
|
+
### Minor Changes
|
|
13
23
|
|
|
14
|
-
|
|
24
|
+
- [#151](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/151) [`ce059b3`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/ce059b343a43960de9dca8ef1d19a0ab70c51fde) Thanks [@petermuessig](https://github.com/petermuessig)! - Raise minimum Node.js version to 20.19, refresh dev dependencies, and migrate ESLint to v9 flat config.
|
|
15
25
|
|
|
26
|
+
- `engines.node` is now `>=20.19.0` for both packages.
|
|
27
|
+
- ESLint upgraded to 9.x with new `eslint.config.js` (legacy `.eslintrc.js` and `.eslintignore` removed).
|
|
28
|
+
- `eslint-plugin-node` (unmaintained) replaced by `eslint-plugin-n@17`.
|
|
29
|
+
- Removed obsolete dev dependencies: `babel-eslint` (superseded by `@babel/eslint-parser`), `eslint-config-standard`, `eslint-plugin-standard`.
|
|
30
|
+
- Bumped `eslint-config-prettier` to 10.x, `eslint-plugin-prettier` to 5.5.x, `eslint-plugin-promise` to 7.x, `prettier` to 3.8.x, `jest`/`babel-jest` to 30.4.x, `core-js` to 3.49.x.
|
|
31
|
+
- CI matrix updated from Node 18/20/22/24 to 20/22/24.
|
|
16
32
|
|
|
17
|
-
|
|
33
|
+
No changes to plugin runtime behavior or production dependencies.
|
|
18
34
|
|
|
19
|
-
|
|
35
|
+
### Patch Changes
|
|
20
36
|
|
|
37
|
+
- [#151](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/151) [`ce059b3`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/ce059b343a43960de9dca8ef1d19a0ab70c51fde) Thanks [@petermuessig](https://github.com/petermuessig)! - Bump `eslint-plugin-n` from 17.24 to 18.2.1.
|
|
21
38
|
|
|
39
|
+
This stays compatible with our Node 20.19+ floor (the plugin's
|
|
40
|
+
`engines.node` is `^20.19.0 || ^22.13.0 || >=24`). ESLint 10 itself
|
|
41
|
+
is deliberately held back — see [`DEPENDENCIES.md`](../DEPENDENCIES.md)
|
|
42
|
+
for the full reasoning.
|
|
22
43
|
|
|
44
|
+
- [#151](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/151) [`ce059b3`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/ce059b343a43960de9dca8ef1d19a0ab70c51fde) Thanks [@petermuessig](https://github.com/petermuessig)! - Bump dev-only dependencies to their latest minor releases:
|
|
23
45
|
|
|
46
|
+
- `globals` 17.6 → 17.7
|
|
47
|
+
- `prettier` 3.8 → 3.9
|
|
24
48
|
|
|
25
|
-
|
|
49
|
+
Both stay within the Node 20.19+ support window declared in our Node.js
|
|
50
|
+
support policy. No plugin behavior changes.
|
|
26
51
|
|
|
52
|
+
- [#151](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/151) [`ce059b3`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/ce059b343a43960de9dca8ef1d19a0ab70c51fde) Thanks [@petermuessig](https://github.com/petermuessig)! - Drop three small, single-purpose runtime dependencies in favor of built-ins:
|
|
27
53
|
|
|
28
|
-
|
|
54
|
+
- `array-flatten` → `Array.prototype.flat(Infinity)`
|
|
55
|
+
- `ignore-case` → `String.prototype.toLowerCase()` comparison
|
|
56
|
+
- `object-assign-defined` → inlined 8-line helper
|
|
29
57
|
|
|
30
|
-
|
|
31
|
-
|
|
58
|
+
No change in behavior; the plugin's runtime now ships only with `doctrine`
|
|
59
|
+
as a production dependency.
|
|
32
60
|
|
|
61
|
+
- [#151](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/pull/151) [`ce059b3`](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/ce059b343a43960de9dca8ef1d19a0ab70c51fde) Thanks [@petermuessig](https://github.com/petermuessig)! - Fix JSDoc parsing failures (issue [#150](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/150)) by replacing the deprecated
|
|
62
|
+
`doctrine` parser with the actively maintained `comment-parser`.
|
|
33
63
|
|
|
64
|
+
`doctrine` has been unmaintained since 2018 and stops parsing a JSDoc
|
|
65
|
+
block as soon as it encounters a tag it does not recognise (e.g. an
|
|
66
|
+
optional `@param`, or a bare `@class`). As a result, plugin markers
|
|
67
|
+
like `@alias`, `@namespace`, `@nonUI5` or `@controller` that appeared
|
|
68
|
+
after such a tag were silently ignored and the class was left
|
|
69
|
+
untransformed.
|
|
34
70
|
|
|
71
|
+
`comment-parser` is purely structural and never bails — every tag in
|
|
72
|
+
the block is returned, regardless of order or content. The migration
|
|
73
|
+
is internal; no plugin option or fixture authoring change is required.
|
|
35
74
|
|
|
75
|
+
Three regression fixtures were added under
|
|
76
|
+
`packages/plugin/__test__/fixtures/classes/` covering the patterns
|
|
77
|
+
reported in the issue: a value tag (`@alias`) after an optional
|
|
78
|
+
`@param`, a bool flag (`@nonUI5`) after multiple optional params,
|
|
79
|
+
and a bare `@class` followed by `@namespace`/`@controller`.
|
|
36
80
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### Features
|
|
41
|
-
|
|
42
|
-
* update dependencies / add peer dependency to @babel/core ([#135](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/135)) ([d155e48](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/d155e48a4a3737ebcf4a7e77318391bbce783e70)), closes [#133](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/133)
|
|
81
|
+
All notable changes to this project will be documented in this file.
|
|
82
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
43
83
|
|
|
84
|
+
## [7.8.1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.8.0...v7.8.1) (2025-12-29)
|
|
44
85
|
|
|
86
|
+
**Note:** Version bump only for package babel-plugin-transform-modules-ui5
|
|
45
87
|
|
|
88
|
+
# [7.8.0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.7.1...v7.8.0) (2025-09-11)
|
|
46
89
|
|
|
90
|
+
### Features
|
|
47
91
|
|
|
48
|
-
|
|
92
|
+
- support optional super call ([#143](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/143)) ([e09f561](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/e09f5617eb98b082e1630caa2d23801d3fc91650))
|
|
49
93
|
|
|
94
|
+
## [7.7.1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.7.0...v7.7.1) (2025-05-13)
|
|
50
95
|
|
|
51
96
|
### Bug Fixes
|
|
52
97
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
98
|
+
- 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)
|
|
99
|
+
- 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))
|
|
56
100
|
|
|
101
|
+
# [7.7.0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.6.2...v7.7.0) (2024-09-16)
|
|
57
102
|
|
|
103
|
+
### Features
|
|
58
104
|
|
|
59
|
-
|
|
105
|
+
- update dependencies / add peer dependency to @babel/core ([#135](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/135)) ([d155e48](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/d155e48a4a3737ebcf4a7e77318391bbce783e70)), closes [#133](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/133)
|
|
60
106
|
|
|
107
|
+
## [7.6.2](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.6.1...v7.6.2) (2024-09-14)
|
|
61
108
|
|
|
62
109
|
### Bug Fixes
|
|
63
110
|
|
|
64
|
-
|
|
65
|
-
|
|
111
|
+
- move qunit config autostart out of require/define ([#134](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/134)) ([9643cd0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/9643cd08314ce54816886df6c618fbb142c1b3e8))
|
|
66
112
|
|
|
113
|
+
## [7.6.1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.6.0...v7.6.1) (2024-09-13)
|
|
67
114
|
|
|
115
|
+
### Bug Fixes
|
|
68
116
|
|
|
117
|
+
- support wrapped controller extension assignments ([dfa51b6](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/dfa51b613259aeedb3f20987f5e5165ca35545d8))
|
|
69
118
|
|
|
70
119
|
# [7.6.0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.5.0...v7.6.0) (2024-07-22)
|
|
71
120
|
|
|
72
|
-
|
|
73
121
|
### Features
|
|
74
122
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
123
|
+
- support sap.ui.require for [@sap](https://github.com/sap)UiRequire annotated modules ([#131](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/131)) ([23c4ac6](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/23c4ac67eef5a825692c528852ef62bbd621d13e))
|
|
80
124
|
|
|
81
125
|
# [7.5.0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.4.2...v7.5.0) (2024-07-12)
|
|
82
126
|
|
|
83
|
-
|
|
84
127
|
### Features
|
|
85
128
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
129
|
+
- support ControllerExtensions extended with .override(...) ([#128](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/128)) ([f744d9d](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/f744d9db3dd82020712b47a18ce55ed51a13fe89))
|
|
91
130
|
|
|
92
131
|
## [7.4.2](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.4.1...v7.4.2) (2024-06-25)
|
|
93
132
|
|
|
94
|
-
|
|
95
133
|
### Bug Fixes
|
|
96
134
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
135
|
+
- remove mandatory ESM file extensions from sap.ui.define imports ([#129](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/129)) ([571dfa1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/571dfa192984c9838c573909546b42a85b71e5b6))
|
|
102
136
|
|
|
103
137
|
## [7.4.1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.4.0...v7.4.1) (2024-06-02)
|
|
104
138
|
|
|
105
|
-
|
|
106
139
|
### Bug Fixes
|
|
107
140
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
141
|
+
- ensure to remove file ext .js only from module path ([#127](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/127)) ([c6afb92](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/c6afb92c2f758a245086baa6f77d3274bb4e5466))
|
|
113
142
|
|
|
114
143
|
# [7.4.0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.3.1...v7.4.0) (2024-05-31)
|
|
115
144
|
|
|
116
|
-
|
|
117
145
|
### Bug Fixes
|
|
118
146
|
|
|
119
|
-
|
|
120
|
-
|
|
147
|
+
- remove empty export declaration added by TypeScript ([3cb14cf](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/3cb14cf7aefd400d0191d364f457c66452edc32a)), closes [/github.com/babel/babel/blob/main/packages/babel-plugin-transform-typescript/src/index.ts#L399](https://github.com//github.com/babel/babel/blob/main/packages/babel-plugin-transform-typescript/src/index.ts/issues/L399)
|
|
121
148
|
|
|
122
149
|
### Features
|
|
123
150
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
151
|
+
- imports added by other plugins are also included in the sap.ui.define calls ([#126](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/126)) ([895fe62](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/895fe624df66a6db1b9daa5cadce8a984ced5af4))
|
|
129
152
|
|
|
130
153
|
## [7.3.1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.3.0...v7.3.1) (2024-05-12)
|
|
131
154
|
|
|
132
|
-
|
|
133
155
|
### Bug Fixes
|
|
134
156
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
157
|
+
- remove file extensions from imports to avoid redundant extensions ([#125](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/125)) ([e86d6f6](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/e86d6f675451b6eaaaf63f9433200cd7406d0245))
|
|
158
|
+
- support index modules for dependencies ([#123](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/123)) ([f510380](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/f510380f7c201d9aba3e735badea21546f81f03d))
|
|
141
159
|
|
|
142
160
|
# [7.3.0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.2.6...v7.3.0) (2024-01-18)
|
|
143
161
|
|
|
144
|
-
|
|
145
162
|
### Bug Fixes
|
|
146
163
|
|
|
147
|
-
|
|
148
|
-
|
|
164
|
+
- sanitize variable names for re-exports ([#122](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/122)) ([f475dbc](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/f475dbcb4f8b767a5680a974903e7f97df8dacc7))
|
|
149
165
|
|
|
150
166
|
### Features
|
|
151
167
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
168
|
+
- support using predefined controller extensions ([#120](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/120)) ([d7cb66c](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/d7cb66cd5af422529bb00658669e595af2477615))
|
|
157
169
|
|
|
158
170
|
## [7.2.6](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.2.5...v7.2.6) (2023-11-23)
|
|
159
171
|
|
|
160
|
-
|
|
161
172
|
### Bug Fixes
|
|
162
173
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
- preserve comments for class members ([#117](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/117)) ([b5329cb](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/b5329cb80ea0cade6b85fd1d802befa0bc36fe52))
|
|
168
175
|
|
|
169
176
|
## [7.2.5](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.2.4...v7.2.5) (2023-08-28)
|
|
170
177
|
|
|
171
|
-
|
|
172
178
|
### Bug Fixes
|
|
173
179
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
180
|
+
- by default add "use strict" directive to sap.ui.define ([#115](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/115)) ([7d55cc6](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/7d55cc6126258b60728a00f4070ed19b8ffe9339)), closes [#113](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/113)
|
|
179
181
|
|
|
180
182
|
## [7.2.4](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.2.3...v7.2.4) (2023-07-20)
|
|
181
183
|
|
|
182
|
-
|
|
183
184
|
### Bug Fixes
|
|
184
185
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
- ensure template to be ES5 compliant ([#111](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/111)) ([16819bc](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/16819bc91ce1942e0968a0f7efaa4e7cf767b665))
|
|
190
187
|
|
|
191
188
|
## [7.2.3](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.2.2...v7.2.3) (2023-07-18)
|
|
192
189
|
|
|
193
|
-
|
|
194
190
|
### Bug Fixes
|
|
195
191
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
192
|
+
- copyright comment must be appended as leading comment to file ([#108](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/108)) ([8194671](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/81946714f1d48c82a6609ec3fc1c820e5fff9e51))
|
|
201
193
|
|
|
202
194
|
## [7.2.2](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.2.1...v7.2.2) (2023-07-18)
|
|
203
195
|
|
|
204
|
-
|
|
205
196
|
### Bug Fixes
|
|
206
197
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
198
|
+
- ensure copyright to be kept after typescript processing ([#107](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/107)) ([da9aa69](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/da9aa69c94017e085d7f5a22abde04b123d9307d))
|
|
212
199
|
|
|
213
200
|
## [7.2.1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.2.0...v7.2.1) (2023-06-13)
|
|
214
201
|
|
|
215
|
-
|
|
216
202
|
### Bug Fixes
|
|
217
203
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
204
|
+
- add support for import.meta.url|resolve ([#106](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/106)) ([afb1e6d](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/afb1e6daa0fcc9896fd184ac9d66990d0a29214a)), closes [#103](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/103)
|
|
205
|
+
- support for anonymous classes ([#105](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/105)) ([64773d1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/64773d180bf65e544806b9f04b7334cd76831b3d)), closes [#104](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/104)
|
|
224
206
|
|
|
225
207
|
# [7.2.0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.1.5...v7.2.0) (2023-05-30)
|
|
226
208
|
|
|
227
|
-
|
|
228
209
|
### Features
|
|
229
210
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
211
|
+
- split class conversion to enable other Babel plugin conversion ([#100](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/100)) ([4ba096b](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/4ba096b1a24d807cda2fd2f57425f3ab4b91a31b)), closes [#23](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/23) [#25](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/25)
|
|
235
212
|
|
|
236
213
|
## [7.1.5](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.1.4...v7.1.5) (2023-05-30)
|
|
237
214
|
|
|
238
|
-
|
|
239
215
|
### Bug Fixes
|
|
240
216
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
217
|
+
- enable support for TS param props ([#99](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/99)) ([2119b41](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/2119b41fbd5fb41ade7e096190cbebad03eecf7c)), closes [#65](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/65)
|
|
218
|
+
- ensure copyright comments to be leading comments ([#97](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/97)) ([39ab194](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/39ab1946f08d3fc33609bd6b9ac6cda9a985c5d7))
|
|
219
|
+
- sap.ui.define without callback function ([#98](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/98)) ([c1cd6a8](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/c1cd6a8f158de9b5036d9c768c48972d66ae20aa)), closes [#50](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/50)
|
|
248
220
|
|
|
249
221
|
## [7.1.4](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.1.3...v7.1.4) (2023-04-11)
|
|
250
222
|
|
|
251
|
-
|
|
252
223
|
### Bug Fixes
|
|
253
224
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
225
|
+
- properly handle dynamic import of non-existing modules ([#94](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/94)) ([c443b36](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/c443b36d5035d2e2fa367e074d0732336af8eb78))
|
|
259
226
|
|
|
260
227
|
## [7.1.3](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.1.2...v7.1.3) (2023-04-11)
|
|
261
228
|
|
|
262
|
-
|
|
263
229
|
### Bug Fixes
|
|
264
230
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
231
|
+
- dynamic import must not handle __esModule flagged modules ([#93](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/93)) ([b269985](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/b26998540cac0c2c2868bd59198d6f9abfaab8f7))
|
|
270
232
|
|
|
271
233
|
## [7.1.2](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.1.1...v7.1.2) (2023-04-11)
|
|
272
234
|
|
|
273
|
-
|
|
274
235
|
### Bug Fixes
|
|
275
236
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
237
|
+
- dynamic imports of empty modules must not fail ([#92](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/92)) ([a1de75d](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/a1de75dcfcb577bf6fea3669cf448e9183b7d636))
|
|
281
238
|
|
|
282
239
|
## [7.1.1](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.1.0...v7.1.1) (2023-03-27)
|
|
283
240
|
|
|
284
|
-
|
|
285
241
|
### Bug Fixes
|
|
286
242
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
243
|
+
- catch err for dynamic import to sap.ui.require ([#91](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/issues/91)) ([9c7d26e](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/9c7d26e6aeebc77f5d8faec941fbd994b77de222))
|
|
292
244
|
|
|
293
245
|
# [7.1.0](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.0.6...v7.1.0) (2023-03-13)
|
|
294
246
|
|
|
295
|
-
|
|
296
247
|
### Features
|
|
297
248
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
249
|
+
- backward compatibility for overrides (overridesToOverride option) ([dac96e6](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/commit/dac96e685548ccf831893c03e083e6db2dae3d4f))
|
|
303
250
|
|
|
304
251
|
## [7.0.6](https://github.com/ui5-community/babel-plugin-transform-modules-ui5/compare/v7.0.5...v7.0.6) (2023-02-21)
|
|
305
252
|
|
package/README.md
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
There is also a preset which should be used rather than using the plugin directly.
|
|
7
7
|
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
- **Node.js ≥ 20.19**. See the [Node.js support policy](../../CONTRIBUTING.md#nodejs-support-policy) for how we evolve this floor.
|
|
11
|
+
- A Babel 7 toolchain (`@babel/core` 7.x) — the plugin is declared as a peer of `@babel/core`.
|
|
12
|
+
|
|
8
13
|
## Install
|
|
9
14
|
|
|
10
15
|
```sh
|
|
@@ -8,7 +8,6 @@ exports.getClassInfo = getClassInfo;
|
|
|
8
8
|
exports.getTypeName = void 0;
|
|
9
9
|
var _core = require("@babel/core");
|
|
10
10
|
var _path = _interopRequireDefault(require("path"));
|
|
11
|
-
var _objectAssignDefined = _interopRequireDefault(require("object-assign-defined"));
|
|
12
11
|
var th = _interopRequireWildcard(require("../../utils/templates"));
|
|
13
12
|
var ast = _interopRequireWildcard(require("../../utils/ast"));
|
|
14
13
|
var _jsdoc = require("./jsdoc");
|
|
@@ -310,8 +309,24 @@ function getClassInfo(path, node, parent, pluginOpts) {
|
|
|
310
309
|
const decoratorInfo = (0, _decorators.getDecoratorClassInfo)(node);
|
|
311
310
|
const jsDocInfo = (0, _jsdoc.getJsDocClassInfo)(node, parent);
|
|
312
311
|
|
|
313
|
-
// like Object.assign, but ignoring undefined values.
|
|
314
|
-
return (
|
|
312
|
+
// Merge like Object.assign, but ignoring undefined values.
|
|
313
|
+
return assignDefined(defaults, decoratorInfo, jsDocInfo);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Works like Object.assign but skips properties whose value is undefined,
|
|
318
|
+
* preserving the value from the target (or earlier source).
|
|
319
|
+
*/
|
|
320
|
+
function assignDefined(target, ...sources) {
|
|
321
|
+
for (const source of sources) {
|
|
322
|
+
if (!source) continue;
|
|
323
|
+
for (const key of Object.keys(source)) {
|
|
324
|
+
if (source[key] !== undefined) {
|
|
325
|
+
target[key] = source[key];
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return target;
|
|
315
330
|
}
|
|
316
331
|
|
|
317
332
|
/**
|
|
@@ -7,18 +7,30 @@ exports.getJsDocClassInfo = getJsDocClassInfo;
|
|
|
7
7
|
exports.getTags = getTags;
|
|
8
8
|
exports.hasJsdocGlobalExportFlag = hasJsdocGlobalExportFlag;
|
|
9
9
|
var _core = require("@babel/core");
|
|
10
|
-
var
|
|
11
|
-
var _ignoreCase = _interopRequireDefault(require("ignore-case"));
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _commentParser = require("comment-parser");
|
|
13
11
|
const classInfoValueTags = ["alias", "name", "namespace"];
|
|
14
12
|
const classInfoBoolTags = ["nonUI5", "controller", "keepConstructor"];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Parse a babel `CommentBlock`'s `.value` (which omits the surrounding
|
|
16
|
+
* `/*` … `*\/` delimiters) using comment-parser.
|
|
17
|
+
*
|
|
18
|
+
* Returns the list of tags as `{ tag, name, description, type, optional }`.
|
|
19
|
+
* Returns `[]` on empty input or when no tags are present.
|
|
20
|
+
*
|
|
21
|
+
* Unlike doctrine, comment-parser does not bail on unknown or malformed
|
|
22
|
+
* tags — every recognised tag in the block is returned. This is the
|
|
23
|
+
* fix for issue #150 where doctrine stopped at the first tag it could
|
|
24
|
+
* not handle (e.g. optional `@param` followed by a bare `@class`).
|
|
25
|
+
*/
|
|
26
|
+
function parseJsDoc(commentValue) {
|
|
27
|
+
const block = (0, _commentParser.parse)(`/*${commentValue}*/`)[0];
|
|
28
|
+
return block ? block.tags : [];
|
|
29
|
+
}
|
|
15
30
|
function getJsDocClassInfo(node, parent) {
|
|
16
31
|
if (node.leadingComments) {
|
|
17
32
|
return node.leadingComments.filter(isCommentBlock).map(comment => {
|
|
18
|
-
const
|
|
19
|
-
unwrap: true
|
|
20
|
-
});
|
|
21
|
-
const tags = docAST.tags || [];
|
|
33
|
+
const tags = parseJsDoc(comment.value);
|
|
22
34
|
const info = {};
|
|
23
35
|
for (const tagName of classInfoValueTags) {
|
|
24
36
|
const value = getJsDocTagValue(tags, tagName);
|
|
@@ -56,19 +68,15 @@ function getTags(comments) {
|
|
|
56
68
|
if (!isCommentBlock(comment)) {
|
|
57
69
|
continue;
|
|
58
70
|
}
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
});
|
|
62
|
-
const tags = docAST.tags;
|
|
63
|
-
if (!tags || !tags.length) {
|
|
71
|
+
const tags = parseJsDoc(comment.value);
|
|
72
|
+
if (!tags.length) {
|
|
64
73
|
continue;
|
|
65
74
|
}
|
|
66
75
|
const map = {};
|
|
67
76
|
for (const tag of tags) {
|
|
68
|
-
const title = tag.title;
|
|
69
77
|
let value = tag.name || tag.description || true;
|
|
70
78
|
if (value === "false") value = false;
|
|
71
|
-
map[
|
|
79
|
+
map[tag.tag] = value;
|
|
72
80
|
}
|
|
73
81
|
return map;
|
|
74
82
|
}
|
|
@@ -79,7 +87,8 @@ function getJsDocTagValue(tags, name) {
|
|
|
79
87
|
return tag && (tag.name || tag.description);
|
|
80
88
|
}
|
|
81
89
|
function getJsDocTag(tags, name) {
|
|
82
|
-
|
|
90
|
+
const lower = name.toLowerCase();
|
|
91
|
+
return tags.find(tag => tag.tag.toLowerCase() === lower);
|
|
83
92
|
}
|
|
84
93
|
function notEmpty(obj) {
|
|
85
94
|
return Object.values(obj).some(value => value);
|
|
@@ -89,10 +98,7 @@ function hasJsdocGlobalExportFlag(node) {
|
|
|
89
98
|
return false;
|
|
90
99
|
}
|
|
91
100
|
return node.leadingComments.filter(isCommentBlock).some(comment => {
|
|
92
|
-
return
|
|
93
|
-
unwrap: true,
|
|
94
|
-
tags: ["global"]
|
|
95
|
-
}).tags.length > 0;
|
|
101
|
+
return parseJsDoc(comment.value).some(tag => tag.tag === "global");
|
|
96
102
|
});
|
|
97
103
|
}
|
|
98
104
|
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ module.exports = () => {
|
|
|
23
23
|
enter(path, {
|
|
24
24
|
opts
|
|
25
25
|
}) {
|
|
26
|
+
var _path$parent$comments, _path$parent;
|
|
26
27
|
if (this.ran) return;
|
|
27
28
|
this.ran = true;
|
|
28
29
|
if (opts.onlyConvertNamedClass == false) {
|
|
@@ -48,6 +49,7 @@ module.exports = () => {
|
|
|
48
49
|
this.imports = [];
|
|
49
50
|
this.namedExports = [];
|
|
50
51
|
this.injectDynamicImportHelper = false;
|
|
52
|
+
this.noWrap = ((_path$parent$comments = (_path$parent = path.parent) === null || _path$parent === void 0 ? void 0 : _path$parent.comments) !== null && _path$parent$comments !== void 0 ? _path$parent$comments : []).some(c => c.type === "CommentBlock" && c.value.trim() === "@ui5-no-wrap");
|
|
51
53
|
|
|
52
54
|
// Properties for Class Transform
|
|
53
55
|
this.importNames = [];
|
|
@@ -10,7 +10,10 @@ var th = _interopRequireWildcard(require("../../utils/templates"));
|
|
|
10
10
|
var ast = _interopRequireWildcard(require("../../utils/ast"));
|
|
11
11
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
12
|
function wrap(visitor, programNode, opts) {
|
|
13
|
-
var _body;
|
|
13
|
+
var _visitor$parent$comme, _visitor$parent, _body;
|
|
14
|
+
if (hasNoWrapPragma((_visitor$parent$comme = (_visitor$parent = visitor.parent) === null || _visitor$parent === void 0 ? void 0 : _visitor$parent.comments) !== null && _visitor$parent$comme !== void 0 ? _visitor$parent$comme : [])) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
14
17
|
let {
|
|
15
18
|
defaultExport,
|
|
16
19
|
exportGlobal,
|
|
@@ -48,8 +51,8 @@ function wrap(visitor, programNode, opts) {
|
|
|
48
51
|
// is associcated with the program and not the program body, so we need to find it
|
|
49
52
|
// and move it to the new program body (which is sap.ui.define)
|
|
50
53
|
if (!copyright) {
|
|
51
|
-
var _visitor$
|
|
52
|
-
copyright = (_visitor$
|
|
54
|
+
var _visitor$parent2;
|
|
55
|
+
copyright = (_visitor$parent2 = visitor.parent) === null || _visitor$parent2 === void 0 || (_visitor$parent2 = _visitor$parent2.comments) === null || _visitor$parent2 === void 0 ? void 0 : _visitor$parent2.find((comment, idx, arr) => {
|
|
53
56
|
if (comment.value.startsWith("!")) {
|
|
54
57
|
arr.splice(idx, 1);
|
|
55
58
|
return true;
|
|
@@ -181,6 +184,9 @@ function wrap(visitor, programNode, opts) {
|
|
|
181
184
|
function hasUseStrict(node) {
|
|
182
185
|
return (node.directives || []).some(directive => directive.value.value === "use strict");
|
|
183
186
|
}
|
|
187
|
+
function hasNoWrapPragma(comments) {
|
|
188
|
+
return comments.some(comment => comment.type === "CommentBlock" && comment.value.trim() === "@ui5-no-wrap");
|
|
189
|
+
}
|
|
184
190
|
function hasUseSapUiRequire(comments, body, remove) {
|
|
185
191
|
// detect the @sapUiRequire comment
|
|
186
192
|
return comments.some(comment => {
|
package/dist/modules/visitor.js
CHANGED
|
@@ -94,7 +94,8 @@ const ModuleTransformVisitor = exports.ModuleTransformVisitor = {
|
|
|
94
94
|
node
|
|
95
95
|
} = path;
|
|
96
96
|
if (node.importKind === "type") return; // flow-type
|
|
97
|
-
|
|
97
|
+
if (this.noWrap) return;
|
|
98
|
+
if (hasIgnoreImportPragma(node)) return;
|
|
98
99
|
const {
|
|
99
100
|
specifiers,
|
|
100
101
|
source
|
|
@@ -232,6 +233,7 @@ const ModuleTransformVisitor = exports.ModuleTransformVisitor = {
|
|
|
232
233
|
declaration,
|
|
233
234
|
source
|
|
234
235
|
} = node;
|
|
236
|
+
if (this.noWrap) return;
|
|
235
237
|
let fromSource = "";
|
|
236
238
|
if (source) {
|
|
237
239
|
// e.g. export { one, two } from 'x'
|
|
@@ -289,6 +291,7 @@ const ModuleTransformVisitor = exports.ModuleTransformVisitor = {
|
|
|
289
291
|
const {
|
|
290
292
|
node
|
|
291
293
|
} = path;
|
|
294
|
+
if (this.noWrap) return;
|
|
292
295
|
let {
|
|
293
296
|
declaration
|
|
294
297
|
} = node;
|
|
@@ -326,6 +329,7 @@ const ModuleTransformVisitor = exports.ModuleTransformVisitor = {
|
|
|
326
329
|
ExportAllDeclaration(path, {
|
|
327
330
|
filename
|
|
328
331
|
}) {
|
|
332
|
+
if (this.noWrap) return;
|
|
329
333
|
const src = resolveSource(path.node.source.value, filename);
|
|
330
334
|
const name = cleanImportSource(src);
|
|
331
335
|
const tmpName = tempModuleName(name);
|
|
@@ -351,7 +355,9 @@ const ModuleTransformVisitor = exports.ModuleTransformVisitor = {
|
|
|
351
355
|
const {
|
|
352
356
|
callee
|
|
353
357
|
} = node;
|
|
358
|
+
if (this.noWrap) return;
|
|
354
359
|
if (ast.isImport(callee)) {
|
|
360
|
+
if (hasIgnoreImportPragma(path.getStatementParent().node)) return;
|
|
355
361
|
this.injectDynamicImportHelper = true;
|
|
356
362
|
path.replaceWith(_objectSpread(_objectSpread({}, node), {}, {
|
|
357
363
|
callee: _core.types.identifier("__ui5_require_async")
|
|
@@ -365,6 +371,7 @@ const ModuleTransformVisitor = exports.ModuleTransformVisitor = {
|
|
|
365
371
|
const {
|
|
366
372
|
node
|
|
367
373
|
} = path;
|
|
374
|
+
if (this.noWrap) return;
|
|
368
375
|
if ((node === null || node === void 0 || (_node$object = node.object) === null || _node$object === void 0 ? void 0 : _node$object.type) === "MetaProperty") {
|
|
369
376
|
var _node$property, _node$property2;
|
|
370
377
|
// replace all "import.meta.url" with "module.url"
|
|
@@ -379,4 +386,8 @@ const ModuleTransformVisitor = exports.ModuleTransformVisitor = {
|
|
|
379
386
|
}
|
|
380
387
|
}
|
|
381
388
|
}
|
|
382
|
-
};
|
|
389
|
+
};
|
|
390
|
+
function hasIgnoreImportPragma(node) {
|
|
391
|
+
var _node$leadingComments;
|
|
392
|
+
return ((_node$leadingComments = node.leadingComments) !== null && _node$leadingComments !== void 0 ? _node$leadingComments : []).some(comment => comment.type === "CommentBlock" && comment.value.trim() === "@ui5-ignore-import");
|
|
393
|
+
}
|
package/dist/utils/ast.js
CHANGED
|
@@ -23,7 +23,6 @@ exports.isSuperCallExpression = isSuperCallExpression;
|
|
|
23
23
|
exports.isSuperPrototypeCallOf = isSuperPrototypeCallOf;
|
|
24
24
|
exports.isThisExpressionUsed = isThisExpressionUsed;
|
|
25
25
|
var _core = require("@babel/core");
|
|
26
|
-
var _arrayFlatten = require("array-flatten");
|
|
27
26
|
function isObjectAssignOrExtendsExpression(node) {
|
|
28
27
|
return isObjectAssignExpression(node) || isExtendsHelperExpression(node);
|
|
29
28
|
}
|
|
@@ -89,7 +88,7 @@ function getInternalStaticThingsOfClass(classNode) {
|
|
|
89
88
|
* @return Array<{key, value}>
|
|
90
89
|
*/
|
|
91
90
|
function getOtherPropertiesOfIdentifier(blockScopeNode, idName) {
|
|
92
|
-
return
|
|
91
|
+
return blockScopeNode.body.map(node => {
|
|
93
92
|
if (_core.types.isExpressionStatement(node)) {
|
|
94
93
|
// ID = value | ID.key = value | ID.key.nested = value
|
|
95
94
|
const {
|
|
@@ -120,18 +119,18 @@ function getOtherPropertiesOfIdentifier(blockScopeNode, idName) {
|
|
|
120
119
|
} else if (_core.types.isVariableDeclaration(node)) {
|
|
121
120
|
return node.declarations.filter(declaration => declaration.id.name === idName).map(declaration => declaration.init).filter(init => init).filter(init => _core.types.isObjectExpression(init) || isObjectAssignOrExtendsExpression(init)).map(init => _core.types.isObjectExpression(init) ? init.properties : getPropertiesOfObjectAssignOrExtendHelper(init, blockScopeNode));
|
|
122
121
|
}
|
|
123
|
-
}).filter(item => item));
|
|
122
|
+
}).filter(item => item).flat(Infinity);
|
|
124
123
|
}
|
|
125
124
|
function getPropertiesOfObjectAssignOrExtendHelper(node, blockScopeNode) {
|
|
126
125
|
// Check all the args and recursively try to get props of identifiers (although they may be imported)
|
|
127
|
-
return
|
|
126
|
+
return node.arguments.map(arg => {
|
|
128
127
|
if (_core.types.isObjectExpression(arg)) {
|
|
129
128
|
return arg.properties;
|
|
130
129
|
} else if (_core.types.isIdentifier(arg)) {
|
|
131
130
|
// Recursive, although props will be empty if arg is an imported object
|
|
132
131
|
return getOtherPropertiesOfIdentifier(blockScopeNode, arg.name);
|
|
133
132
|
}
|
|
134
|
-
}));
|
|
133
|
+
}).flat(Infinity);
|
|
135
134
|
}
|
|
136
135
|
function getPropNames(props) {
|
|
137
136
|
return props.map(prop => prop.key.name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-plugin-transform-modules-ui5",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.10.0",
|
|
4
4
|
"description": "An unofficial babel plugin for SAP UI5.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"directory": "packages/plugin"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
12
|
+
"node": ">=20.19.0"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"clean": "rimraf dist",
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"test": "FORCE_COLOR=0 jest __test__ --coverage=no",
|
|
22
22
|
"test:watch": "npm test -- --watch",
|
|
23
23
|
"test:update-snapshot": "FORCE_COLOR=0 jest --updateSnapshot",
|
|
24
|
-
"prepare": "npm test && npm run build",
|
|
25
24
|
"format": "prettier --write 'src/**/*.js'"
|
|
26
25
|
},
|
|
27
26
|
"keywords": [
|
|
@@ -57,44 +56,39 @@
|
|
|
57
56
|
]
|
|
58
57
|
},
|
|
59
58
|
"dependencies": {
|
|
60
|
-
"
|
|
61
|
-
"doctrine": "^3.0.0",
|
|
62
|
-
"ignore-case": "^0.1.0",
|
|
63
|
-
"object-assign-defined": "^1.2.0"
|
|
59
|
+
"comment-parser": "1.4.7"
|
|
64
60
|
},
|
|
65
61
|
"peerDependencies": {
|
|
66
62
|
"@babel/core": "*"
|
|
67
63
|
},
|
|
68
64
|
"devDependencies": {
|
|
69
|
-
"@babel/cli": "
|
|
70
|
-
"@babel/core": "
|
|
71
|
-
"@babel/eslint-parser": "
|
|
72
|
-
"@babel/plugin-proposal-decorators": "
|
|
73
|
-
"@babel/plugin-proposal-object-rest-spread": "
|
|
74
|
-
"@babel/plugin-syntax-class-properties": "
|
|
75
|
-
"@babel/plugin-syntax-decorators": "
|
|
76
|
-
"@babel/plugin-syntax-dynamic-import": "
|
|
77
|
-
"@babel/plugin-syntax-object-rest-spread": "
|
|
78
|
-
"@babel/plugin-transform-property-mutators": "
|
|
79
|
-
"@babel/plugin-transform-typescript": "
|
|
80
|
-
"@babel/preset-env": "
|
|
81
|
-
"@babel/preset-flow": "
|
|
82
|
-
"@babel/preset-typescript": "
|
|
83
|
-
"babel-
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"eslint": "
|
|
87
|
-
"eslint-
|
|
88
|
-
"eslint-plugin-
|
|
89
|
-
"eslint-plugin-
|
|
90
|
-
"eslint-plugin-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
"gitHead": "484d1d764310571d67601b17ff0bbe1767599246"
|
|
65
|
+
"@babel/cli": "7.28.3",
|
|
66
|
+
"@babel/core": "7.28.5",
|
|
67
|
+
"@babel/eslint-parser": "7.28.5",
|
|
68
|
+
"@babel/plugin-proposal-decorators": "7.28.0",
|
|
69
|
+
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
|
|
70
|
+
"@babel/plugin-syntax-class-properties": "7.12.13",
|
|
71
|
+
"@babel/plugin-syntax-decorators": "7.27.1",
|
|
72
|
+
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
73
|
+
"@babel/plugin-syntax-object-rest-spread": "7.8.3",
|
|
74
|
+
"@babel/plugin-transform-property-mutators": "7.29.7",
|
|
75
|
+
"@babel/plugin-transform-typescript": "7.28.5",
|
|
76
|
+
"@babel/preset-env": "7.28.5",
|
|
77
|
+
"@babel/preset-flow": "7.27.1",
|
|
78
|
+
"@babel/preset-typescript": "7.28.5",
|
|
79
|
+
"babel-jest": "30.4.1",
|
|
80
|
+
"core-js": "3.49.0",
|
|
81
|
+
"eslint": "9.39.4",
|
|
82
|
+
"eslint-config-prettier": "10.1.8",
|
|
83
|
+
"eslint-plugin-import": "2.32.0",
|
|
84
|
+
"eslint-plugin-n": "18.2.1",
|
|
85
|
+
"eslint-plugin-prettier": "5.5.6",
|
|
86
|
+
"eslint-plugin-promise": "7.3.0",
|
|
87
|
+
"globals": "17.7.0",
|
|
88
|
+
"husky": "9.1.7",
|
|
89
|
+
"jest": "30.4.2",
|
|
90
|
+
"lint-staged": "16.2.7",
|
|
91
|
+
"prettier": "3.9.0",
|
|
92
|
+
"rimraf": "6.1.3"
|
|
93
|
+
}
|
|
100
94
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2019 Ryan Murphy
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|