diff --git a/packages/genomic/__tests__/licenses.test.ts b/packages/genomic/__tests__/licenses.test.ts index 81427758..61eca795 100644 --- a/packages/genomic/__tests__/licenses.test.ts +++ b/packages/genomic/__tests__/licenses.test.ts @@ -25,6 +25,7 @@ describe('license templates', () => { expect.arrayContaining([ 'MIT', 'APACHE-2.0', + 'CONSTRUCTIVE', 'ISC', 'GPL-3.0', 'BSD-3-CLAUSE', @@ -43,6 +44,16 @@ describe('license templates', () => { expect(content).toContain('All Rights Reserved'); }); + it('renders CONSTRUCTIVE license with fixed Interweb copyright', () => { + const content = renderLicense('CONSTRUCTIVE', context); + expect(content).toContain('Constructive License'); + expect(content).toContain('Interweb, Inc.'); + expect(content).toContain('2099'); + expect(content).toContain('Generated by Constructive'); + expect(content).toContain('https://constructive.io/legal/license/v1.0'); + expect(content).not.toContain('Test User'); + }); + it('handles case-insensitive lookups', () => { expect(isSupportedLicense('mit')).toBe(true); expect(renderLicense('mit', { author: 'User' })).toContain('User'); diff --git a/packages/genomic/licenses-templates/CONSTRUCTIVE.txt b/packages/genomic/licenses-templates/CONSTRUCTIVE.txt new file mode 100644 index 00000000..1ba651aa --- /dev/null +++ b/packages/genomic/licenses-templates/CONSTRUCTIVE.txt @@ -0,0 +1,33 @@ +Constructive License + +Copyright (c) {{YEAR}} Interweb, Inc. +Generated by Constructive (https://constructive.io) + +You own the application code generated for you. You may use, modify, deploy, +and distribute it freely, including for commercial use. + +Restrictions: + +- You may not use this code to offer a service whose primary purpose is to + provide database provisioning, schema generation, security policy + compilation, cloud functions, or AI infrastructure to third parties, + except under a separate commercial agreement with Interweb, Inc. +- You may not sell, license, or distribute the exported code, in whole or + substantial part, as a standalone product or library. +- You may not repackage the framework components generated by Constructive + (as defined in the full license) as your own developer platform or toolchain + for third-party builders. + +Generated TypeScript clients and SDKs may be distributed under their own +applicable open-source licenses, as indicated in the LICENSE files included +with those packages. + +Full license terms: https://constructive.io/legal/license/v1.0 + +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/packages/genomic/src/licenses.ts b/packages/genomic/src/licenses.ts index fd0e6161..72c2f5b4 100644 --- a/packages/genomic/src/licenses.ts +++ b/packages/genomic/src/licenses.ts @@ -15,6 +15,7 @@ let cachedTemplates: LicenseTemplateMap | null = null; export type SupportedLicense = string; export const DEFAULT_LICENSE = 'MIT'; +export const CONSTRUCTIVE_LICENSE = 'CONSTRUCTIVE'; export const CLOSED_LICENSE = 'CLOSED'; export const LICENSE_VALUE_KEYS = ['LICENSE', 'license']; export const LICENSE_AUTHOR_KEYS = [ @@ -74,6 +75,8 @@ export function listSupportedLicenses(): string[] { return licenses.sort((a, b) => { if (a === DEFAULT_LICENSE) return -1; if (b === DEFAULT_LICENSE) return 1; + if (a === CONSTRUCTIVE_LICENSE) return -1; + if (b === CONSTRUCTIVE_LICENSE) return 1; if (a === CLOSED_LICENSE) return 1; if (b === CLOSED_LICENSE) return -1; return a.localeCompare(b);