Skip to content

Commit

Permalink
Port to Deno
Browse files Browse the repository at this point in the history
  • Loading branch information
catuhana committed Jul 18, 2024
1 parent 14f11be commit 4e85198
Show file tree
Hide file tree
Showing 20 changed files with 427 additions and 3,159 deletions.
53 changes: 23 additions & 30 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,47 @@ name: CI

on:
push:
paths:
- .github/workflows/ci.yaml
- src/**
- .prettierrc
- build.config.ts
- package.json
- pnpm-lock.yaml
- tsconfig.json
paths-ignore:
- .github/FUNDING.yml
- .vscode/**
- LICENCE
- README.md
pull_request:
paths-ignore:
- .github/FUNDING.yml
- .vscode/**
- LICENCE
- README.md
branches:
- main
paths:
- .github/workflows/ci.yaml
- src/**
- .prettierrc
- build.config.ts
- package.json
- pnpm-lock.yaml
- tsconfig.json

jobs:
build_and_lint:
name: Build and Lint
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18, 20, latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Set-up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Install Node ${{ matrix.node_version }}
- name: Set-up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: pnpm
node-version: 18
cache: npm

- name: Install packages
run: pnpm i
- name: Check linting
run: deno task lint

- name: Check formatting
run: pnpm lint:prettier
run: deno task lint:fmt

- name: Run tests
run: pnpm test
run: deno test

- name: Build package
run: pnpm build
- name: Build npm package
run: deno task build:npm
23 changes: 11 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Set-up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
node-version: 18
cache: npm
registry-url: https://registry.npmjs.org

- name: Install packages
run: pnpm i

- name: Generate release notes
uses: actions/github-script@v7
with:
Expand All @@ -42,10 +41,10 @@ jobs:
generate_release_notes: true
})
- name: Publish to NPM
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to JSR
run: npx jsr publish

- name: Publish to npm
run: cd npm && npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules/
dist/
npm/
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

20 changes: 0 additions & 20 deletions .prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"aaron-bond.better-comments",
"denoland.vscode-deno",
"esbenp.prettier-vscode",
"gruntfuggly.todo-tree",
"vitest.explorer"
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"[typescript][markdown][json][jsonc][yaml]": {
"[typescript][json][jsonc]": {
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[markdown][yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ deno add unocss-catppuccin

# Usage

To use Catppuccin, simply include the `presetCatppuccin` preset in your UnoCSS configuration.
To use Catppuccin, simply include the `presetCatppuccin` preset in your UnoCSS
configuration.

```ts
// unocss.config.ts
Expand Down
7 changes: 0 additions & 7 deletions build.config.ts

This file was deleted.

26 changes: 26 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@tuhana/unocss-catppuccin",
"version": "1.0.2",
"tasks": {
"build:npm": "deno run -A scripts/build_npm.ts",
"lint": "deno lint",
"lint:fmt": "deno fmt --check"
},
"imports": {
"@catppuccin/palette": "npm:@catppuccin/palette@^1.2.0",
"@deno/dnt": "jsr:@deno/dnt@^0.41.2",
"@std/assert": "jsr:@std/assert@^1.0.0",
"@std/testing": "jsr:@std/testing@^0.225.3",
"@unocss/core": "npm:@unocss/core@^0.61.5"
},
"exports": {
".": "./src/index.ts",
"./extend": "./src/extend.ts",
"./types": "./src/types.ts"
},
"fmt": {
"indentWidth": 2,
"semiColons": true,
"singleQuote": true
}
}
Loading

0 comments on commit 4e85198

Please sign in to comment.