Skip to content

Commit abfea45

Browse files
feat(twoslash-vue): Introduce forked ESM-only Twoslash-vue (#86)
* feat(twoslash-vue): add initial implementation and configuration files - Created example Vue component with TypeScript setup and reactive properties. - Added test utility file for parent suite name. - Configured TypeScript with tsconfig files for source and test directories. - Implemented build configuration using tsdown. - Set up Vitest configuration for testing. * fix(biome): update file includes to ignore test results and fixtures * fix(twoslash-vue): update position queries in query tests for consistency
1 parent 6dfe89a commit abfea45

33 files changed

Lines changed: 2052 additions & 9 deletions

.changeset/eight-points-like.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ec-ts/twoslash-vue": major
3+
---
4+
5+
Init ESM-only fork of twoslash-vue for expressive-code-twoslash

.github/labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ ec-ts:twoslash:
1515
- any-glob-to-any-file:
1616
- packages/@ec-ts/twoslash/*
1717

18+
ec-ts:twoslash-vue:
19+
- changed-files:
20+
- any-glob-to-any-file:
21+
- packages/@ec-ts/twoslash-vue/*
22+
1823
ec-ts:vfs:
1924
- changed-files:
2025
- any-glob-to-any-file:

allurerc.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "allure";
22

33
// These are the packages that have tests and should be included in the Allure report. The report will be grouped by parentSuite, suite, and subSuite, and will only include tests that have a label with name "parentSuite" and value `${pkg} Tests`.
4-
const packagesWithTests = ["css-js-gen", "@ec-ts/twoslash", "@ec-ts/vfs"];
4+
const packagesWithTests = ["css-js-gen", "@ec-ts/twoslash", "@ec-ts/twoslash-vue", "@ec-ts/vfs"];
55

66
// Create a plugins configuration object for each package with tests, using the @allurereport/plugin-awesome plugin. The report will be named `${pkg} Tests`, and will be published to the Allure server.
77
const pluginsConfig = Object.fromEntries(

biome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"files": {
99
"ignoreUnknown": false,
10-
"includes": ["**", "!**/module-code/*", "!**/scratchpad/*"]
10+
"includes": ["**", "!**/module-code/*", "!**/scratchpad/*", "!**/test/{results,fixtures}/**/*"]
1111
},
1212
"formatter": {
1313
"enabled": true,
@@ -17,7 +17,7 @@
1717
},
1818
"linter": {
1919
"enabled": true,
20-
"includes": ["**", "!**/module-code/*", "!**/scratchpad/*"],
20+
"includes": ["**", "!**/module-code/*", "!**/scratchpad/*", "!**/test/{results,fixtures}/**/*"],
2121
"rules": {
2222
"recommended": true
2323
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
"typescript": "^5.9.3",
5454
"pkg-pr-new": "^0.0.63",
5555
"publint": "^0.3.17",
56-
"vitest": "^4.0.18"
56+
"vite": "^7.3.1",
57+
"vitest": "^4.0.18",
58+
"vue": "^3.5.28"
5759
}
5860
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024-PRESENT Anthony Fu <https://github.com/antfu>
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.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# twoslash-vue
2+
3+
[![npm version][npm-version-src]][npm-version-href]
4+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
5+
6+
Extended Twoslash for Vue SFC support.
7+
8+
[📚 Documentation](https://twoslash.netlify.app/packages/vue)
9+
10+
## License
11+
12+
[MIT](./LICENSE) License © 2023-PRESENT [Anthony Fu](https://github.com/antfu)
13+
14+
<!-- Badges -->
15+
16+
[npm-version-src]: https://img.shields.io/npm/v/twoslash-vue?style=flat&colorA=161514&colorB=EAB836
17+
[npm-version-href]: https://npmjs.com/package/twoslash-vue
18+
[npm-downloads-src]: https://img.shields.io/npm/dm/twoslash-vue?style=flat&colorA=161514&colorB=E66041
19+
[npm-downloads-href]: https://npmjs.com/package/twoslash-vue
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "@ec-ts/twoslash-vue",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"description": "Extended Twoslash for Vue SFC support",
6+
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
7+
"license": "MIT",
8+
"funding": "https://github.com/sponsors/antfu",
9+
"homepage": "https://github.com/withstudiocms/expressive-code-twoslash#readme",
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/withstudiocms/expressive-code-twoslash.git",
13+
"directory": "packages/@ec-ts/twoslash-vue"
14+
},
15+
"bugs": "https://github.com/withstudiocms/expressive-code-twoslash/issues",
16+
"keywords": [
17+
"twoslash",
18+
"vue",
19+
"shiki"
20+
],
21+
"sideEffects": false,
22+
"exports": {
23+
".": {
24+
"types": "./dist/index.d.ts",
25+
"import": "./dist/index.js"
26+
}
27+
},
28+
"typesVersions": {
29+
"*": {
30+
"*": [
31+
"./dist/*",
32+
"./dist/index.d.ts"
33+
]
34+
}
35+
},
36+
"files": [
37+
"dist"
38+
],
39+
"scripts": {
40+
"build": "tsdown --config ./tsdown.config.ts",
41+
"dev": "tsdown --config ./tsdown.config.ts --watch --no-clean",
42+
"test": "vitest"
43+
},
44+
"peerDependencies": {
45+
"typescript": "^5.5.0"
46+
},
47+
"dependencies": {
48+
"@vue/language-core": "catalog:twoslash",
49+
"@ec-ts/twoslash": "workspace:^",
50+
"twoslash-protocol": "catalog:twoslash"
51+
}
52+
}

0 commit comments

Comments
 (0)