Skip to content

Commit 562ffd9

Browse files
committed
chore: init
0 parents  commit 562ffd9

19 files changed

+7086
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
charset = utf-8
8+
9+
[*.js]
10+
indent_style = space
11+
indent_size = 2
12+
13+
[{package.json,*.yml,*.cjson}]
14+
indent_style = space
15+
indent_size = 2
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 🐛 Bug report
2+
description: Something's not working
3+
labels: [bug]
4+
body:
5+
- type: textarea
6+
validations:
7+
required: true
8+
attributes:
9+
label: 🐛 The bug
10+
description: What isn't working? Describe what the bug is.
11+
- type: input
12+
validations:
13+
required: true
14+
attributes:
15+
label: 🛠️ To reproduce
16+
description: A reproduction of the bug via https://stackblitz.com/github/nuxt-contrib/vue-sfc-transformer/tree/main/playground
17+
placeholder: https://stackblitz.com/[...]
18+
- type: textarea
19+
validations:
20+
required: true
21+
attributes:
22+
label: 🌈 Expected behaviour
23+
description: What did you expect to happen? Is there a section in the docs about this?
24+
- type: textarea
25+
attributes:
26+
label: ℹ️ Additional context
27+
description: Add any other context about the problem here.

.github/workflows/ci.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- run: npm i -g --force corepack && corepack enable
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: lts/*
21+
cache: pnpm
22+
23+
- name: 📦 Install dependencies
24+
run: pnpm install
25+
26+
- name: 🔠 Lint project
27+
run: pnpm lint
28+
29+
- name: ✂️ Knip project
30+
run: pnpm test:knip
31+
32+
- name: ⚙️ Check package engines
33+
run: pnpm test:versions
34+
35+
test:
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
- run: npm i -g --force corepack && corepack enable
41+
- uses: actions/setup-node@v4
42+
with:
43+
node-version: lts/*
44+
cache: pnpm
45+
46+
- name: 📦 Install dependencies
47+
run: pnpm install
48+
49+
- name: 🛠 Build project
50+
run: pnpm build
51+
52+
- name: 💪 Test types
53+
run: pnpm test:types
54+
55+
- name: 🧪 Test project
56+
run: pnpm test:unit -- --coverage
57+
58+
- name: 🟩 Coverage
59+
uses: codecov/codecov-action@v5

.github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- run: npm i -g --force corepack && corepack enable
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: lts/*
23+
cache: pnpm
24+
25+
- name: 📦 Install dependencies
26+
run: pnpm install
27+
28+
- run: pnpm changelogithub
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dist
2+
node_modules
3+
coverage
4+
.vscode
5+
.DS_Store
6+
.eslintcache
7+
*.log*
8+
*.env*

CODE_OF_CONDUCT.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [[email protected]](mailto:[email protected]). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
44+
45+
[homepage]: https://www.contributor-covenant.org
46+
47+
For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq

LICENCE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Daniel Roe
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.

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# vue-sfc-transformer
2+
3+
[![npm version][npm-version-src]][npm-version-href]
4+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
5+
[![Github Actions][github-actions-src]][github-actions-href]
6+
[![Codecov][codecov-src]][codecov-href]
7+
8+
> Package description
9+
10+
## Usage
11+
12+
Install package:
13+
14+
```sh
15+
# npm
16+
npm install vue-sfc-transformer
17+
18+
# pnpm
19+
pnpm install vue-sfc-transformer
20+
```
21+
22+
```js
23+
import {} from 'vue-sfc-transformer'
24+
```
25+
26+
## 💻 Development
27+
28+
- Clone this repository
29+
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
30+
- Install dependencies using `pnpm install`
31+
- Run interactive tests using `pnpm dev`
32+
33+
## License
34+
35+
Made with ❤️
36+
37+
Published under [MIT License](./LICENCE).
38+
39+
<!-- Badges -->
40+
41+
[npm-version-src]: https://img.shields.io/npm/v/vue-sfc-transformer?style=flat-square
42+
[npm-version-href]: https://npmjs.com/package/vue-sfc-transformer
43+
[npm-downloads-src]: https://img.shields.io/npm/dm/vue-sfc-transformer?style=flat-square
44+
[npm-downloads-href]: https://npm.chart.dev/vue-sfc-transformer
45+
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/nuxt-contrvue-sfc-transformerransformer/ci.yml?branch=main&style=flat-square
46+
[github-actions-href]: https://github.com/nuxt-contrvue-sfc-transformerransformer/actions?query=workflow%3Aci
47+
[codecov-src]: https://img.shields.io/codecov/c/gh/nuxt-contrvue-sfc-transformerransformer/main?style=flat-square
48+
[codecov-href]: https://codecov.io/gh/nuxt-contrvue-sfc-transformerransformer

eslint.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import antfu from '@antfu/eslint-config'
2+
3+
export default antfu()

package.json

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "vue-sfc-transformer",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"packageManager": "[email protected]",
6+
"description": "",
7+
"license": "MIT",
8+
"repository": "nuxt-contrib/vue-sfc-transformer",
9+
"sideEffects": false,
10+
"exports": {
11+
".": "./dist/index.js"
12+
},
13+
"main": "./dist/index.js",
14+
"module": "./dist/index.js",
15+
"types": "./dist/index.d.ts",
16+
"files": [
17+
"dist"
18+
],
19+
"scripts": {
20+
"build": "unbuild",
21+
"dev": "vitest dev",
22+
"lint": "eslint . --fix",
23+
"prepare": "simple-git-hooks",
24+
"prepack": "pnpm build",
25+
"prepublishOnly": "pnpm lint && pnpm test",
26+
"release": "bumpp && pnpm publish",
27+
"test": "pnpm test:unit && pnpm test:types",
28+
"test:unit": "vitest",
29+
"test:knip": "knip",
30+
"test:versions": "installed-check -d --no-workspaces",
31+
"test:types": "tsc --noEmit"
32+
},
33+
"devDependencies": {
34+
"@antfu/eslint-config": "latest",
35+
"@vitest/coverage-v8": "latest",
36+
"bumpp": "latest",
37+
"changelogithub": "latest",
38+
"eslint": "latest",
39+
"installed-check": "latest",
40+
"knip": "latest",
41+
"lint-staged": "latest",
42+
"simple-git-hooks": "latest",
43+
"typescript": "latest",
44+
"unbuild": "latest",
45+
"vitest": "latest"
46+
},
47+
"resolutions": {
48+
"vue-sfc-transformer": "link:."
49+
},
50+
"simple-git-hooks": {
51+
"pre-commit": "npx lint-staged"
52+
},
53+
"lint-staged": {
54+
"*.{js,ts,mjs,cjs,json,.*rc}": [
55+
"npx eslint --fix"
56+
]
57+
}
58+
}

playground/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import assert from 'node:assert'
2+
import * as pkg from 'vue-sfc-transformer'
3+
4+
// eslint-disable-next-line no-console
5+
console.log(pkg.welcome())
6+
7+
assert.strictEqual(pkg.welcome(), 'hello world')

playground/package.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"type": "module",
3+
"private": true,
4+
"scripts": {
5+
"dev": "node index.js"
6+
},
7+
"dependencies": {
8+
"vue-sfc-transformer": "latest"
9+
}
10+
}

0 commit comments

Comments
 (0)