Skip to content

Commit

Permalink
ci: move src -> scripts, deno.json to repo root
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Nov 18, 2023
1 parent f977c5a commit 79e26bc
Show file tree
Hide file tree
Showing 21 changed files with 15 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deno-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ jobs:
- name: Cache Deno dependencies
uses: actions/cache@v3
with:
key: ${{ hashFiles('src/deno.lock') }}
key: ${{ hashFiles('./deno.lock') }}
path: ${{ env.DENO_DIR }}

- name: Check
working-directory: src
run: |
deno lint
deno check **/*.ts
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
paths:
- "src/**/*"
- "scripts/**/*"

env:
DENO_DIR: deno_cache
Expand Down Expand Up @@ -38,11 +38,10 @@ jobs:
- name: Cache Deno dependencies
uses: actions/cache@v3
with:
key: ${{ hashFiles('src/deno.lock') }}
key: ${{ hashFiles('./deno.lock') }}
path: ${{ env.DENO_DIR }}

- name: Generate health files
working-directory: ./src
run: deno task generate

- name: Push changes
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ jobs:
- name: Cache Deno dependencies
uses: actions/cache@v3
with:
key: ${{ hashFiles('src/deno.lock') }}
key: ${{ hashFiles('./deno.lock') }}
path: ${{ env.DENO_DIR }}

- name: Run Lint
working-directory: src
run: deno task lint
5 changes: 2 additions & 3 deletions .github/workflows/maintainers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
paths:
- "src/userstyles.yml"
- "scripts/userstyles.yml"

env:
DENO_DIR: deno_cache
Expand All @@ -27,12 +27,11 @@ jobs:
- name: Cache Deno dependencies
uses: actions/cache@v3
with:
key: ${{ hashFiles('src/deno.lock') }}
key: ${{ hashFiles('./deno.lock') }}
path: ${{ env.DENO_DIR }}

- name: Sync maintainers
if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }}
working-directory: ./src
run: deno task sync-maintainers
env:
GITHUB_TOKEN: ${{ secrets.USERSTYLES_TOKEN }}
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
},

"deno.enable": true,
"deno.config": "./src/deno.json",

"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
12 changes: 6 additions & 6 deletions src/deno.json β†’ deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"imports": {
"@/": "./",
"@/": "./scripts/",
"std/": "https://deno.land/[email protected]/",
"catppuccin-repo/": "https://raw.githubusercontent.com/catppuccin/catppuccin/91d6b5433730103c504dcf43583b594e418ee7c1/",
"@actions/core": "npm:@actions/[email protected]",
Expand All @@ -11,10 +11,10 @@
"less": "npm:[email protected]"
},
"tasks": {
"generate": "./generate/main.ts",
"lint": "./lint/main.ts",
"lint:fix": "./lint/main.ts --fix",
"sync-maintainers": "./sync-maintainers/main.ts",
"update-types": "deno run -A 'npm:json-schema-to-typescript' ./userstyles.schema.json types/userstyles.d.ts"
"ci:generate": "deno run -A ./scripts/generate/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",
"update-types": "deno run -A 'npm:json-schema-to-typescript' ./scripts/userstyles.schema.json ./scripts/types/userstyles.d.ts"
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/generate/main.ts β†’ scripts/generate/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const validate = ajv.compile<Metadata>(schema);
const validatePorts = ajv.compile<PortMetadata>(portsSchema);

const userstylesYaml = Deno.readTextFileSync(
path.join(REPO_ROOT, "src/userstyles.yml"),
path.join(REPO_ROOT, "scripts/userstyles.yml"),
);
const userstylesData = parseYaml(userstylesYaml);
if (!validate(userstylesData)) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ajv = new Ajv.default();
const validate = ajv.compile<UserstylesSchema>(schema);

const userstylesYaml = Deno.readTextFileSync(
path.join(REPO_ROOT, "src/userstyles.yml"),
path.join(REPO_ROOT, "scripts/userstyles.yml"),
);
const userstylesData = parseYaml(userstylesYaml);
if (!validate(userstylesData)) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/userstyles.yml β†’ scripts/userstyles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,4 +479,4 @@ userstyles:
answer: "It's available in case you have an OLED display. If you have one, you might want to enable this."
current-maintainers: [*isabelroses]
past-maintainers: [*elkrien]
# yaml-language-server: $schema=https://raw.githubusercontent.com/catppuccin/userstyles/main/src/userstyles.schema.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/catppuccin/userstyles/main/scripts/userstyles.schema.json

0 comments on commit 79e26bc

Please sign in to comment.