Skip to content

Commit

Permalink
Merge branch 'feature/setup-github-workflows'
Browse files Browse the repository at this point in the history
  • Loading branch information
royteusink committed Dec 18, 2023
2 parents f129ffd + c68d9ae commit cb1faec
Show file tree
Hide file tree
Showing 6 changed files with 1,873 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Setup Yarn
uses: borales/actions-yarn@v4
with:
cmd: install --frozen-lockfile

- name: Lint
run: yarn lint

- name: Test
run: yarn test --run

- name: Build
run: yarn build
39 changes: 39 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to NPM

on:
workflow_run:
workflows: [CI]
branches: [master]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Setup Yarn
uses: borales/actions-yarn@v4
with:
cmd: install --frozen-lockfile

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@
"name": "stackid",
"version": "1.0.0",
"description": "A lightweight JavaScript package for managing stacked views like modals. Easily create, push, and pop while ensuring secure closure using unique IDs. Ideal for handling modal interactions, such as closing with specific triggers like 'esc' key, while maintaining a clean and efficient stack structure.",
"keywords": ["stack", "modal", "overlay", "unique", "dialog", "esc"],
"keywords": [
"stack",
"modal",
"overlay",
"unique",
"dialog",
"esc"
],
"author": "Roy Teusink",
"license": "MIT",
"private": false,
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts",
"lint": "tsc",
"test": "vitest"
"test": "vitest",
"release": "yarn build && changeset publish"
},
"homepage": "https://github.com/royteusink/stackid#readme",
"repository": {
Expand All @@ -22,6 +31,7 @@
"url": "https://github.com/royteusink/stackid/issues"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"vitest": "^1.0.4"
Expand Down
Loading

0 comments on commit cb1faec

Please sign in to comment.