Skip to content

Commit

Permalink
chore: initial commit: Migrate from @alanlu-dev/web-kit
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlu-zyl committed Apr 27, 2024
0 parents commit c66934d
Show file tree
Hide file tree
Showing 57 changed files with 17,792 additions and 0 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)
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "alanlu-dev/notion-kit"
}
],
"commit": false,
"fixed": [["@alanlu-dev/notion-*"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
1 change: 1 addition & 0 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@alanlu-dev/commitlint-config')
32 changes: 32 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Matches all files
[*]
# Non-configurable Prettier behaviors
charset = utf-8
insert_final_newline = true
# Caveat: Prettier won’t trim trailing whitespace inside template strings, but your editor might.
trim_trailing_whitespace = true

# Configurable Prettier behaviors
# (change these if your Prettier config differs)
end_of_line = lf
indent_style = space
indent_size = 2
max_line_length = 200

[*.{md,mdx}]
indent_style = tab
max_line_length = off

[*.{yaml,yml,conf}]
indent_size = 2

# Shell scripts
[*.sh]
end_of_line = lf
[*.{cmd,bat}]
end_of_line = crlf
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
124 changes: 124 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: CI

on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- main
- release/*
- feat/*
- fix/*
- perf/*
pull_request:
workflow_dispatch:

env:
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
lint:
timeout-minutes: 10
name: 'Lint'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Build
run: pnpm run build

- name: Lint
run: pnpm run lint

- name: TypeCheck
run: pnpm run typecheck

- name: CSpell
uses: streetsidesoftware/cspell-action@v6

# From https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
- name: Check workflow files
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -shellcheck=""
test:
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node_version: [18, 20]
include:
# Active LTS + other OS
- os: macos-latest
node_version: 20
- os: windows-latest
node_version: 20
fail-fast: false

name: 'Build & Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Assume PRs are less than 50 commits
fetch-depth: 50

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@20576b4b9ed46d41e2d45a2256e5e2316dde6834 # v43.0.1
with:
files: |
docs/**
.github/**
!.github/workflows/ci.yml
**.md
- name: Install pnpm
if: steps.changed-files.outputs.only_changed != 'true'
uses: pnpm/action-setup@v3

- name: Set node version to ${{ matrix.node_version }}
if: steps.changed-files.outputs.only_changed != 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'

- name: Install deps
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm install

- name: Build
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run build

- name: Test unit
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run test
env:
NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }}
NOTION_PAGE_ID: ${{ secrets.NOTION_PAGE_ID }}
NOTION_DATABASE_ID: ${{ secrets.NOTION_DATABASE_ID }}
NOTION_DASHBOARD_ID: ${{ secrets.NOTION_DASHBOARD_ID }}
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
push:
branches:
- main

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

permissions: {}
jobs:
release:
name: Release
permissions:
contents: write # to create release (changesets/action)
issues: write # to post issue comments (changesets/action)
pull-requests: write # to create pull request (changesets/action)
timeout-minutes: 20
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Build
run: pnpm run build

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
version: pnpm run update:version
publish: pnpm run publish
commit: "chore(release): version update"
title: "chore(release): version update"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Dependencies
node_modules

# Build files
.output
.nuxt
.nitro
.cache
.virtual
.turbo
dist
build
tsx-0
node-jiti

# Logs
logs
*.log

# Miscellaneous
.DS_Store
.fleet
.idea

# Local environment files
.env
.env.*
!.env.example
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
1 change: 1 addition & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@alanlu-dev/lint-staged-config')
1 change: 1 addition & 0 deletions .markdownlint-cli2.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@alanlu-dev/markdownlint-config')
7 changes: 7 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
auto-install-peers=true
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=*markdownlint*
public-hoist-pattern[]=*commitlint*
public-hoist-pattern[]=czg
public-hoist-pattern[]=lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.12.2
35 changes: 35 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Dependencies
**/node_modules

# Build files
**/.output
**/.nuxt
**/.nitro
**/.cache
**/.virtual
**/.turbo
**/dist
**/build
**/tsx-0
**/node-jiti
**/coverage

# Logs
**/logs
**/*.log

# Miscellaneous
**/.DS_Store
**/.fleet
**/.idea
pnpm-lock.yaml

# Local environment files
**/.env
**/.env.*
**/!.env.example

# Markdown files
**/*.md
**/*.mdx

1 change: 1 addition & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@alanlu-dev/prettier-config')
13 changes: 13 additions & 0 deletions .vscode/.cspell/name.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Custom Dictionary Words
alanlu
Anson
antfu
dbaeumer
esbenp
Giraudel
Indrek
indrekpaas
Paas
Riethmuller's
shimataro
vogelino
25 changes: 25 additions & 0 deletions .vscode/.cspell/other.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Custom Dictionary Words
abjad
akar
autorestart
bluewood
breakline
datetime
evenodd
Fira
fullname
infile
jiti
multistep
noborder
noobserver
Noto
Overriden
preinstall
shellcheck
stroustrup
toggleable
typecheck
unref
wght
zod's
Loading

0 comments on commit c66934d

Please sign in to comment.