Skip to content

Commit

Permalink
add versioning & changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
calender-sync committed May 14, 2024
1 parent 3958c69 commit 514b391
Show file tree
Hide file tree
Showing 13 changed files with 898 additions and 182 deletions.
7 changes: 5 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/changelog-git",
"changelog": [
"@changesets/changelog-github",
{ "repo": "calender-sync/calender-sync-monorepo" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Expand Down
8 changes: 7 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
ignorePatterns: ["apps/**", "packages/**", "configs/**", "tests/**"],
ignorePatterns: [
"apps/**",
"packages/**",
"configs/**",
"tests/**",
"**/*.cjs",
],
extends: ["custom/node.js"],
}
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on:
push:
branches:
- "**"

jobs:
build:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js v20
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm run lint

- name: Build
run: pnpm run build
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
branches:
- main

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

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js v20
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions configs/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-refresh": "^0.4.7",
"eslint-plugin-storybook": "^0.8.0",
"typescript": "^5.4.5"
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"storybook": "turbo run storybook",
"build": "turbo run build",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx}\"",
"test": "turbo run test"
"test": "turbo run test",
"bump": "node ./scripts/bump.cjs",
"release": "node ./scripts/release.cjs"
},
"devDependencies": {
"@changesets/changelog-git": "^0.2.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"eslint": "^8.57.0",
"eslint-config-custom": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions packages/@calender-sync/core/src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Dayjs, UnitType } from "dayjs"
import type { ConfigType, Dayjs, UnitType } from "dayjs"

interface CalendarEventOrganizer {
name: string
Expand All @@ -7,8 +7,8 @@ interface CalendarEventOrganizer {

interface CalendarEvent {
title: string
start: any
end?: any
start: ConfigType
end?: ConfigType
duration?: [number, UnitType]
allDay?: boolean
rRule?: string
Expand Down
2 changes: 1 addition & 1 deletion packages/@calender-sync/hooks/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function useCalenderSync() {
event: CalendarEvent,
newTab = true,
) => {
let url = generateCalendarUrl(type, event)
const url = generateCalendarUrl(type, event)

if (newTab) {
window.open(url, "_blank")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
import { type Config } from "tailwindcss"

const config = {
darkMode: ["class"],
content: ["./src/**/*.{ts,tsx}"],
prefix: "",
Expand Down Expand Up @@ -35,4 +36,6 @@ module.exports = {
},
},
},
}
} satisfies Config

export default config
Loading

0 comments on commit 514b391

Please sign in to comment.