Skip to content

Commit

Permalink
Merge pull request #105 from catuhana/port-to-deno
Browse files Browse the repository at this point in the history
Port to Deno
  • Loading branch information
catuhana authored Jul 19, 2024
2 parents 14f11be + 02ad0de commit 59ebbb9
Show file tree
Hide file tree
Showing 21 changed files with 586 additions and 3,299 deletions.
4 changes: 0 additions & 4 deletions .github/renovate.json

This file was deleted.

52 changes: 22 additions & 30 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,46 @@ 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

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

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

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

- name: Build package
run: pnpm build
- name: Build npm package
run: deno task build:npm
25 changes: 13 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ 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
- name: Set-up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
node-version: 18
registry-url: https://registry.npmjs.org

- name: Install packages
run: pnpm i
- name: Build npm package
run: deno task build:npm

- name: Generate release notes
uses: actions/github-script@v7
Expand All @@ -42,10 +43,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
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"[typescript][markdown][json][jsonc][yaml]": {
"deno.enable": true,
"[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.

31 changes: 31 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@tuhana/unocss-catppuccin",
"version": "1.0.2",
"tasks": {
"build:npm": "deno run -A scripts/build_npm.ts"
},
"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"
},
"test": {
"exclude": ["npm/"]
},
"fmt": {
"exclude": ["npm/"],
"indentWidth": 2,
"semiColons": true,
"singleQuote": true
},
"lint": {
"exclude": ["npm/"]
}
}
Loading

0 comments on commit 59ebbb9

Please sign in to comment.