Added build-licenses command to style tree
This commit is contained in:
parent
4918ad5789
commit
c44acaefff
22 changed files with 632 additions and 403 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -9,7 +9,7 @@
|
||||||
/assets/themes/*.json
|
/assets/themes/*.json
|
||||||
/assets/themes/Internal/*.json
|
/assets/themes/Internal/*.json
|
||||||
/assets/themes/Experiments/*.json
|
/assets/themes/Experiments/*.json
|
||||||
/assets/licenses.md
|
/assets/*licenses.md
|
||||||
**/venv
|
**/venv
|
||||||
.build
|
.build
|
||||||
Packages
|
Packages
|
||||||
|
|
|
@ -339,7 +339,11 @@ pub fn menus() -> Vec<Menu<'static>> {
|
||||||
},
|
},
|
||||||
MenuItem::Action {
|
MenuItem::Action {
|
||||||
name: "View Dependency Licenses",
|
name: "View Dependency Licenses",
|
||||||
action: Box::new(crate::OpenLicenses),
|
action: Box::new(crate::OpenSoftwareLicenses),
|
||||||
|
},
|
||||||
|
MenuItem::Action {
|
||||||
|
name: "View Theme Licenses",
|
||||||
|
action: Box::new(crate::OpenThemeLicenses),
|
||||||
},
|
},
|
||||||
MenuItem::Separator,
|
MenuItem::Separator,
|
||||||
MenuItem::Action {
|
MenuItem::Action {
|
||||||
|
|
|
@ -57,7 +57,8 @@ actions!(
|
||||||
DebugElements,
|
DebugElements,
|
||||||
OpenSettings,
|
OpenSettings,
|
||||||
OpenLog,
|
OpenLog,
|
||||||
OpenLicenses,
|
OpenSoftwareLicenses,
|
||||||
|
OpenThemeLicenses,
|
||||||
OpenTelemetryLog,
|
OpenTelemetryLog,
|
||||||
OpenKeymap,
|
OpenKeymap,
|
||||||
OpenDefaultSettings,
|
OpenDefaultSettings,
|
||||||
|
@ -179,17 +180,32 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
|
||||||
});
|
});
|
||||||
cx.add_action({
|
cx.add_action({
|
||||||
let app_state = app_state.clone();
|
let app_state = app_state.clone();
|
||||||
move |workspace: &mut Workspace, _: &OpenLicenses, cx: &mut ViewContext<Workspace>| {
|
move |workspace: &mut Workspace,
|
||||||
|
_: &OpenSoftwareLicenses,
|
||||||
|
cx: &mut ViewContext<Workspace>| {
|
||||||
open_bundled_file(
|
open_bundled_file(
|
||||||
workspace,
|
workspace,
|
||||||
app_state.clone(),
|
app_state.clone(),
|
||||||
"licenses.md",
|
"software_licenses.md",
|
||||||
"Open Source License Attribution",
|
"Open Source License Attribution",
|
||||||
"Markdown",
|
"Markdown",
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
cx.add_action({
|
||||||
|
let app_state = app_state.clone();
|
||||||
|
move |workspace: &mut Workspace, _: &OpenThemeLicenses, cx: &mut ViewContext<Workspace>| {
|
||||||
|
open_bundled_file(
|
||||||
|
workspace,
|
||||||
|
app_state.clone(),
|
||||||
|
"theme_licenses.md",
|
||||||
|
"Theme License Attribution",
|
||||||
|
"Markdown",
|
||||||
|
cx,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
cx.add_action({
|
cx.add_action({
|
||||||
let app_state = app_state.clone();
|
let app_state = app_state.clone();
|
||||||
move |workspace: &mut Workspace, _: &OpenTelemetryLog, cx: &mut ViewContext<Workspace>| {
|
move |workspace: &mut Workspace, _: &OpenTelemetryLog, cx: &mut ViewContext<Workspace>| {
|
||||||
|
|
|
@ -4,12 +4,18 @@ set -e
|
||||||
|
|
||||||
[[ "$(cargo about --version)" == "cargo-about 0.5.2" ]] || cargo install cargo-about --locked --git https://github.com/zed-industries/cargo-about --branch error-code-on-warn
|
[[ "$(cargo about --version)" == "cargo-about 0.5.2" ]] || cargo install cargo-about --locked --git https://github.com/zed-industries/cargo-about --branch error-code-on-warn
|
||||||
|
|
||||||
cargo about generate --fail-on-missing-license -o assets/licenses.md -c script/licenses/zed-licenses.toml script/licenses/template.hbs.md
|
echo "Generating cargo licenses"
|
||||||
|
cargo about generate --fail-on-missing-license -o assets/software_licenses.md -c script/licenses/zed-licenses.toml script/licenses/template.hbs.md
|
||||||
|
|
||||||
# cargo about automatically html-escapes all output, so we need to undo it here:
|
# cargo about automatically html-escapes all output, so we need to undo it here:
|
||||||
sed -i '' 's/"/"/g' assets/licenses.md
|
sed -i '' 's/"/"/g' assets/software_licenses.md
|
||||||
sed -i '' 's/'/'\''/g' assets/licenses.md # `'\''` ends the string, appends a single quote, and re-opens the string
|
sed -i '' 's/'/'\''/g' assets/software_licenses.md # `'\''` ends the string, appends a single quote, and re-opens the string
|
||||||
sed -i '' 's/=/=/g' assets/licenses.md
|
sed -i '' 's/=/=/g' assets/software_licenses.md
|
||||||
sed -i '' 's/`/`/g' assets/licenses.md
|
sed -i '' 's/`/`/g' assets/software_licenses.md
|
||||||
sed -i '' 's/</</g' assets/licenses.md
|
sed -i '' 's/</</g' assets/software_licenses.md
|
||||||
sed -i '' 's/>/>/g' assets/licenses.md
|
sed -i '' 's/>/>/g' assets/software_licenses.md
|
||||||
|
|
||||||
|
# Now make theme licenses
|
||||||
|
echo "Generating theme licenses"
|
||||||
|
cd styles
|
||||||
|
npm run build-licenses
|
|
@ -1,3 +1,5 @@
|
||||||
|
# NOTE: This file's location is hardcoded into the theme build system in
|
||||||
|
# styles/src/buildLicenses.ts
|
||||||
no-clearly-defined = true
|
no-clearly-defined = true
|
||||||
private = { ignore = true }
|
private = { ignore = true }
|
||||||
accepted = [
|
accepted = [
|
||||||
|
|
11
styles/package-lock.json
generated
11
styles/package-lock.json
generated
|
@ -13,6 +13,7 @@
|
||||||
"@types/node": "^17.0.23",
|
"@types/node": "^17.0.23",
|
||||||
"case-anything": "^2.1.10",
|
"case-anything": "^2.1.10",
|
||||||
"chroma-js": "^2.4.2",
|
"chroma-js": "^2.4.2",
|
||||||
|
"toml": "^3.0.0",
|
||||||
"ts-node": "^10.7.0"
|
"ts-node": "^10.7.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -123,6 +124,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw=="
|
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/toml": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w=="
|
||||||
|
},
|
||||||
"node_modules/ts-node": {
|
"node_modules/ts-node": {
|
||||||
"version": "10.7.0",
|
"version": "10.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz",
|
||||||
|
@ -276,6 +282,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw=="
|
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw=="
|
||||||
},
|
},
|
||||||
|
"toml": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w=="
|
||||||
|
},
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
"version": "10.7.0",
|
"version": "10.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz",
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ts-node ./src/buildThemes.ts"
|
"build": "ts-node ./src/buildThemes.ts",
|
||||||
|
"build-licenses": "ts-node ./src/buildLicenses.ts"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
@ -13,6 +14,7 @@
|
||||||
"@types/node": "^17.0.23",
|
"@types/node": "^17.0.23",
|
||||||
"case-anything": "^2.1.10",
|
"case-anything": "^2.1.10",
|
||||||
"chroma-js": "^2.4.2",
|
"chroma-js": "^2.4.2",
|
||||||
|
"toml": "^3.0.0",
|
||||||
"ts-node": "^10.7.0"
|
"ts-node": "^10.7.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
75
styles/src/buildLicenses.ts
Normal file
75
styles/src/buildLicenses.ts
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
import * as fs from "fs";
|
||||||
|
import toml from "toml";
|
||||||
|
import {
|
||||||
|
schemeMeta
|
||||||
|
} from "./colorSchemes";
|
||||||
|
import { Meta } from "./themes/common/colorScheme";
|
||||||
|
import https from "https";
|
||||||
|
import crypto from "crypto";
|
||||||
|
const license_file = `${__dirname}/../../assets/theme_licenses.md`
|
||||||
|
const accepted_licenses_file = `${__dirname}/../../script/licenses/zed-licenses.toml`
|
||||||
|
|
||||||
|
// Use the cargo-about configuration file as the source of truth for supported licenses.
|
||||||
|
function parseAcceptedToml(file: string): string[] {
|
||||||
|
let buffer = fs.readFileSync(file).toString();
|
||||||
|
|
||||||
|
let obj = toml.parse(buffer);
|
||||||
|
|
||||||
|
if (!Array.isArray(obj.accepted)) {
|
||||||
|
throw Error("Accepted license source is malformed")
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj.accepted
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function checkLicenses(schemeMeta: Meta[], licenses: string[]) {
|
||||||
|
for (let meta of schemeMeta) {
|
||||||
|
// FIXME: Add support for conjuctions and conditions
|
||||||
|
if (licenses.indexOf(meta.license.SPDX) < 0) {
|
||||||
|
throw Error(`License for theme ${meta.name} (${meta.license.SPDX}) is not supported`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getLicenseText(schemeMeta: Meta[], callback: (meta: Meta, license_text: string) => void) {
|
||||||
|
for (let meta of schemeMeta) {
|
||||||
|
// The following copied from the example code on nodejs.org:
|
||||||
|
// https://nodejs.org/api/http.html#httpgetoptions-callback
|
||||||
|
https.get(meta.license.https_url, (res) => {
|
||||||
|
const { statusCode } = res;
|
||||||
|
|
||||||
|
if (statusCode < 200 || statusCode >= 300) {
|
||||||
|
throw new Error('Failed to fetch license file.\n' +
|
||||||
|
`Status Code: ${statusCode}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
res.setEncoding('utf8');
|
||||||
|
let rawData = '';
|
||||||
|
res.on('data', (chunk) => { rawData += chunk; });
|
||||||
|
res.on('end', () => {
|
||||||
|
const hash = crypto.createHash('sha256').update(rawData).digest('hex');
|
||||||
|
if (meta.license.license_checksum == hash) {
|
||||||
|
callback(meta, rawData)
|
||||||
|
} else {
|
||||||
|
throw Error(`Checksum for ${meta.name} did not match file downloaded from ${meta.license.https_url}`)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).on('error', (e) => {
|
||||||
|
throw e
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeLicense(schemeMeta: Meta, text: String, stream: fs.WriteStream) {
|
||||||
|
stream.write(`# [${schemeMeta.name}](${schemeMeta.url})\n\n${text}\n******************************************************************************** \n`)
|
||||||
|
}
|
||||||
|
|
||||||
|
const accepted_licenses = parseAcceptedToml(accepted_licenses_file);
|
||||||
|
checkLicenses(schemeMeta, accepted_licenses)
|
||||||
|
|
||||||
|
const stream = fs.createWriteStream(license_file);
|
||||||
|
getLicenseText(schemeMeta, (meta, text) => {
|
||||||
|
writeLicense(meta, text, stream)
|
||||||
|
});
|
|
@ -1,15 +1,15 @@
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import * as path from "path";
|
|
||||||
import { tmpdir } from "os";
|
import { tmpdir } from "os";
|
||||||
import app from "./styleTree/app";
|
import * as path from "path";
|
||||||
import colorSchemes, {
|
import colorSchemes, {
|
||||||
internalColorSchemes,
|
experimentalColorSchemes, internalColorSchemes
|
||||||
experimentalColorSchemes,
|
|
||||||
} from "./colorSchemes";
|
} from "./colorSchemes";
|
||||||
import snakeCase from "./utils/snakeCase";
|
import app from "./styleTree/app";
|
||||||
import { ColorScheme } from "./themes/common/colorScheme";
|
import { ColorScheme } from "./themes/common/colorScheme";
|
||||||
|
import snakeCase from "./utils/snakeCase";
|
||||||
|
|
||||||
const themeDirectory = `${__dirname}/../../assets/themes`;
|
const assetsDirectory = `${__dirname}/../../assets`
|
||||||
|
const themeDirectory = `${assetsDirectory}/themes`;
|
||||||
const internalDirectory = `${themeDirectory}/Internal`;
|
const internalDirectory = `${themeDirectory}/Internal`;
|
||||||
const experimentsDirectory = `${themeDirectory}/Experiments`;
|
const experimentsDirectory = `${themeDirectory}/Experiments`;
|
||||||
|
|
||||||
|
|
|
@ -1,35 +1,58 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { ColorScheme } from "./themes/common/colorScheme";
|
import { ColorScheme, Meta } from "./themes/common/colorScheme";
|
||||||
|
|
||||||
const colorSchemes: ColorScheme[] = [];
|
const colorSchemes: ColorScheme[] = [];
|
||||||
export default colorSchemes;
|
export default colorSchemes;
|
||||||
|
|
||||||
|
const schemeMeta: Meta[] = [];
|
||||||
|
export { schemeMeta };
|
||||||
|
|
||||||
const internalColorSchemes: ColorScheme[] = [];
|
const internalColorSchemes: ColorScheme[] = [];
|
||||||
export { internalColorSchemes };
|
export { internalColorSchemes };
|
||||||
|
|
||||||
const experimentalColorSchemes: ColorScheme[] = [];
|
const experimentalColorSchemes: ColorScheme[] = [];
|
||||||
export { experimentalColorSchemes };
|
export { experimentalColorSchemes };
|
||||||
|
|
||||||
function fillColorSchemes(themesPath: string, colorSchemes: ColorScheme[]) {
|
const themes_directory = path.resolve(`${__dirname}/themes`);
|
||||||
|
|
||||||
|
function for_all_color_schemes_in(themesPath: string, callback: (module: any, path: string) => void) {
|
||||||
for (const fileName of fs.readdirSync(themesPath)) {
|
for (const fileName of fs.readdirSync(themesPath)) {
|
||||||
if (fileName == "template.ts") continue;
|
if (fileName == "template.ts") continue;
|
||||||
const filePath = path.join(themesPath, fileName);
|
const filePath = path.join(themesPath, fileName);
|
||||||
|
|
||||||
if (fs.statSync(filePath).isFile()) {
|
if (fs.statSync(filePath).isFile()) {
|
||||||
const colorScheme = require(filePath);
|
const colorScheme = require(filePath);
|
||||||
if (colorScheme.dark) colorSchemes.push(colorScheme.dark);
|
callback(colorScheme, path.basename(filePath));
|
||||||
if (colorScheme.light) colorSchemes.push(colorScheme.light);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fillColorSchemes(path.resolve(`${__dirname}/themes`), colorSchemes);
|
function fillColorSchemes(themesPath: string, colorSchemes: ColorScheme[]) {
|
||||||
|
for_all_color_schemes_in(themesPath, (colorScheme, _path) => {
|
||||||
|
if (colorScheme.dark) colorSchemes.push(colorScheme.dark);
|
||||||
|
if (colorScheme.light) colorSchemes.push(colorScheme.light);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fillColorSchemes(themes_directory, colorSchemes);
|
||||||
fillColorSchemes(
|
fillColorSchemes(
|
||||||
path.resolve(`${__dirname}/themes/internal`),
|
path.resolve(`${themes_directory}/internal`),
|
||||||
internalColorSchemes
|
internalColorSchemes
|
||||||
);
|
);
|
||||||
fillColorSchemes(
|
fillColorSchemes(
|
||||||
path.resolve(`${__dirname}/themes/experiments`),
|
path.resolve(`${themes_directory}/experiments`),
|
||||||
experimentalColorSchemes
|
experimentalColorSchemes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function fillMeta(themesPath: string, meta: Meta[]) {
|
||||||
|
for_all_color_schemes_in(themesPath, (colorScheme, path) => {
|
||||||
|
if (colorScheme.meta) {
|
||||||
|
meta.push(colorScheme.meta)
|
||||||
|
} else {
|
||||||
|
throw Error(`Public theme ${path} must have a meta field`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fillMeta(themes_directory, schemeMeta);
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "Andromeda";
|
const name = "Andromeda";
|
||||||
const author = "EliverLara";
|
|
||||||
const url = "https://github.com/EliverLara/Andromeda";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/EliverLara/Andromeda/blob/master/LICENSE.md",
|
|
||||||
};
|
|
||||||
|
|
||||||
const ramps = {
|
const ramps = {
|
||||||
neutral: chroma
|
neutral: chroma
|
||||||
|
@ -33,3 +28,14 @@ const ramps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const dark = createColorScheme(`${name}`, false, ramps);
|
export const dark = createColorScheme(`${name}`, false, ramps);
|
||||||
|
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "EliverLara",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/EliverLara/Andromeda/master/LICENSE.md",
|
||||||
|
license_checksum: "2f7886f1a05cefc2c26f5e49de1a39fa4466413c1ccb06fc80960e73f5ed4b89"
|
||||||
|
},
|
||||||
|
url: "https://github.com/EliverLara/Andromeda"
|
||||||
|
}
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "Atelier Cave";
|
const name = "Atelier Cave";
|
||||||
const author = "atelierbram";
|
|
||||||
const url = "https://atelierbram.github.io/syntax-highlighting/atelier-schemes/cave/";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/atelierbram/syntax-highlighting/blob/master/LICENSE",
|
|
||||||
};
|
|
||||||
|
|
||||||
export const dark = createColorScheme(`${name} Dark`, false, {
|
export const dark = createColorScheme(`${name} Dark`, false, {
|
||||||
neutral: chroma
|
neutral: chroma
|
||||||
|
@ -54,3 +49,15 @@ export const light = createColorScheme(`${name} Light`, true, {
|
||||||
violet: colorRamp(chroma("#955ae7")),
|
violet: colorRamp(chroma("#955ae7")),
|
||||||
magenta: colorRamp(chroma("#bf40bf")),
|
magenta: colorRamp(chroma("#bf40bf")),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "atelierbram",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/atelierbram/syntax-highlighting/master/LICENSE",
|
||||||
|
license_checksum: "6c2353bb9dd0b7b211364d98184ab482e54f40f611eda0c02974c3a1f9e6193c"
|
||||||
|
},
|
||||||
|
url: "https://atelierbram.github.io/syntax-highlighting/atelier-schemes/cave/"
|
||||||
|
}
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "Atelier Sulphurpool";
|
const name = "Atelier Sulphurpool";
|
||||||
const author = "atelierbram";
|
|
||||||
const url = "https://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune/";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/atelierbram/syntax-highlighting/blob/master/LICENSE",
|
|
||||||
};
|
|
||||||
|
|
||||||
const ramps = {
|
const ramps = {
|
||||||
neutral: chroma
|
neutral: chroma
|
||||||
|
@ -34,3 +29,14 @@ const ramps = {
|
||||||
|
|
||||||
export const dark = createColorScheme(`${name} Dark`, false, ramps);
|
export const dark = createColorScheme(`${name} Dark`, false, ramps);
|
||||||
export const light = createColorScheme(`${name} Light`, true, ramps);
|
export const light = createColorScheme(`${name} Light`, true, ramps);
|
||||||
|
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "atelierbram",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/atelierbram/syntax-highlighting/master/LICENSE",
|
||||||
|
license_checksum: "6c2353bb9dd0b7b211364d98184ab482e54f40f611eda0c02974c3a1f9e6193c"
|
||||||
|
},
|
||||||
|
url: "https://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune/"
|
||||||
|
}
|
|
@ -16,6 +16,28 @@ export interface ColorScheme {
|
||||||
players: Players;
|
players: Players;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Meta {
|
||||||
|
name: string,
|
||||||
|
author: string,
|
||||||
|
url: string,
|
||||||
|
license: License
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface License {
|
||||||
|
SPDX: SPDXExpression,
|
||||||
|
/// A url where we can download the license's text
|
||||||
|
https_url: string,
|
||||||
|
license_checksum: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// License name -> License text
|
||||||
|
export interface Licenses {
|
||||||
|
[key: string]: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME: Add support for the SPDX expression syntax
|
||||||
|
export type SPDXExpression = "MIT";
|
||||||
|
|
||||||
export interface Player {
|
export interface Player {
|
||||||
cursor: string;
|
cursor: string;
|
||||||
selection: string;
|
selection: string;
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "One Dark";
|
const name = "One Dark";
|
||||||
const author = "simurai";
|
|
||||||
const url = "https://github.com/atom/atom/tree/master/packages/one-dark-ui";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/atom/atom/blob/master/packages/one-dark-ui/LICENSE.md",
|
|
||||||
};
|
|
||||||
|
|
||||||
export const dark = createColorScheme(`${name}`, false, {
|
export const dark = createColorScheme(`${name}`, false, {
|
||||||
neutral: chroma
|
neutral: chroma
|
||||||
|
@ -32,3 +27,14 @@ export const dark = createColorScheme(`${name}`, false, {
|
||||||
violet: colorRamp(chroma("#c678dd")),
|
violet: colorRamp(chroma("#c678dd")),
|
||||||
magenta: colorRamp(chroma("#be5046")),
|
magenta: colorRamp(chroma("#be5046")),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "simurai",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/atom/atom/master/packages/one-light-ui/LICENSE.md",
|
||||||
|
license_checksum: "d5af8fc171f6f600c0ab4e7597dca398dda80dbe6821ce01cef78e859e7a00f8"
|
||||||
|
},
|
||||||
|
url: "https://github.com/atom/atom/tree/master/packages/one-dark-ui"
|
||||||
|
}
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "One Light";
|
const name = "One Light";
|
||||||
const author = "simurai";
|
|
||||||
const url = "https://github.com/atom/atom/tree/master/packages/one-light-ui";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/atom/atom/blob/master/packages/one-light-ui/LICENSE.md",
|
|
||||||
};
|
|
||||||
|
|
||||||
export const light = createColorScheme(`${name}`, true, {
|
export const light = createColorScheme(`${name}`, true, {
|
||||||
neutral: chroma.scale([
|
neutral: chroma.scale([
|
||||||
|
@ -31,3 +26,14 @@ export const light = createColorScheme(`${name}`, true, {
|
||||||
violet: colorRamp(chroma("#a626a4")),
|
violet: colorRamp(chroma("#a626a4")),
|
||||||
magenta: colorRamp(chroma("#986801")),
|
magenta: colorRamp(chroma("#986801")),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "simurai",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/atom/atom/master/packages/one-light-ui/LICENSE.md",
|
||||||
|
license_checksum: "d5af8fc171f6f600c0ab4e7597dca398dda80dbe6821ce01cef78e859e7a00f8"
|
||||||
|
},
|
||||||
|
url: "https://github.com/atom/atom/tree/master/packages/one-light-ui"
|
||||||
|
}
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "Rosé Pine Dawn";
|
const name = "Rosé Pine Dawn";
|
||||||
const author = "edunfelt";
|
|
||||||
const url = "https://github.com/edunfelt/base16-rose-pine-scheme";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/edunfelt/base16-rose-pine-scheme/blob/main/rose-pine-dawn.yaml",
|
|
||||||
};
|
|
||||||
|
|
||||||
const ramps = {
|
const ramps = {
|
||||||
neutral: chroma
|
neutral: chroma
|
||||||
|
@ -33,3 +28,14 @@ const ramps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const light = createColorScheme(`${name}`, true, ramps);
|
export const light = createColorScheme(`${name}`, true, ramps);
|
||||||
|
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "edunfelt",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/edunfelt/base16-rose-pine-scheme/main/LICENSE",
|
||||||
|
license_checksum: "6ca1b9da8c78c8441c5aa43d024a4e4a7bf59d1ecca1480196e94fda0f91ee4a"
|
||||||
|
},
|
||||||
|
url: "https://github.com/edunfelt/base16-rose-pine-scheme"
|
||||||
|
}
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "Rosé Pine Moon";
|
const name = "Rosé Pine Moon";
|
||||||
const author = "edunfelt";
|
|
||||||
const url = "https://github.com/edunfelt/base16-rose-pine-scheme";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/edunfelt/base16-rose-pine-scheme/blob/main/rose-pine-moon.yaml",
|
|
||||||
};
|
|
||||||
|
|
||||||
const ramps = {
|
const ramps = {
|
||||||
neutral: chroma
|
neutral: chroma
|
||||||
|
@ -33,3 +28,14 @@ const ramps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const dark = createColorScheme(`${name}`, false, ramps);
|
export const dark = createColorScheme(`${name}`, false, ramps);
|
||||||
|
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "edunfelt",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/edunfelt/base16-rose-pine-scheme/main/LICENSE",
|
||||||
|
license_checksum: "6ca1b9da8c78c8441c5aa43d024a4e4a7bf59d1ecca1480196e94fda0f91ee4a"
|
||||||
|
},
|
||||||
|
url: "https://github.com/edunfelt/base16-rose-pine-scheme"
|
||||||
|
}
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "Rosé Pine";
|
const name = "Rosé Pine";
|
||||||
const author = "edunfelt";
|
|
||||||
const url = "https://github.com/edunfelt/base16-rose-pine-scheme";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/edunfelt/base16-rose-pine-scheme",
|
|
||||||
};
|
|
||||||
|
|
||||||
const ramps = {
|
const ramps = {
|
||||||
neutral: chroma.scale([
|
neutral: chroma.scale([
|
||||||
|
@ -31,3 +26,14 @@ const ramps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const dark = createColorScheme(`${name}`, false, ramps);
|
export const dark = createColorScheme(`${name}`, false, ramps);
|
||||||
|
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "edunfelt",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/edunfelt/base16-rose-pine-scheme/main/LICENSE",
|
||||||
|
license_checksum: "6ca1b9da8c78c8441c5aa43d024a4e4a7bf59d1ecca1480196e94fda0f91ee4a"
|
||||||
|
},
|
||||||
|
url: "https://github.com/edunfelt/base16-rose-pine-scheme"
|
||||||
|
}
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "Sandcastle";
|
const name = "Sandcastle";
|
||||||
const author = "gessig";
|
|
||||||
const url = "https://github.com/gessig/base16-sandcastle-scheme";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/gessig/base16-sandcastle-scheme/blob/master/LICENSE",
|
|
||||||
};
|
|
||||||
|
|
||||||
const ramps = {
|
const ramps = {
|
||||||
neutral: chroma.scale([
|
neutral: chroma.scale([
|
||||||
|
@ -31,3 +26,15 @@ const ramps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const dark = createColorScheme(`${name}`, false, ramps);
|
export const dark = createColorScheme(`${name}`, false, ramps);
|
||||||
|
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "gessig",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/gessig/base16-sandcastle-scheme/master/LICENSE",
|
||||||
|
license_checksum: "8399d44b4d935b60be9fee0a76d7cc9a817b4f3f11574c9d6d1e8fd57e72ffdc"
|
||||||
|
},
|
||||||
|
url: "https://github.com/gessig/base16-sandcastle-scheme"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta as Metadata } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "Solarized";
|
const name = "Solarized";
|
||||||
const author = "Ethan Schoonover";
|
|
||||||
const url = "https://github.com/altercation/solarized";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/altercation/solarized/blob/master/README.md",
|
|
||||||
};
|
|
||||||
|
|
||||||
const ramps = {
|
const ramps = {
|
||||||
neutral: chroma
|
neutral: chroma
|
||||||
|
@ -34,3 +29,15 @@ const ramps = {
|
||||||
|
|
||||||
export const dark = createColorScheme(`${name} Dark`, false, ramps);
|
export const dark = createColorScheme(`${name} Dark`, false, ramps);
|
||||||
export const light = createColorScheme(`${name} Light`, true, ramps);
|
export const light = createColorScheme(`${name} Light`, true, ramps);
|
||||||
|
|
||||||
|
export const meta: Metadata = {
|
||||||
|
name,
|
||||||
|
author: "Ethan Schoonover",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/altercation/solarized/master/LICENSE",
|
||||||
|
license_checksum: "494aefdabf86acce06bd63001ad8aedad4ee38da23509d3f917d95aa3368b9a6"
|
||||||
|
},
|
||||||
|
url: "https://github.com/altercation/solarized"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
import chroma from "chroma-js";
|
import chroma from "chroma-js";
|
||||||
|
import { Meta } from "./common/colorScheme";
|
||||||
import { colorRamp, createColorScheme } from "./common/ramps";
|
import { colorRamp, createColorScheme } from "./common/ramps";
|
||||||
|
|
||||||
const name = "Summercamp";
|
const name = "Summercamp";
|
||||||
const author = "zoefiri";
|
|
||||||
const url = "https://github.com/zoefiri/base16-sc";
|
|
||||||
const license = {
|
|
||||||
type: "MIT",
|
|
||||||
url: "https://github.com/zoefiri/base16-sc/blob/master/summercamp.yaml",
|
|
||||||
};
|
|
||||||
|
|
||||||
const ramps = {
|
const ramps = {
|
||||||
neutral: chroma
|
neutral: chroma
|
||||||
|
@ -33,3 +28,13 @@ const ramps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const dark = createColorScheme(`${name}`, false, ramps);
|
export const dark = createColorScheme(`${name}`, false, ramps);
|
||||||
|
export const meta: Meta = {
|
||||||
|
name,
|
||||||
|
author: "zoefiri",
|
||||||
|
url: "https://github.com/zoefiri/base16-sc",
|
||||||
|
license: {
|
||||||
|
SPDX: "MIT",
|
||||||
|
https_url: "https://raw.githubusercontent.com/zoefiri/base16-sc/master/LICENSE",
|
||||||
|
license_checksum: "fadcc834b7eaf2943800956600e8aeea4b495ecf6490f4c4b6c91556a90accaf"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue