Skip to content

Commit b9b58f9

Browse files
committed
chore: only provide named export
it's not a breaking change if noone uses this yet :)
1 parent 6267f0c commit b9b58f9

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
- fix: parse type assertions ([#1](https://github.com/sveltejs/acorn-typescript/pull/1))
88

9-
## acorn-typescript
9+
## 1.0.0 / acorn-typescript
10+
11+
This project started as a fork of https://github.com/TyrealHu/acorn-typescript
12+
13+
Version 1.0 of `@sveltejs/acorn-typescript` has some breaking changes compared to the original `acorn-typescript` project:
14+
15+
- Only named export (i.e. you have to do `import { tsPlugin } from '@sveltejs/acorn-typescript';`, a default export is no longer provided)
16+
- ESM only (no CJS build)
1017

1118
Changelog of the project this originated from: https://github.com/TyrealHu/acorn-typescript/CHANGELOG.md

__test__/static/plugin.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, it, expect } from 'vitest';
22
import * as acorn from 'acorn';
3-
import tsPlugin from '../../src';
3+
import { tsPlugin } from '../../src';
44
import type { AcornTypeScript } from '../../src/types';
55

66
function checkAcornTypeScriptUndefined(acornTypeScript?: AcornTypeScript): boolean {

__test__/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { assert } from 'vitest';
22
import * as acorn from 'acorn';
3-
import tsPlugin from '../src';
3+
import { tsPlugin } from '../src';
44

55
export const Parser = acorn.Parser.extend(tsPlugin());
66

index.d.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Parser } from 'acorn';
22

3-
declare function tsPlugin(options?: {
3+
export function tsPlugin(options?: {
44
dts?: boolean;
55
allowSatisfies?: boolean;
66
/** Whether to use JSX. Defaults to false */
@@ -11,5 +11,3 @@ declare function tsPlugin(options?: {
1111
allowNamespacedObjects?: boolean;
1212
};
1313
}): (BaseParser: typeof Parser) => typeof Parser;
14-
15-
export { tsPlugin, tsPlugin as default };

src/index.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function keywordTypeFromName(value: string): Node | typeof undefined {
140140
}
141141
}
142142

143-
function tsPlugin(options?: {
143+
export function tsPlugin(options?: {
144144
// default false
145145
dts?: boolean;
146146
// default false
@@ -5272,5 +5272,3 @@ function tsPlugin(options?: {
52725272
return TypeScriptParser;
52735273
};
52745274
}
5275-
5276-
export { tsPlugin as default, tsPlugin };

0 commit comments

Comments
 (0)