diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8932b31..f9ca414 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,6 +66,10 @@ Prefer submitting manually from the browser? Open the [GitHub Web Theme Editor]( ## Validation Rules - Required fields: `name`, `type` (`"light"` or `"dark"`), `colors` (minimum: `background`, `foreground`, `primary`, `card`, `border`). -- Optional fields: `$schema`, `author`, `authorUrl` (`https://github.com/...`), `editorColors` (keys must start with `editor-`). +- Optional fields: `$schema`, `author`, `authorUrl` (`https://github.com/...`), `license` (SPDX ID, e.g. `"MIT"`), `copyright` (upstream or author notice), `editorColors` (keys must start with `editor-`). - Supported CSS color formats: `#hex`, `rgb(...)`, `rgba(...)`, `hsl(...)`, `hsla(...)`, `oklch(...)`. - Legacy `color-*` tokens (such as `color-bg`, `color-primary`) are not allowed. + +## Porting Third-Party Themes + +If your theme is a port of an existing open-source theme, you may include `license` and `copyright` fields in your theme JSON (they are preserved verbatim when installed through massCode) and add an entry to [THIRD_PARTY_LICENSES.md](./THIRD_PARTY_LICENSES.md). diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4deca51 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 massCode + +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. diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md new file mode 100644 index 0000000..01f2792 --- /dev/null +++ b/THIRD_PARTY_LICENSES.md @@ -0,0 +1,57 @@ +# Third-Party Licenses & Attribution + +Some themes in this repository are ports or adaptations of community color palettes originally published under open-source licenses. Their upstream sources, licenses, and copyright notices are listed below. + +## Ported Themes (MIT License) + +### Catppuccin Latte & Catppuccin Mocha +- **Upstream:** https://github.com/catppuccin/catppuccin +- **License:** MIT +- **Notice:** Copyright (c) 2021 Catppuccin + +### Dracula +- **Upstream:** https://github.com/dracula/dracula-theme +- **License:** MIT +- **Notice:** Copyright (c) 2013 Zeno Rocha + +### GitHub Light +- **Upstream:** https://github.com/primer/github-vscode-theme +- **License:** MIT +- **Notice:** Copyright (c) 2020 GitHub, Inc. + +### One Light & One Dark +- **Upstream:** https://github.com/atom/one-light-syntax · https://github.com/atom/one-dark-syntax +- **License:** MIT +- **Notice:** Copyright (c) 2016 GitHub Inc. + +### Rosé Pine Dawn +- **Upstream:** https://github.com/rose-pine/rose-pine-theme +- **License:** MIT +- **Notice:** Copyright (c) 2020 Rosé Pine + +### Tokyo Night +- **Upstream:** https://github.com/enkia/tokyo-night-vscode-theme +- **License:** MIT +- **Notice:** Copyright (c) 2020 Enkia + +--- + +## MIT License Text + +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. diff --git a/schema/theme.schema.json b/schema/theme.schema.json index 25a6c96..14cb8a0 100644 --- a/schema/theme.schema.json +++ b/schema/theme.schema.json @@ -27,6 +27,18 @@ "pattern": "^https://github\\.com/[A-Za-z0-9_.-]+(?:/[A-Za-z0-9_.-]+)?/?$", "description": "GitHub profile or repository URL of the author" }, + "license": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "description": "Optional SPDX license identifier (e.g. MIT)" + }, + "copyright": { + "type": "string", + "minLength": 1, + "maxLength": 200, + "description": "Optional upstream or author copyright notice" + }, "type": { "type": "string", "enum": ["light", "dark"] diff --git a/scripts/build-registry.mjs b/scripts/build-registry.mjs index c1078ad..6d6ef44 100644 --- a/scripts/build-registry.mjs +++ b/scripts/build-registry.mjs @@ -112,6 +112,14 @@ function validateTheme(fileName, rawContent) { errors.push(`${fileName}: "authorUrl" must be a valid https://github.com/... URL`) } + if (data.license !== undefined && (typeof data.license !== 'string' || !data.license.trim() || data.license.trim().length > 64)) { + errors.push(`${fileName}: "license" must be a non-empty string (max 64 chars)`) + } + + if (data.copyright !== undefined && (typeof data.copyright !== 'string' || !data.copyright.trim() || data.copyright.trim().length > 200)) { + errors.push(`${fileName}: "copyright" must be a non-empty string (max 200 chars)`) + } + if (!data.colors || typeof data.colors !== 'object' || Array.isArray(data.colors)) { errors.push(`${fileName}: "colors" must be an object`) }