commit c46c33eebf2b87dbe0d2f21e94615788299778bf Author: js <> Date: Mon Aug 21 02:14:09 2023 +0000 Initial commit diff --git a/.gitea/workflows/pubilsh.yaml b/.gitea/workflows/pubilsh.yaml new file mode 100644 index 0000000..d155937 --- /dev/null +++ b/.gitea/workflows/pubilsh.yaml @@ -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 @:registry https://gitea.jbrumond.me/api/packages//npm/ + npm config set -- '//gitea.jbrumond.me/api/packages//npm/:_authToken' "$NPM_PUBLISH_TOKEN" + + - name: Publish package + run: npm publish diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6826e3e --- /dev/null +++ b/package-lock.json @@ -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 + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..d25f3d1 --- /dev/null +++ b/package.json @@ -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 ", + "license": "ISC", + "devDependencies": { + "typescript": "^5.1.3" + } +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..47e4ca3 --- /dev/null +++ b/readme.md @@ -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. + + + + diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..1fe032c --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,2 @@ + +export function hello() : string; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..baaabaf --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "include": [ + "src/**/*.d.ts" + ], + "compilerOptions": { + // + } +} \ No newline at end of file