-
-
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 805ed41
Showing
22 changed files
with
390 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,12 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [matronator] | ||
patreon: matronator | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: matronator | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
custom: ['https://www.paypal.me/matronator', 'https://www.blockchain.com/btc/address/35VRpVQaqFWjUCnVRpGineShz76QyYgSVg'] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:best-practices", | ||
":pinOnlyDevDependencies", | ||
":ignoreModulesAndTests", | ||
":preserveSemverRanges", | ||
"group:all", | ||
"schedule:weekly", | ||
":maintainLockFilesMonthly" | ||
], | ||
"labels": ["dependencies", "renovate"], | ||
"lockFileMaintenance": { | ||
"commitMessageAction": "Update", | ||
"extends": [ | ||
"group:all" | ||
] | ||
}, | ||
"separateMajorMinor": false, | ||
"autoApprove": true, | ||
"automerge": true, | ||
"pruneBranchAfterAutomerge": true, | ||
"automergeType": "branch" | ||
} |
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,27 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
build | ||
dist | ||
dist-ssr | ||
*.local | ||
coverage | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
.history/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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 @@ | ||
{ | ||
"./**/*.{ts,html,json}": "npm run format" | ||
} |
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 @@ | ||
coverage | ||
test | ||
node_modules | ||
*.log | ||
.lintstagedrc | ||
.prettierignore | ||
.prettierrc | ||
favicon.ico | ||
vite.config.js | ||
dts-bundle-generator.config.json | ||
tsconfig.json | ||
index.html | ||
.vscode | ||
.github |
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,7 @@ | ||
.history | ||
.husky | ||
.vscode | ||
coverage | ||
dist | ||
node_modules | ||
.github |
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,15 @@ | ||
{ | ||
"printWidth": 120, | ||
"tabWidth": 4, | ||
"singleQuote": false, | ||
"trailingComma": "es5", | ||
"arrowParens": "avoid", | ||
"bracketSpacing": true, | ||
"useTabs": false, | ||
"endOfLine": "auto", | ||
"singleAttributePerLine": false, | ||
"bracketSameLine": false, | ||
"jsxSingleQuote": false, | ||
"quoteProps": "as-needed", | ||
"semi": true | ||
} |
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,7 @@ | ||
# Change Log | ||
|
||
All notable changes to the "Ping Tracker" project will be documented in this file. | ||
|
||
## [0.1.0] - 2024-06-29 | ||
|
||
- Initial release |
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,9 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Matronator | ||
|
||
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,52 @@ | ||
# Vite TypeScript Library Starter | ||
|
||
 | ||
|
||
 | ||
 | ||
 | ||
 | ||
 | ||
 | ||
 | ||
 | ||
 | ||
