Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Azure Data Studio compatibility #230

Merged
merged 6 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ module.exports = {
],
overrides: [
{
extends: ["plugin:@typescript-eslint/disable-type-checked"],
files: ["./tsup.config.ts"],
// eslint is having trouble linting its own config file
files: [".eslintrc.js"],
rules: { "@typescript-eslint/no-var-requires": "off", "no-undef": "off" },
},
],
parser: "@typescript-eslint/parser",
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,27 @@ on:
name: "Chromatic"

jobs:
chromatic-deployment:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- run: corepack enable
- name: Install dependencies & build
run: |
yarn install --immutable
yarn build

- run: yarn install --immutable

- run: yarn build

- name: Publish to Chromatic
uses: chromaui/action@v1
with:
buildScriptName: "storybook:build"
exitOnceUploaded: true
projectToken: "chpt_e3cba49738d7554"
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- run: corepack enable
- name: Install dependencies & build

- run: yarn install --immutable

- run: yarn lint

- name: Build
run: |
yarn install --immutable
yarn build
- name: Lint
run: yarn lint
- name: Package Extension
id: packageExtension
uses: HaaLeo/publish-vscode-extension@v1
with:
yarn: true
pat: stub
dryRun: true
yarn build:ads

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: catppuccin-vsc.vsix
path: ${{ steps.packageExtension.outputs.vsixPath }}
path: catppuccin-*.vsix
31 changes: 15 additions & 16 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,23 @@ jobs:
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- run: corepack enable

- name: Build
run: |
yarn install --immutable
yarn build
- run: yarn install --immutable

- name: Build VSCode
id: build-vscode
run: yarn build

- name: Build Azure Data Studio
id: build-ads
run: yarn build:ads

- name: Publish to orphaned branch
uses: peaceiris/actions-gh-pages@v3
Expand All @@ -48,35 +55,27 @@ jobs:
exclude_assets: ".flag"
enable_jekyll: true

- name: Package Extension
id: packageExtension
uses: HaaLeo/publish-vscode-extension@v1
with:
yarn: true
pat: stub
dryRun: true

- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
yarn: true
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
extensionFile: ${{ steps.packageExtension.outputs.vsixPath }}
extensionFile: ${{ steps.build-vscode.outputs.vsixPath }}
registryUrl: https://marketplace.visualstudio.com

- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
# continue even if OpenVSX fails
# -> see https://github.com/catppuccin/vscode/issues/51
continue-on-error: true
timeout-minutes: 10
# see issue #51
with:
yarn: true
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ${{ steps.packageExtension.outputs.vsixPath }}
extensionFile: ${{ steps.build-vscode.outputs.vsixPath }}

- name: Add files to GH Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release-please.outputs.tag_name }} ${{ steps.packageExtension.outputs.vsixPath }}
gh release upload ${{ needs.release-please.outputs.tag_name }} catppuccin-*.vsix
35 changes: 35 additions & 0 deletions build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { setOutput } from "@actions/core";
import { createVSIX } from "@vscode/vsce";
import { build } from "tsup";
import { getFlag } from "type-flag";

import updatePackageJson from "./src/hooks/updatePackageJson";
import generateThemes from "./src/hooks/generateThemes";

const buildForADS = getFlag("--ads", Boolean);
const dev = getFlag("--dev", Boolean);

(async () => {
await generateThemes();
const packageJson = await updatePackageJson({ buildForADS });

await build({
clean: true,
entry: ["src/browser.ts", "src/main.ts", "src/hooks/generateThemes.ts"],
external: ["vscode"],
minify: !dev,
sourcemap: dev,
splitting: true,
target: "node16",
});

const shortName = buildForADS ? "ads" : "vsc";
const packagePath = `catppuccin-${shortName}-${packageJson.version}.vsix`;

await createVSIX({ useYarn: true, packagePath });

// restore the original package.json when building for ADS
if (buildForADS) await updatePackageJson();
// the upload step in the CI required the path to the vsix file
if (process.env.CI) setOutput("vsixPath", packagePath);
})();
8 changes: 5 additions & 3 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

buildPhase = ''
runHook preBuild
yarn compile
yarn build
runHook postBuild
'';

Expand All @@ -55,13 +55,15 @@
runHook postPatch
'';

env.CATPPUCCIN_OPTIONS = builtins.toJSON options;

buildPhase = ''
runHook preBuild
mkdir -p themes dist
cp -r ${builder}/* dist/
touch ./themes/.flag
node dist/hooks/generateThemes.js '${builtins.toJSON options}'
vsce package --allow-star-activation --yarn
node dist/hooks/generateThemes.js
vsce package --yarn
runHook postBuild
'';

Expand Down
8 changes: 6 additions & 2 deletions nix/yarn-project.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
"type": "object",
"default": {},
"markdownDescription": "Custom color overrides. Assign your own hex codes to palette colors. See [the docs](https://github.com/catppuccin/vscode#override-palette-colors) for reference.",
"$ref": "https://cdn.jsdelivr.net/gh/catppuccin/[email protected].0/schemas/colorOverrides.schema.json"
"$ref": "https://cdn.jsdelivr.net/gh/catppuccin/[email protected].1/schemas/colorOverrides.schema.json"
},
"catppuccin.customUIColors": {
"type": "object",
"default": {},
"markdownDescription": "Customize UI colors. Map `workbench.colorCustomizations` to palette colors. See [the docs](https://github.com/catppuccin/vscode#use-palette-colors-on-workbench-elements-ui) for reference.",
"$ref": "https://cdn.jsdelivr.net/gh/catppuccin/[email protected].0/schemas/customUIColors.schema.json"
"$ref": "https://cdn.jsdelivr.net/gh/catppuccin/[email protected].1/schemas/customUIColors.schema.json"
},
"catppuccin.accentColor": {
"type": "string",
Expand Down Expand Up @@ -159,6 +159,7 @@
"isPreReleaseVersion": false
},
"devDependencies": {
"@actions/core": "^1.10.1",
"@catppuccin/palette": "^0.2.0",
"@storybook/addon-essentials": "^7.5.3",
"@storybook/addon-styling": "^1.3.7",
Expand Down Expand Up @@ -186,6 +187,7 @@
"storybook": "^7.5.3",
"tsup": "^8.0.1",
"tsx": "^4.6.0",
"type-flag": "^3.0.0",
"typescript": "^5.3.2",
"vite": "^4.5.0"
},
Expand All @@ -194,16 +196,15 @@
"*.{ts,json,md}": "prettier --write"
},
"scripts": {
"build": "yarn hooks && yarn compile",
"build-storybook": "storybook build",
"build": "tsx build.ts",
"build:ads": "tsx build.ts --ads",
"chromatic": "chromatic --exit-zero-on-changes --exit-once-uploaded --project-token chpt_e3cba49738d7554",
"compile": "tsup",
"dev": "yarn compile:theme && yarn compile --env.NODE_ENV development",
"hooks": "tsx src/hooks/index.ts",
"dev": "tsx build.ts --dev",
"lint": "eslint . --ext .ts",
"package": "vsce package --allow-star-activation --yarn",
"package": "vsce package --yarn",
"prepare": "husky install",
"storybook": "storybook dev -p 6006",
"storybook:build": "storybook build",
"storybook:dev": "storybook dev -p 6006",
"update-types": "tsx src/hooks/updateVSCtypes.ts"
},
"packageManager": "[email protected]"
Expand Down
Loading