generated from sergiodxa/package
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2a7345e
Showing
22 changed files
with
465 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: sergiodxa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
reviewers: | ||
- "sergiodxa" | ||
assignees: | ||
- "sergiodxa" | ||
|
||
- package-ecosystem: npm | ||
directory: / | ||
schedule: | ||
interval: "weekly" | ||
reviewers: | ||
- "sergiodxa" | ||
assignees: | ||
- "sergiodxa" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
changelog: | ||
categories: | ||
- title: New Features | ||
labels: | ||
- enhancement | ||
- title: Documentation Changes | ||
labels: | ||
- documentation | ||
- title: Bug Fixes | ||
labels: | ||
- bug | ||
- title: Example | ||
labels: | ||
- example | ||
- title: Deprecations | ||
labels: | ||
- deprecated | ||
- title: Other Changes | ||
labels: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Bump version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Type of version to bump" | ||
required: true | ||
type: choice | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
|
||
jobs: | ||
bump-version: | ||
name: Bump version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ssh-key: ${{ secrets.DEPLOY_KEY }} | ||
|
||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "lts/*" | ||
|
||
- run: | | ||
git config user.name 'Sergio Xalambrí' | ||
git config user.email 'hello@sergiodxa.com' | ||
- run: npm version ${{ github.event.inputs.version }} | ||
- run: bun run quality:fix | ||
- run: git push origin main --follow-tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run build | ||
|
||
typecheck: | ||
name: Typechecker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run typecheck | ||
|
||
quality: | ||
name: Code Quality | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run quality | ||
|
||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bun test | ||
|
||
exports: | ||
name: Verify Exports | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Enable auto-merge for Dependabot PRs | ||
|
||
on: | ||
pull_request: | ||
types: opened | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- id: metadata | ||
uses: dependabot/fetch-metadata@v2 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- run: gh pr merge --auto --squash "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Deploy Documentation | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "docs" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bunx typedoc | ||
- uses: actions/configure-pages@v5 | ||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: "./docs" | ||
- uses: actions/deploy-pages@v4 | ||
id: deployment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish-npm: | ||
name: "Publish to npm" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run build | ||
- run: bun run exports | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "lts/*" | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/build | ||
/coverage | ||
/docs | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["biomejs.biome"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[jsonc]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports.biome": "explicit", | ||
"quickfix.biome": "explicit" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Contribution | ||
|
||
## Setup | ||
|
||
Run `bun install` to install the dependencies. | ||
|
||
Run the tests with `bun test`. | ||
|
||
Run the code quality checker with `bun run quality`. | ||
|
||
Run the typechecker with `bun run typecheck`. | ||
|
||
Run the exports checker with `bun run exports`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Sergio Xalambrí | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# package | ||
|
||
A template to create new packages. | ||
|
||
## What to do after cloning this repository | ||
|
||
1. Rename the package name in the package.json, and update any field referring to the repository. | ||
2. Write a description in the package.json | ||
3. Add your code in `src/index.ts` and your tests in `src/index.test.ts` | ||
4. Go to the Pages settings of the repo and configure it to use GitHub Actions | ||
5. Go to the Environment settings of the repo and update the `github-pages` enviroment "Deployment branches and tags" to allow tags with the `v*.*.*` format | ||
6. Update the `README.md` with the package description and usage instructions | ||
7. Update the LICENSE file with the correct license | ||
8. Use `bun outdated` to ensure the dependencies are up to date and update them if necessary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.7.1/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"correctness": { | ||
"useHookAtTopLevel": "error" | ||
}, | ||
"performance": { | ||
"noBarrelFile": "error", | ||
"noReExportAll": "error" | ||
}, | ||
"style": { | ||
"noDefaultExport": "error", | ||
"noNegationElse": "error", | ||
"useConst": "off", | ||
"useExportType": "off", | ||
"useImportType": "off" | ||
}, | ||
"suspicious": { | ||
"noConsoleLog": "warn", | ||
"noEmptyBlockStatements": "warn", | ||
"noSkippedTests": "error" | ||
} | ||
} | ||
}, | ||
"formatter": { "enabled": true }, | ||
"vcs": { | ||
"enabled": true, | ||
"clientKind": "git", | ||
"defaultBranch": "main", | ||
"useIgnoreFile": true | ||
}, | ||
"overrides": [ | ||
{ | ||
"include": ["**/*.md"], | ||
"formatter": { "indentStyle": "tab" } | ||
} | ||
] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "package-name", | ||
"version": "0.0.0", | ||
"description": "A description of the package", | ||
"license": "MIT", | ||
"funding": ["https://github.com/sponsors/sergiodxa"], | ||
"author": { | ||
"name": "Sergio Xalambrí", | ||
"email": "hello+oss@sergiodxa.com", | ||
"url": "https://sergiodxa.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/sergiodxa/package" | ||
}, | ||
"homepage": "https://sergiodxa.github.io/package", | ||
"bugs": { | ||
"url": "https://github.com/sergiodxa/package/issues" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"typecheck": "tsc --noEmit", | ||
"quality": "biome check .", | ||
"quality:fix": "biome check . --write --unsafe", | ||
"exports": "bun run ./scripts/exports.ts" | ||
}, | ||
"sideEffects": false, | ||
"type": "module", | ||
"engines": { | ||
"node": ">=20.0.0" | ||
}, | ||
"files": ["build", "package.json", "README.md"], | ||
"exports": { | ||
".": "./build/index.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": {}, | ||
"devDependencies": { | ||
"@arethetypeswrong/cli": "^0.17.2", | ||
"@biomejs/biome": "^1.9.4", | ||
"@total-typescript/tsconfig": "^1.0.4", | ||
"@types/bun": "^1.1.14", | ||
"consola": "^3.3.3", | ||
"typedoc": "^0.27.6", | ||
"typedoc-plugin-mdn-links": "^4.0.6", | ||
"typescript": "^5.7.2" | ||
} | ||
} |
Oops, something went wrong.