-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into docs/needs-maintainer
- Loading branch information
Showing
69 changed files
with
499 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Lint & Build | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
lint: | ||
name: Lint Userstyles | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Deno | ||
uses: nekowinston/setup-deno@main | ||
with: | ||
deno-version: v1.x | ||
|
||
- name: Run Lint | ||
run: deno task lint | ||
|
||
build: | ||
name: Generate Stylus Export | ||
runs-on: ubuntu-latest | ||
needs: lint | ||
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }} | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.USERSTYLES_TOKEN }} | ||
ref: ${{ github.ref }} | ||
|
||
- name: Setup Deno | ||
uses: nekowinston/setup-deno@main | ||
with: | ||
deno-version: v1.x | ||
|
||
- name: Generate import file | ||
run: deno task ci:generate-import | ||
|
||
- name: Upload Release Artifacts | ||
run: gh release upload --clobber all-userstyles-export ./dist/import.json | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
deno_cache/ | ||
node_modules/ | ||
dist/ | ||
.DS_Store | ||
.idea | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,14 @@ | |
"@actions/core": "npm:@actions/[email protected]", | ||
"@octokit/rest": "npm:@octokit/[email protected]", | ||
"ajv": "npm:[email protected]", | ||
"type-fest/": "https://esm.sh/v135/[email protected]/", | ||
"handlebars": "npm:[email protected]", | ||
"less": "npm:[email protected]", | ||
"usercss-meta": "npm:[email protected]" | ||
}, | ||
"tasks": { | ||
"ci:generate": "deno run -A ./scripts/generate/main.ts", | ||
"ci:generate-import": "deno run -A ./scripts/import-styles/main.ts", | ||
"ci:sync-maintainers": "deno run -A ./scripts/sync-maintainers/main.ts", | ||
"lint": "deno run -A ./scripts/lint/main.ts", | ||
"lint:fix": "deno task lint --fix", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env -S deno run -A | ||
import usercssMeta from "usercss-meta"; | ||
import { ensureDir } from "std/fs/mod.ts"; | ||
import { walk } from "std/fs/walk.ts"; | ||
import { join } from "std/path/mod.ts"; | ||
|
||
import { REPO_ROOT } from "@/deps.ts"; | ||
|
||
const stylesheets = walk(join(REPO_ROOT, "styles"), { | ||
includeFiles: true, | ||
includeDirs: false, | ||
includeSymlinks: false, | ||
match: [/\.user.css$/], | ||
}); | ||
|
||
// Recommended settings. | ||
const settings = { | ||
settings: { | ||
updateInterval: 24, | ||
updateOnlyEnabled: true, | ||
patchCsp: true, | ||
}, | ||
}; | ||
|
||
const data: Record<string, unknown>[] = [settings]; | ||
|
||
for await (const entry of stylesheets) { | ||
const content = await Deno.readTextFile(entry.path); | ||
const { metadata } = usercssMeta.parse(content); | ||
|
||
data.push({ | ||
enabled: true, | ||
name: metadata.name, | ||
description: metadata.description, | ||
author: metadata.author, | ||
url: metadata.url, | ||
updateUrl: metadata.updateURL, | ||
usercssData: metadata, | ||
sourceCode: content, | ||
}); | ||
} | ||
|
||
ensureDir("dist"); | ||
Deno.writeTextFile("dist/import.json", JSON.stringify(data)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.