Skip to content

Commit

Permalink
Merge pull request #1 from ageddesi/v2.0.0
Browse files Browse the repository at this point in the history
v2.0.0 candidate
  • Loading branch information
ageddesi authored Sep 11, 2023
2 parents e0b1ea7 + 4f87145 commit e31b7e4
Show file tree
Hide file tree
Showing 7 changed files with 4,360 additions and 2,662 deletions.
29 changes: 29 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Pull request template

***REMOVE THIS - START***

1. Title should be something descriptive about what you're changes do. (It will default to whatever you put as your commit message.)
2. Make sure to point to `dev` branch;
3. Mark your pull request as `DRAFT` until it will be ready to review;
4. Before marking a PR ready to review, make sure that:

a. You have done your changes in a separate branch. Branches MUST have descriptive names that start with either the `fix/` or `feature/` prefixes. Good examples are: `fix/signin-issue` or `feature/issue-templates`.

b. `npm test` doesn't throw any error.

5. Describe your changes, link to the issue and add images if relevant under each #TODO next comments;
6. MAKE SURE TO CLEAN ALL THIS 6 POINTS BEFORE SUBMITTING

***REMOVE THIS - END***

## Describe your changes
TODO: Add a short summary of your changes and impact:

## Link to issue this resolves
TODO: Add your issue no. or link to the issue. Example:
Fixes: #100

## Screenshot of changes(if relevant)
TODO: Add images:

🙏🙏 !! THANK YOU !! 🚀🚀
32 changes: 32 additions & 0 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Create NPM Package

on:
workflow_dispatch:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- name: Install NPM dependencies
run: npm install
- name: Run tests
run: npm run test
- name: Create NPM package
run: npm run build
- name: Publish NPM package
run: npm publish --registry https://npm.pkg.github.com/ --verbose
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test Library

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
- name: Install NPM dependencies
run: npm install
- name: Run tests
run: npm run test
- name: Clean up files
run: npm run clean-up
- name: Attempt dry run build of package
run: npm pack --dry-run
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This example project exports a package for adding and subtract numbers.

To get started you can delete everything inside the src folder except for index.ts, this is the entry point for the package.

> When you are ready to build this package, make sure you search for the phrase 'my-lib' and replace this with the name of your package.
## Tech Stack

- Vite
Expand All @@ -13,6 +15,7 @@ To get started you can delete everything inside the src folder except for index.

It includes test examples using vite test


# COMMANDS
## run build for local dist testing
npm run build
Expand Down Expand Up @@ -45,4 +48,55 @@ npm run clean-up
## Semantic Release
This project already has semantic-release as a dependecy. To get the full benifits of this all commit messages should be in the format it requires. You can see that in their readme [here](https://github.com/semantic-release/semantic-release)

The next step is for your CI to be setup to use semantic-release. You can read how to do that [here](https://github.com/semantic-release/semantic-release/blob/HEAD/docs/usage/getting-started.md#getting-started)
The next step is for your CI to be setup to use semantic-release. You can read how to do that [here](https://github.com/semantic-release/semantic-release/blob/HEAD/docs/usage/getting-started.md#getting-started)

# Things to know when publishing your package to github.

1. Set up your repository url inside your package.json set up correctly.

```
"repository": {
"type": "git",
"url": "https://github.com/ageddesi/vite-ts-package-starter.git"
},
```

2. Update publishConfig so it is pointing to the github package repository

```
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
```

3. If you are part of an organization on github, make sure you have that organization alias in your package.json name eg.

```
"name": "@org-alias/ts-npm-package-boilerplate",
```

If you are also using our github workflow to publish the package, you will need to update the registry defintion with the scope.

Replace.

```
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
```

with

```
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
scope: '@org-alias/'
```


4. If you are using our workflow to build and deploy to github you will need to first create a secret key and attach it to your repo with the following name.

```
secrets.GITHUB_TOKEN
```
Loading

0 comments on commit e31b7e4

Please sign in to comment.