Initial commit

This commit is contained in:
js 2023-08-21 02:14:09 +00:00
commit c46c33eebf
7 changed files with 124 additions and 0 deletions

View File

@ -0,0 +1,30 @@
name: Build and publish
on:
workflow_dispatch: { }
# push:
# branches:
# - master
jobs:
build-and-publish:
runs-on: ubuntu-latest
env:
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Login to package registry
run: |
npm config set @<scope name>:registry https://gitea.jbrumond.me/api/packages/<scope name>/npm/
npm config set -- '//gitea.jbrumond.me/api/packages/<scope name>/npm/:_authToken' "$NPM_PUBLISH_TOKEN"
- name: Publish package
run: npm publish

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

37
package-lock.json generated Normal file
View File

@ -0,0 +1,37 @@
{
"name": "@templates/typescript-types",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@templates/typescript-types",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
"typescript": "^5.1.3"
}
},
"node_modules/typescript": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz",
"integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
}
},
"dependencies": {
"typescript": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz",
"integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==",
"dev": true
}
}
}

19
package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "@templates/typescript-types",
"version": "1.0.0",
"description": "Template project for creating new TypeScript type-definition-only packages",
"main": "src/index.d.ts",
"types": "src/index.d.ts",
"publishConfig": {
"registry": "https://gitea.jbrumond.me/api/packages/templates/npm/"
},
"repository": {
"type": "git",
"url": "https://gitea.jbrumond.me/templates/typescript-types.git"
},
"author": "James Brumond <https://jbrumond.me>",
"license": "ISC",
"devDependencies": {
"typescript": "^5.1.3"
}
}

27
readme.md Normal file
View File

@ -0,0 +1,27 @@
Template project for creating new TypeScript type-definition-only packages
---
## Get Started
### Pull down the code
```bash
git init
git pull https://gitea.jbrumond.me/templates/typescript-types.git master
```
### Update configuration
- In `package.json`, update any fields like `name`, `description`, `repository`, etc.
## Building
No build step is necessary, as the types are written directly as `.d.ts` files to begin with.

2
src/index.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
export function hello() : string;

8
tsconfig.json Normal file
View File

@ -0,0 +1,8 @@
{
"include": [
"src/**/*.d.ts"
],
"compilerOptions": {
//
}
}