Skip to content
Merged
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
11 changes: 11 additions & 0 deletions packages/genomic/__tests__/licenses.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('license templates', () => {
expect.arrayContaining([
'MIT',
'APACHE-2.0',
'CONSTRUCTIVE',
'ISC',
'GPL-3.0',
'BSD-3-CLAUSE',
Expand All @@ -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');
Expand Down
33 changes: 33 additions & 0 deletions packages/genomic/licenses-templates/CONSTRUCTIVE.txt
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 3 additions & 0 deletions packages/genomic/src/licenses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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);
Expand Down
Loading