Update theme license logic (#2541)

Use new theme file structure
```
themes/
  [theme_name]
    [theme_name]-common.ts
    [theme_name]-light.ts
    [theme_name]-dark.ts
    LICENSE
```

Release Notes: 
- N/A
This commit is contained in:
Sergii Onufriienko
2023-05-31 18:36:13 +01:00
committed by GitHub
54 changed files with 369 additions and 262 deletions
+20 -58
View File
@@ -1,11 +1,9 @@
import * as fs from "fs" import * as fs from "fs"
import toml from "toml" import toml from "toml"
import { schemeMeta } from "./colorSchemes" import { schemeMeta } from "./colorSchemes"
import { Meta, Verification } from "./themes/common/colorScheme" import { MetaAndLicense } from "./themes/common/colorScheme"
import https from "https"
import crypto from "crypto"
const accepted_licenses_file = `${__dirname}/../../script/licenses/zed-licenses.toml` const ACCEPTED_LICENSES_FILE = `${__dirname}/../../script/licenses/zed-licenses.toml`
// Use the cargo-about configuration file as the source of truth for supported licenses. // Use the cargo-about configuration file as the source of truth for supported licenses.
function parseAcceptedToml(file: string): string[] { function parseAcceptedToml(file: string): string[] {
@@ -20,8 +18,11 @@ function parseAcceptedToml(file: string): string[] {
return obj.accepted return obj.accepted
} }
function checkLicenses(schemeMeta: Meta[], licenses: string[]) { function checkLicenses(
for (let meta of schemeMeta) { schemeMetaWithLicense: MetaAndLicense[],
licenses: string[]
) {
for (const { meta } of schemeMetaWithLicense) {
// FIXME: Add support for conjuctions and conditions // FIXME: Add support for conjuctions and conditions
if (licenses.indexOf(meta.license.SPDX) < 0) { if (licenses.indexOf(meta.license.SPDX) < 0) {
throw Error( throw Error(
@@ -31,62 +32,23 @@ function checkLicenses(schemeMeta: Meta[], licenses: string[]) {
} }
} }
function getLicenseText( function generateLicenseFile(schemeMetaWithLicense: MetaAndLicense[]) {
schemeMeta: Meta[], for (const { meta, licenseFile } of schemeMetaWithLicense) {
callback: (meta: Meta, license_text: string) => void const licenseText = fs.readFileSync(licenseFile).toString()
) { writeLicense(meta.name, meta.url, licenseText)
for (let meta of schemeMeta) {
if (typeof meta.license.license_text == "string") {
callback(meta, meta.license.license_text)
} else {
let license_text_obj: Verification = meta.license.license_text
// The following copied from the example code on nodejs.org:
// https://nodejs.org/api/http.html#httpgetoptions-callback
https
.get(license_text_obj.https_url, (res) => {
const { statusCode } = res
if (statusCode < 200 || statusCode >= 300) {
throw new Error(
`Failed to fetch license for: ${meta.name}, 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 (license_text_obj.license_checksum == hash) {
callback(meta, rawData)
} else {
throw Error(
`Checksum for ${meta.name} did not match file downloaded from ${license_text_obj.https_url}`
)
}
})
})
.on("error", (e) => {
throw e
})
}
} }
} }
function writeLicense(schemeMeta: Meta, text: String) { function writeLicense(
themeName: string,
themeUrl: string,
licenseText: String
) {
process.stdout.write( process.stdout.write(
`## [${schemeMeta.name}](${schemeMeta.url})\n\n${text}\n********************************************************************************\n\n` `## [${themeName}](${themeUrl})\n\n${licenseText}\n********************************************************************************\n\n`
) )
} }
const accepted_licenses = parseAcceptedToml(accepted_licenses_file) const acceptedLicenses = parseAcceptedToml(ACCEPTED_LICENSES_FILE)
checkLicenses(schemeMeta, accepted_licenses) checkLicenses(schemeMeta, acceptedLicenses)
generateLicenseFile(schemeMeta)
getLicenseText(schemeMeta, (meta, text) => {
writeLicense(meta, text)
})
+1 -1
View File
@@ -1,7 +1,7 @@
import * as fs from "fs" import * as fs from "fs"
import { tmpdir } from "os" import { tmpdir } from "os"
import * as path from "path" import * as path from "path"
import colorSchemes, { staffColorSchemes } from "./colorSchemes" import { colorSchemes, staffColorSchemes } from "./colorSchemes"
import app from "./styleTree/app" import app from "./styleTree/app"
import { ColorScheme } from "./themes/common/colorScheme" import { ColorScheme } from "./themes/common/colorScheme"
import snakeCase from "./utils/snakeCase" import snakeCase from "./utils/snakeCase"
+62 -37
View File
@@ -1,54 +1,79 @@
import fs from "fs" import fs from "fs"
import path from "path" import path from "path"
import { ColorScheme, Meta } from "./themes/common/colorScheme" import { ColorScheme, MetaAndLicense } from "./themes/common/colorScheme"
const colorSchemes: ColorScheme[] = [] const THEMES_DIRECTORY = path.resolve(`${__dirname}/themes`)
export default colorSchemes const STAFF_DIRECTORY = path.resolve(`${__dirname}/themes/staff`)
const IGNORE_ITEMS = ["staff", "common", "common.ts"]
const ACCEPT_EXTENSION = ".ts"
const LICENSE_FILE_NAME = "LICENSE"
const schemeMeta: Meta[] = [] function getAllTsFiles(directoryPath: string) {
export { schemeMeta } const files = fs.readdirSync(directoryPath)
const fileList: string[] = []
const staffColorSchemes: ColorScheme[] = [] for (const file of files) {
export { staffColorSchemes } if (!IGNORE_ITEMS.includes(file)) {
const filePath = path.join(directoryPath, file)
const experimentalColorSchemes: ColorScheme[] = [] if (fs.statSync(filePath).isDirectory()) {
export { experimentalColorSchemes } fileList.push(...getAllTsFiles(filePath))
} else if (path.extname(file) === ACCEPT_EXTENSION) {
const themes_directory = path.resolve(`${__dirname}/themes`) fileList.push(filePath)
}
function for_all_color_schemes_in(
themesPath: string,
callback: (module: any, path: string) => void
) {
for (const fileName of fs.readdirSync(themesPath)) {
if (fileName == "template.ts") continue
const filePath = path.join(themesPath, fileName)
if (fs.statSync(filePath).isFile()) {
const colorScheme = require(filePath)
callback(colorScheme, path.basename(filePath))
} }
} }
return fileList
} }
function fillColorSchemes(themesPath: string, colorSchemes: ColorScheme[]) { function getAllColorSchemes(directoryPath: string) {
for_all_color_schemes_in(themesPath, (colorScheme, _path) => { const files = getAllTsFiles(directoryPath)
return files.map((filePath) => ({
colorScheme: require(filePath),
filePath,
fileName: path.basename(filePath),
licenseFile: `${path.dirname(filePath)}/${LICENSE_FILE_NAME}`,
}))
}
function getColorSchemes(directoryPath: string) {
const colorSchemes: ColorScheme[] = []
for (const { colorScheme } of getAllColorSchemes(directoryPath)) {
if (colorScheme.dark) colorSchemes.push(colorScheme.dark) if (colorScheme.dark) colorSchemes.push(colorScheme.dark)
if (colorScheme.light) colorSchemes.push(colorScheme.light) else if (colorScheme.light) colorSchemes.push(colorScheme.light)
}) }
return colorSchemes
} }
fillColorSchemes(themes_directory, colorSchemes) function getMetaAndLicense(directoryPath: string) {
fillColorSchemes(path.resolve(`${themes_directory}/staff`), staffColorSchemes) const meta: MetaAndLicense[] = []
function fillMeta(themesPath: string, meta: Meta[]) { for (const { colorScheme, filePath, licenseFile } of getAllColorSchemes(
for_all_color_schemes_in(themesPath, (colorScheme, path) => { directoryPath
if (colorScheme.meta) { )) {
meta.push(colorScheme.meta) const licenseExists = fs.existsSync(licenseFile)
} else { if (!licenseExists) {
throw Error(`Public theme ${path} must have a meta field`) throw Error(
`Public theme should have a LICENSE file ${licenseFile}`
)
} }
})
if (!colorScheme.meta) {
throw Error(`Public theme ${filePath} must have a meta field`)
}
meta.push({
meta: colorScheme.meta,
licenseFile,
})
}
return meta
} }
fillMeta(themes_directory, schemeMeta) export const colorSchemes = getColorSchemes(THEMES_DIRECTORY)
export const staffColorSchemes = getColorSchemes(STAFF_DIRECTORY)
export const schemeMeta = getMetaAndLicense(THEMES_DIRECTORY)
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2017 <eliverlara@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,6 +1,6 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
const name = "Andromeda" const name = "Andromeda"
@@ -34,12 +34,6 @@ export const meta: Meta = {
author: "EliverLara", author: "EliverLara",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
https_url:
"https://raw.githubusercontent.com/EliverLara/Andromeda/master/LICENSE.md",
license_checksum:
"2f7886f1a05cefc2c26f5e49de1a39fa4466413c1ccb06fc80960e73f5ed4b89",
},
}, },
url: "https://github.com/EliverLara/Andromeda", url: "https://github.com/EliverLara/Andromeda",
} }
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2023 Bram de Haan, http://atelierbramdehaan.nl
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common" import { metaCommon, name, buildSyntax, Variant } from "./common"
const variant: Variant = { const variant: Variant = {
meta: { meta: {
@@ -1,4 +1,4 @@
import { License, Meta, ThemeSyntax } from "./colorScheme" import { License, Meta, ThemeSyntax } from "../common/colorScheme"
export interface Variant { export interface Variant {
meta: Meta meta: Meta
@@ -29,11 +29,6 @@ export const metaCommon: {
author: "Bram de Haan (http://atelierbramdehaan.nl)", author: "Bram de Haan (http://atelierbramdehaan.nl)",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
https_url: "https://atelierbram.mit-license.org/license.txt",
license_checksum:
"f95ce526ef4e7eecf7a832bba0e3451cc1000f9ce63eb01ed6f64f8109f5d0a5",
},
}, },
} }
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Ike Ku
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,5 +1,5 @@
import { createColorScheme } from "./common/ramps" import { createColorScheme } from "../common/ramps"
import { ayu, meta as themeMeta, buildTheme } from "./common/ayu-common" import { ayu, meta as themeMeta, buildTheme } from "./common"
export const meta = { export const meta = {
...themeMeta, ...themeMeta,
@@ -1,5 +1,5 @@
import { createColorScheme } from "./common/ramps" import { createColorScheme } from "../common/ramps"
import { ayu, meta as themeMeta, buildTheme } from "./common/ayu-common" import { ayu, meta as themeMeta, buildTheme } from "./common"
export const meta = { export const meta = {
...themeMeta, ...themeMeta,
@@ -1,5 +1,5 @@
import { createColorScheme } from "./common/ramps" import { createColorScheme } from "../common/ramps"
import { ayu, meta as themeMeta, buildTheme } from "./common/ayu-common" import { ayu, meta as themeMeta, buildTheme } from "./common"
export const meta = { export const meta = {
...themeMeta, ...themeMeta,
@@ -1,8 +1,8 @@
import { dark, light, mirage } from "ayu" import { dark, light, mirage } from "ayu"
import { ThemeSyntax } from "./syntax" import { ThemeSyntax } from "../common/syntax"
import chroma from "chroma-js" import chroma from "chroma-js"
import { colorRamp } from "./ramps" import { colorRamp } from "../common/ramps"
import { Meta } from "./colorScheme" import { Meta } from "../common/colorScheme"
export const ayu = { export const ayu = {
dark, dark,
@@ -79,12 +79,6 @@ export const meta: Meta = {
author: "dempfi", author: "dempfi",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
https_url:
"https://raw.githubusercontent.com/dempfi/ayu/master/LICENSE",
license_checksum:
"e0af0e0d1754c18ca075649d42f5c6d9a60f8bdc03c20dfd97105f2253a94173",
},
}, },
url: "https://github.com/dempfi/ayu", url: "https://github.com/dempfi/ayu",
} }
+5 -7
View File
@@ -19,6 +19,11 @@ export interface ColorScheme {
syntax?: Partial<ThemeSyntax> syntax?: Partial<ThemeSyntax>
} }
export interface MetaAndLicense {
meta: Meta
licenseFile: string
}
export interface Meta { export interface Meta {
name: string name: string
author: string author: string
@@ -28,13 +33,6 @@ export interface Meta {
export interface License { export interface License {
SPDX: SPDXExpression SPDX: SPDXExpression
/// A url where we can download the license's text
license_text: Verification | string
}
export interface Verification {
https_url: string
license_checksum: string
} }
// License name -> License text // License name -> License text
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) <YEAR> <COPYRIGHT HOLDER>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,6 +1,6 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta, ThemeSyntax } from "./common/colorScheme" import { Meta, ThemeSyntax } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
const name = "Gruvbox" const name = "Gruvbox"
@@ -248,8 +248,6 @@ export const meta: Meta = {
name, name,
license: { license: {
SPDX: "MIT", // "MIT/X11" SPDX: "MIT", // "MIT/X11"
license_text:
"Copyright <YEAR> <COPYRIGHT HOLDER>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/ or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
}, },
author: "morhetz <morhetz@gmail.com>", author: "morhetz <morhetz@gmail.com>",
url: "https://github.com/morhetz/gruvbox", url: "https://github.com/morhetz/gruvbox",
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { fontWeights } from "../common" import { fontWeights } from "../../common"
import { Meta, ThemeSyntax } from "./common/colorScheme" import { Meta, ThemeSyntax } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
const name = "One Dark" const name = "One Dark"
@@ -74,12 +74,6 @@ export const meta: Meta = {
author: "simurai", author: "simurai",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
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", url: "https://github.com/atom/atom/tree/master/packages/one-dark-ui",
} }
@@ -1,7 +1,7 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { fontWeights } from "../common" import { fontWeights } from "../../common"
import { Meta, ThemeSyntax } from "./common/colorScheme" import { Meta, ThemeSyntax } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
const name = "One Light" const name = "One Light"
@@ -73,12 +73,6 @@ export const meta: Meta = {
author: "simurai", author: "simurai",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
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", url: "https://github.com/atom/atom/tree/master/packages/one-light-ui",
} }
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2021 Emilia Dunfelt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,6 +1,6 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" 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"
@@ -34,12 +34,6 @@ export const meta: Meta = {
author: "edunfelt", author: "edunfelt",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
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", url: "https://github.com/edunfelt/base16-rose-pine-scheme",
} }
@@ -1,6 +1,6 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" 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"
@@ -34,12 +34,6 @@ export const meta: Meta = {
author: "edunfelt", author: "edunfelt",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
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", url: "https://github.com/edunfelt/base16-rose-pine-scheme",
} }
@@ -1,6 +1,6 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" 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"
@@ -32,12 +32,6 @@ export const meta: Meta = {
author: "edunfelt", author: "edunfelt",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
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", url: "https://github.com/edunfelt/base16-rose-pine-scheme",
} }
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2019 George Essig
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,6 +1,6 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
const name = "Sandcastle" const name = "Sandcastle"
@@ -32,12 +32,6 @@ export const meta: Meta = {
author: "gessig", author: "gessig",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
https_url:
"https://raw.githubusercontent.com/gessig/base16-sandcastle-scheme/master/LICENSE",
license_checksum:
"8399d44b4d935b60be9fee0a76d7cc9a817b4f3f11574c9d6d1e8fd57e72ffdc",
},
}, },
url: "https://github.com/gessig/base16-sandcastle-scheme", url: "https://github.com/gessig/base16-sandcastle-scheme",
} }
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2011 Ethan Schoonover
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,6 +1,6 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta as Metadata } from "./common/colorScheme" 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"
@@ -35,12 +35,6 @@ export const meta: Metadata = {
author: "Ethan Schoonover", author: "Ethan Schoonover",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
https_url:
"https://raw.githubusercontent.com/altercation/solarized/master/LICENSE",
license_checksum:
"494aefdabf86acce06bd63001ad8aedad4ee38da23509d3f917d95aa3368b9a6",
},
}, },
url: "https://github.com/altercation/solarized", url: "https://github.com/altercation/solarized",
} }
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2019 Zoe FiriH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,6 +1,6 @@
import chroma from "chroma-js" import chroma from "chroma-js"
import { Meta } from "./common/colorScheme" import { Meta } from "../common/colorScheme"
import { colorRamp, createColorScheme } from "./common/ramps" import { colorRamp, createColorScheme } from "../common/ramps"
const name = "Summercamp" const name = "Summercamp"
@@ -34,11 +34,5 @@ export const meta: Meta = {
url: "https://github.com/zoefiri/base16-sc", url: "https://github.com/zoefiri/base16-sc",
license: { license: {
SPDX: "MIT", SPDX: "MIT",
license_text: {
https_url:
"https://raw.githubusercontent.com/zoefiri/base16-sc/master/LICENSE",
license_checksum:
"fadcc834b7eaf2943800956600e8aeea4b495ecf6490f4c4b6c91556a90accaf",
},
}, },
} }