Skip to content

Commit 21fa663

Browse files
authored
Merge pull request #85 from constructive-io/feat/add-constructive-license
feat(genomic): add Constructive license template
2 parents 304fcae + 66929e3 commit 21fa663

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

packages/genomic/__tests__/licenses.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe('license templates', () => {
2525
expect.arrayContaining([
2626
'MIT',
2727
'APACHE-2.0',
28+
'CONSTRUCTIVE',
2829
'ISC',
2930
'GPL-3.0',
3031
'BSD-3-CLAUSE',
@@ -43,6 +44,16 @@ describe('license templates', () => {
4344
expect(content).toContain('All Rights Reserved');
4445
});
4546

47+
it('renders CONSTRUCTIVE license with fixed Interweb copyright', () => {
48+
const content = renderLicense('CONSTRUCTIVE', context);
49+
expect(content).toContain('Constructive License');
50+
expect(content).toContain('Interweb, Inc.');
51+
expect(content).toContain('2099');
52+
expect(content).toContain('Generated by Constructive');
53+
expect(content).toContain('https://constructive.io/legal/license/v1.0');
54+
expect(content).not.toContain('Test User');
55+
});
56+
4657
it('handles case-insensitive lookups', () => {
4758
expect(isSupportedLicense('mit')).toBe(true);
4859
expect(renderLicense('mit', { author: 'User' })).toContain('User');
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Constructive License
2+
3+
Copyright (c) {{YEAR}} Interweb, Inc.
4+
Generated by Constructive (https://constructive.io)
5+
6+
You own the application code generated for you. You may use, modify, deploy,
7+
and distribute it freely, including for commercial use.
8+
9+
Restrictions:
10+
11+
- You may not use this code to offer a service whose primary purpose is to
12+
provide database provisioning, schema generation, security policy
13+
compilation, cloud functions, or AI infrastructure to third parties,
14+
except under a separate commercial agreement with Interweb, Inc.
15+
- You may not sell, license, or distribute the exported code, in whole or
16+
substantial part, as a standalone product or library.
17+
- You may not repackage the framework components generated by Constructive
18+
(as defined in the full license) as your own developer platform or toolchain
19+
for third-party builders.
20+
21+
Generated TypeScript clients and SDKs may be distributed under their own
22+
applicable open-source licenses, as indicated in the LICENSE files included
23+
with those packages.
24+
25+
Full license terms: https://constructive.io/legal/license/v1.0
26+
27+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33+
SOFTWARE.

packages/genomic/src/licenses.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ let cachedTemplates: LicenseTemplateMap | null = null;
1515

1616
export type SupportedLicense = string;
1717
export const DEFAULT_LICENSE = 'MIT';
18+
export const CONSTRUCTIVE_LICENSE = 'CONSTRUCTIVE';
1819
export const CLOSED_LICENSE = 'CLOSED';
1920
export const LICENSE_VALUE_KEYS = ['LICENSE', 'license'];
2021
export const LICENSE_AUTHOR_KEYS = [
@@ -74,6 +75,8 @@ export function listSupportedLicenses(): string[] {
7475
return licenses.sort((a, b) => {
7576
if (a === DEFAULT_LICENSE) return -1;
7677
if (b === DEFAULT_LICENSE) return 1;
78+
if (a === CONSTRUCTIVE_LICENSE) return -1;
79+
if (b === CONSTRUCTIVE_LICENSE) return 1;
7780
if (a === CLOSED_LICENSE) return 1;
7881
if (b === CLOSED_LICENSE) return -1;
7982
return a.localeCompare(b);

0 commit comments

Comments
 (0)