<a href="https://github.com/matronator"></a> | ||
<a href="https://github.com/sponsors/matronator/"></a> | ||
|
||
A starter template to use for developing libraries with Vite and TypeScript. | ||
|
||
## Tech-stack | ||
|
||
- [Bun](https://bunpkg.com/) - A package manager for the web (faster alternative to npm and yarn) | ||
- [Vite](https://vitejs.dev/) - A next-generation front-end tooling | ||
- [TypeScript](https://www.typescriptlang.org/) - A typed superset of JavaScript | ||
- [Vitest](https://vitest.dev/) - A test runner for Vite | ||
- [Prettier](https://prettier.io/) - An opinionated code formatter | ||
- [Renovate](https://www.mend.io/renovate/) - Automated dependency updates | ||
- [np](https://github.com/sindresorhus/np) - A better `npm publish` | ||
|
||
## Installation | ||
|
||
1. Clone this repository, or | ||
2. Click on "Use this template" button, or | ||
3. Download the repository as a ZIP file, or | ||
4. Use [degit](https://github.com/Rich-Harris/degit), like this: | ||
|
||
``` | ||
bunx degit matronator/vite-ts-lib-starter my-new-library | ||
``` | ||
|
||
## After installation | ||
|
||
1. Change the `package.json` file to match your library's name, description, author, etc. | ||
2. Change the `outFile` field in the `dts-bundle-generator.config.js` file to match your library's name. | ||
3. Replace the logo with your own. | ||
4. Modify `FUNDING.yml` in the `.github` folder with your own values or remove it completely. | ||
5. Replace the `README.md` file with your own. | ||
6. Change the name in the `LICENSE.md` file. | ||
7. Replace the `CHANGELOG.md` file with your own. | ||
8. Start creating your library in the `src` folder. | ||
9. Write some tests in the `tests` folder. | ||
10. When you're ready to publish your library, run `npm run build` to generate the production files. | ||
11. Publish your library to npm with either `npm publish`, or `npm run release` to use `np` for a better publishing experience. |
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,11 @@ | ||
const config = { | ||
entries: [ | ||
{ | ||
filePath: "./src/index.ts", | ||
outFile: "./dist/package-name.d.ts", | ||
noCheck: false, | ||
}, | ||
], | ||
}; | ||
|
||
module.exports = config; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="favicon.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite App</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/index.ts"></script> | ||
</body> | ||
</html> |
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,87 @@ | ||
{ | ||
"name": "package-name", | ||
"version": "0.1.0", | ||
"author": { | ||
"name": "Author Name", | ||
"email": "[email protected]", | ||
"url": "https://website.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/username/repository.git" | ||
}, | ||
"main": "./dist/package-name.cjs", | ||
"module": "./dist/package-name.mjs", | ||
"devDependencies": { | ||
"@types/jsdom": "^21.1.6", | ||
"@types/node": "^20.11.5", | ||
"@vitest/coverage-v8": "^1.2.1", | ||
"dts-bundle-generator": "^9.2.4", | ||
"jsdom": "^24.1.0", | ||
"lint-staged": "^15.2.0", | ||
"np": "^10.0.6", | ||
"prettier": "^3.2.4", | ||
"terser": "^5.31.1", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.3.3", | ||
"upgradeps": "^2.0.6", | ||
"vite": "^5.0.12", | ||
"vitest": "^1.2.1" | ||
}, | ||
"exports": { | ||
".": { | ||
"require": "./dist/package-name.cjs", | ||
"import": "./dist/package-name.mjs", | ||
"types": "./dist/package-name.d.ts" | ||
}, | ||
"./dist/": { | ||
"import": "./dist/", | ||
"require": "./dist/", | ||
"types": "./dist/" | ||
} | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/username/repository/issues" | ||
}, | ||
"description": "Package description.", | ||
"files": [ | ||
"dist", | ||
"README.md", | ||
"LICENSE.md", | ||
"CHANGELOG.md", | ||
"src", | ||
"package.json" | ||
], | ||
"funding": [ | ||
{ | ||
"type": "individual", | ||
"url": "https://support.example.com" | ||
} | ||
], | ||
"homepage": "https://github.com/username/repository#readme", | ||
"keywords": ["some", "keywords"], | ||
"license": "MIT", | ||
"private": false, | ||
"scripts": { | ||
"dev": "vite --host", | ||
"build": "rm -rf dist/* && tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts", | ||
"test": "vitest", | ||
"test:coverage": "vitest --coverage", | ||
"format": "prettier . --write", | ||
"upgrade": "upgradeps", | ||
"release": "npm run build && np" | ||
}, | ||
"sponsor": { | ||
"url": "https://sponsor.example.com" | ||
}, | ||
"type": "module", | ||
"types": "./dist/package-name.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"./dist/package-name.d.ts" | ||
] | ||
} | ||
}, | ||
"typings": "./dist/package-name.d.ts" | ||
} |
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 @@ | ||
export { sum } from "./sum"; |
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 @@ | ||
export function sum(a: number, b: number): number { | ||
return a + b; | ||
} |
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 @@ | ||
/// <reference types="vite/client" /> |
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,8 @@ | ||
import { assert, describe, it } from 'vitest'; | ||
import { sum } from '../src/index'; | ||
|
||
describe("construct", () => { | ||
it("should return 3", () => { | ||
assert.equal(sum(1, 2), 3); | ||
}); | ||
}); |
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,29 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": ".", | ||
"paths": { | ||
"@/*": ["./src/*"], | ||
"@@/*": ["./*"] | ||
}, | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"module": "ESNext", | ||
"lib": ["ESNext", "DOM"], | ||
"moduleResolution": "Node", | ||
"strict": true, | ||
"sourceMap": true, | ||
"resolveJsonModule": true, | ||
"esModuleInterop": true, | ||
"noEmit": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"types": ["vite/client", "node"], | ||
"declaration": true, | ||
"declarationDir": "dist", | ||
"listEmittedFiles": true | ||
}, | ||
"include": ["src", "dist/index.d.ts"], | ||
"exclude": ["**/*.test.ts", "node_modules", "test/**", ".history/**"] | ||
} |
Oops, something went wrong.