Skip to content

Commit e4c5278

Browse files
authored
Migrate to Rollup and Vitest (#504)
* Minor improvements to readme * feat: add XML string plugin for Rollup and Vitest configurations - Introduced an XML string plugin in `rolldown.config.mjs` to transform XML files into JavaScript exports. - Created a new script `verify-consumer-compat.mjs` to validate the presence of required exports in package.json and check for compatibility between CommonJS and ESM exports. - Added a Vitest configuration file `vitest.config.ts` with XML string plugin integration, test project definitions, and coverage reporting settings. * Fixes GitHub Workflows * Specifies pnpm version * Fixes prettier issues * Bumps version to 2.2.3
1 parent 7ce4c39 commit e4c5278

47 files changed

Lines changed: 4223 additions & 5479 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
8+
[*.{ts,tsx,js,jsx,mts,mjs,cjs}]
9+
indent_style = space
10+
indent_size = 4
11+
trim_trailing_whitespace = true
12+
13+
[*.{json,yml,yaml}]
14+
indent_style = space
15+
indent_size = 2
16+
trim_trailing_whitespace = true
17+
18+
[*.md]
19+
indent_style = space
20+
indent_size = 2
21+
trim_trailing_whitespace = false

.github/workflows/build-sdk.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,27 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v6
1616

17+
- name: Set up pnpm
18+
uses: pnpm/action-setup@v5
19+
1720
- name: Set up Node.js
1821
uses: actions/setup-node@v6
1922
with:
2023
node-version: '22'
21-
22-
- name: Install Yarn
23-
run: npm install -g yarn
24+
cache: 'pnpm'
2425

2526
- name: Install Dependencies
2627
run: |
27-
yarn install
28+
pnpm install --frozen-lockfile
2829
2930
- name: Build
3031
run: |
31-
yarn build
32+
pnpm build
33+
34+
- name: Bundle
35+
run: |
36+
pnpm bundle
37+
38+
- name: Verify Consumer Compatibility
39+
run: |
40+
pnpm verify:compat

.github/workflows/lint-sdk.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,23 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v6
1616

17+
- name: Set up pnpm
18+
uses: pnpm/action-setup@v5
19+
1720
- name: Set up Node.js
1821
uses: actions/setup-node@v6
1922
with:
2023
node-version: '22'
21-
22-
- name: Install Yarn
23-
run: npm install -g yarn
24+
cache: 'pnpm'
2425

2526
- name: Install Dependencies
2627
run: |
27-
yarn install
28+
pnpm install --frozen-lockfile
29+
30+
- name: Check formatting
31+
run: |
32+
pnpm format:check
2833
29-
- name: Build
34+
- name: Lint
3035
run: |
31-
yarn lint:check
36+
pnpm lint:check

.github/workflows/publish.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,30 @@ jobs:
1616
- name: Checkout repository
1717
uses: actions/checkout@v6
1818

19+
- name: Set up pnpm
20+
uses: pnpm/action-setup@v5
21+
1922
- name: Set up Node.js
2023
uses: actions/setup-node@v6
2124
with:
2225
node-version: '24'
2326
registry-url: 'https://registry.npmjs.org'
27+
cache: 'pnpm'
2428

2529
- name: Update npm (OIDC/provenance support)
2630
run: npm i -g npm@latest
2731

28-
- name: Install Yarn
29-
run: npm i -g yarn
30-
3132
- name: Install dependencies
32-
run: yarn install --frozen-lockfile
33+
run: pnpm install --frozen-lockfile
3334

3435
- name: Build project
35-
run: yarn build
36+
run: pnpm build
3637

3738
- name: Bundle project
38-
run: yarn bundle
39+
run: pnpm bundle
40+
41+
- name: Verify consumer compatibility
42+
run: pnpm verify:compat
3943

4044
- name: Publish to npm (OIDC)
4145
run: npm publish

.github/workflows/test-sdk.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v6
1616

17+
- name: Set up pnpm
18+
uses: pnpm/action-setup@v5
19+
1720
- name: Set up Node.js
1821
uses: actions/setup-node@v6
1922
with:
2023
node-version: '22'
21-
22-
- name: Install Yarn
23-
run: npm install -g yarn
24+
cache: 'pnpm'
2425

2526
- name: Install Docker Compose
2627
run: |
@@ -43,7 +44,7 @@ jobs:
4344
done
4445
4546
- name: Install Dependencies
46-
run: yarn install
47+
run: pnpm install --frozen-lockfile
4748

4849
- name: Pull Docker Images
4950
run: docker-compose -f ci/docker-compose.yml pull
@@ -61,4 +62,4 @@ jobs:
6162
done < /tmp/docker-image-cache/images.txt
6263
6364
- name: Run Tests
64-
run: yarn test
65+
run: pnpm test

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.prettierignore

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
build/
33
dist/
44
bundle/
5+
coverage/
6+
docs/
7+
8+
# Ignore generated and specification sources
9+
src/generated/
10+
openapi/
511

612
# Ignore node modules
713
node_modules/
@@ -14,8 +20,14 @@ node_modules/
1420
.env.*
1521

1622
# Ignore lock files
17-
yarn.lock
1823
package-lock.json
24+
pnpm-lock.yaml
25+
yarn.lock
26+
27+
# Ignore config/spec formats managed separately
28+
*.json
29+
*.yaml
30+
*.yml
1931

2032
# Ignore logs
2133
*.log
@@ -30,6 +42,3 @@ package-lock.json
3042
*.jpeg
3143
*.gif
3244
*.svg
33-
34-
# Ignore other generated files
35-
coverage/

.prettierrc

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
1-
{
2-
"trailingComma": "es5",
3-
"tabWidth": 4,
4-
"useTabs": false,
5-
"semi": true,
6-
"singleQuote": true,
7-
"bracketSpacing": true,
8-
"bracketSameLine": true,
9-
"arrowParens": "always",
10-
"printWidth": 120,
11-
"overrides": [
12-
{
13-
"files": "*.ts",
14-
"options": {
15-
"parser": "typescript"
16-
}
17-
},
18-
{
19-
"files": "*.json",
20-
"options": {
21-
"parser": "json",
22-
"tabWidth": 2,
23-
"trailingComma": "none"
24-
}
25-
},
26-
{
27-
"files": "*.js",
28-
"options": {
29-
"parser": "babel"
30-
}
31-
},
32-
{
33-
"files": "*.md",
34-
"options": {
35-
"proseWrap": "always"
36-
}
37-
},
38-
{
39-
"files": "*.css",
40-
"options": {
41-
"parser": "css"
42-
}
43-
},
44-
{
45-
"files": "*.yaml",
46-
"options": {
47-
"parser": "yaml",
48-
"tabWidth": 2
49-
}
50-
}
51-
]
52-
}
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"bracketSpacing": true,
8+
"bracketSameLine": true,
9+
"arrowParens": "always",
10+
"printWidth": 120,
11+
"overrides": [
12+
{
13+
"files": "*.ts",
14+
"options": {
15+
"parser": "typescript"
16+
}
17+
},
18+
{
19+
"files": "*.json",
20+
"options": {
21+
"parser": "json",
22+
"tabWidth": 2,
23+
"trailingComma": "none"
24+
}
25+
},
26+
{
27+
"files": "*.js",
28+
"options": {
29+
"parser": "babel"
30+
}
31+
},
32+
{
33+
"files": "*.md",
34+
"options": {
35+
"proseWrap": "always",
36+
"tabWidth": 2
37+
}
38+
},
39+
{
40+
"files": "*.css",
41+
"options": {
42+
"parser": "css"
43+
}
44+
},
45+
{
46+
"files": "*.yaml",
47+
"options": {
48+
"parser": "yaml",
49+
"tabWidth": 2
50+
}
51+
}
52+
]
53+
}

0 commit comments

Comments
 (0)