oxc-transform 0.27.0 → 0.28.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -9
  3. package/index.d.ts +21 -1
  4. package/package.json +9 -9
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present Boshen
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.
package/README.md CHANGED
@@ -12,14 +12,14 @@ This is still in alpha and may yield incorrect results, feel free to [submit a b
12
12
  import assert from 'assert';
13
13
  import oxc from 'oxc-transform';
14
14
 
15
- const { sourceMap, sourceText, errors } = oxc.isolatedDeclaration("test.ts", "class A {}", { sourcemap: true });
15
+ const { sourceMap, sourceText, errors } = oxc.isolatedDeclaration('test.ts', 'class A {}', { sourcemap: true });
16
16
 
17
- assert.equal(sourceText, "declare class A {}\n");
17
+ assert.equal(sourceText, 'declare class A {}\n');
18
18
  assert.deepEqual(ret.sourceMap, {
19
- mappings: "AAAA,cAAM,EAAE,CAAE",
19
+ mappings: 'AAAA,cAAM,EAAE,CAAE',
20
20
  names: [],
21
- sources: ["test.ts"],
22
- sourcesContent: ["class A {}"],
21
+ sources: ['test.ts'],
22
+ sourcesContent: ['class A {}'],
23
23
  });
24
24
  assert(errors.length == 0);
25
25
  ```
@@ -27,14 +27,18 @@ assert(errors.length == 0);
27
27
  ### API
28
28
 
29
29
  ```typescript
30
- export function isolatedDeclaration(filename: string, sourceText: string, options: IsolatedDeclarationsOptions): IsolatedDeclarationsResult
30
+ export function isolatedDeclaration(
31
+ filename: string,
32
+ sourceText: string,
33
+ options: IsolatedDeclarationsOptions,
34
+ ): IsolatedDeclarationsResult;
31
35
 
32
36
  export interface IsolatedDeclarationsOptions {
33
- sourcemap: boolean
37
+ sourcemap: boolean;
34
38
  }
35
39
 
36
40
  export interface IsolatedDeclarationsResult {
37
- sourceText: string
38
- errors: Array<string>
41
+ sourceText: string;
42
+ errors: Array<string>;
39
43
  }
40
44
  ```
package/index.d.ts CHANGED
@@ -113,15 +113,35 @@ export interface ReactBindingOptions {
113
113
  * @default false
114
114
  */
115
115
  useSpread?: boolean
116
+ /** Enable react fast refresh transform */
117
+ refresh?: ReactRefreshBindingOptions
118
+ }
119
+
120
+ export interface ReactRefreshBindingOptions {
121
+ /**
122
+ * Specify the identifier of the refresh registration variable.
123
+ *
124
+ * @default `$RefreshReg$`.
125
+ */
126
+ refreshReg?: string
127
+ /**
128
+ * Specify the identifier of the refresh signature variable.
129
+ *
130
+ * @default `$RefreshSig$`.
131
+ */
132
+ refreshSig?: string
133
+ emitFullSignatures?: boolean
116
134
  }
117
135
 
118
136
  export interface SourceMap {
119
137
  file?: string
120
138
  mappings?: string
139
+ names?: Array<string>
121
140
  sourceRoot?: string
122
141
  sources?: Array<string | undefined | null>
123
142
  sourcesContent?: Array<string | undefined | null>
124
- names?: Array<string>
143
+ version: number
144
+ x_google_ignoreList?: Array<number>
125
145
  }
126
146
 
127
147
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxc-transform",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "Oxc transform Node API",
5
5
  "keywords": [
6
6
  "transform"
@@ -23,13 +23,13 @@
23
23
  "index.js"
24
24
  ],
25
25
  "optionalDependencies": {
26
- "@oxc-transform/binding-win32-x64-msvc": "0.27.0",
27
- "@oxc-transform/binding-win32-arm64-msvc": "0.27.0",
28
- "@oxc-transform/binding-linux-x64-gnu": "0.27.0",
29
- "@oxc-transform/binding-linux-arm64-gnu": "0.27.0",
30
- "@oxc-transform/binding-linux-x64-musl": "0.27.0",
31
- "@oxc-transform/binding-linux-arm64-musl": "0.27.0",
32
- "@oxc-transform/binding-darwin-x64": "0.27.0",
33
- "@oxc-transform/binding-darwin-arm64": "0.27.0"
26
+ "@oxc-transform/binding-win32-x64-msvc": "0.28.0",
27
+ "@oxc-transform/binding-win32-arm64-msvc": "0.28.0",
28
+ "@oxc-transform/binding-linux-x64-gnu": "0.28.0",
29
+ "@oxc-transform/binding-linux-arm64-gnu": "0.28.0",
30
+ "@oxc-transform/binding-linux-x64-musl": "0.28.0",
31
+ "@oxc-transform/binding-linux-arm64-musl": "0.28.0",
32
+ "@oxc-transform/binding-darwin-x64": "0.28.0",
33
+ "@oxc-transform/binding-darwin-arm64": "0.28.0"
34
34
  }
35
35
  }