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: Generative variants #47

Closed
Closed
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ node_modules
.vscode-test/
*.vsix
src/symbol-icon-theme.modified.json
.DS_Store
.DS_Store

/variants
25 changes: 7 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"publisher": "miguelsolorio",
"icon": "symbols.png",
"preview": true,
"main": "./src/extension.js",
"engines": {
"vscode": "^1.70.0"
},
Expand All @@ -30,34 +29,24 @@
"author": {
"name": "Miguel Solorio"
},
"activationEvents": [
"onStartupFinished"
],
"contributes": {
"iconThemes": [
{
"id": "symbols",
"label": "Symbol Icons",
"path": "./src/symbol-icon-theme.modified.json"
}
],
"configuration": {
"type": "object",
"title": "Symbols",
"properties": {
"symbols.hidesExplorerArrows": {
"type": "boolean",
"default": false,
"description": "Hide arrow icons in the explorer section."
}
"path": "./variants/symbol-icon-theme.json"
},
{
"id": "symbols-no-folder-arrows",
"label": "Symbol Icons (No Folder Arrows)",
"path": "./variants/symbol-icon-theme.no-arrows.json"
}
}
]
},
"scripts": {
"release": "release-it"
},
"devDependencies": {
"@types/vscode": "^1.70.0",
"release-it": "^15.3.0"
}
}
51 changes: 51 additions & 0 deletions scripts/generate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env node

const path = require("path");
const fs = require("fs");

const basePath = path.resolve(__dirname);

const sourceThemePath = path.join(
basePath,
"..",
"src",
"symbol-icon-theme.json"
);

const sourcethemeJSON = require(sourceThemePath);

// make variant directory
const outPath = path.join(basePath, "..", "variants");
fs.mkdirSync(outPath, { recursive: true });


// replace paths with relative paths
Object.keys(sourcethemeJSON.iconDefinitions).forEach(iconDef=>{
const ogPath = path.join("src",sourcethemeJSON.iconDefinitions[iconDef].iconPath)
const relativePath = path.relative(outPath,ogPath)
sourcethemeJSON.iconDefinitions[iconDef].iconPath = relativePath
})


const variants = {
default: {
name: "symbol-icon-theme.json",
theme: { ...sourcethemeJSON },
},
};

variants.noFolderArrows = {
name: "symbol-icon-theme.no-arrows.json",
theme: {
...sourcethemeJSON,
hidesExplorerArrows: true,
},
};

// write to files
Object.keys(variants).forEach((key) => {
fs.writeFileSync(
path.join(outPath, variants[key].name),
JSON.stringify(variants[key].theme, null, 2)
);
});
29 changes: 0 additions & 29 deletions src/extension.js

This file was deleted.

26 changes: 0 additions & 26 deletions src/lib/change-listener.js

This file was deleted.

77 changes: 0 additions & 77 deletions src/lib/config.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/lib/constants.js

This file was deleted.

122 changes: 0 additions & 122 deletions src/lib/theme.js

This file was deleted.

Loading