Skip to content

Commit 5dce139

Browse files
committed
Github action to publish package and documentation
1 parent bd2d425 commit 5dce139

File tree

3 files changed

+70
-1
lines changed

3 files changed

+70
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to GitHub Packages
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: '18'
19+
registry-url: 'https://npm.pkg.github.com'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Build
25+
run: npm run build
26+
27+
- name: Publish
28+
run: npm publish
29+
env:
30+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# create-node-ts
2+
3+
`create-node-ts` is a project generator for creating Node.js applications with TypeScript. It sets up a new project with a basic structure and some default configuration, including Jest for testing, Prettier for code formatting, and Husky for Git hooks.
4+
5+
## Installation
6+
7+
You don't need to install `create-node-ts` to use it. Instead, you can use `npx`:
8+
9+
```bash
10+
npx @marchintosh94/create-node-ts
11+
```
12+
13+
This will run create-node-ts and start the process of setting up a new project.
14+
15+
## Usage
16+
When you run `create-node-ts`, it will prompt you for some information about your project:
17+
18+
- `Project name`: The name of your new project.
19+
20+
After you've provided this information, `create-node-ts` will create a new directory (if you choose to create it) with your project name, set up the project structure, and install the dependencies.
21+
22+
The generated project includes the following files and directories:
23+
24+
- `src`: This directory is where your TypeScript source code goes.
25+
- `package.json`: This file contains the metadata about your project and its dependencies.
26+
- `tsconfig.json`: This file is the TypeScript compiler configuration.
27+
- `jest.config.ts`: This file is the Jest configuration.
28+
- `.gitignore`: This file tells Git which files to ignore.
29+
- `.prettierrc` and `.prettierignore`: These files are the Prettier configuration.
30+
In addition, `create-node-ts` initializes a Git repository in your project directory and sets up Husky to run tests and linting before each commit.
31+
32+
## Contributing
33+
Contributions to `create-node-ts` are welcome! Please open an issue or submit a pull request on GitHub.
34+
35+
## License
36+
`create-node-ts` is licensed under the MIT license. See the LICENSE file for more information.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "create-node-ts",
2+
"name": "@marchintosh94/create-node-ts",
33
"version": "1.0.0",
44
"description": "NodeJS TypeScript projects generator by @marchintosh",
55
"main": "dist/index.js",
@@ -19,6 +19,9 @@
1919
"node"
2020
],
2121
"author": "marchintosh94 <[email protected]>",
22+
"publishConfig": {
23+
"registry": "https://npm.pkg.github.com"
24+
},
2225
"license": "MIT",
2326
"devDependencies": {
2427
"ts-node": "^10.4.0",

0 commit comments

Comments
 (0)