Skip to content
Open
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
14 changes: 13 additions & 1 deletion Source/DotNET/Model/Packages/ScenePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ namespace Cratis.Scene.Model.Packages;
/// The module that implements the package - an npm package name for a web renderer. Design-time tooling
/// needs it to know what to import; the model itself never loads anything.
/// </param>
/// <param name="License">
/// The license the package is available under, as a short human-readable name (<c>MIT</c>,
/// <c>PrimeUI Community</c>). A package picker shows it, because "what am I taking on by selecting this"
/// is a question an author needs answered before they select it, not after.
/// </param>
/// <param name="LicenseUrl">
/// Where the license terms actually live, so a reader can go and check rather than take
/// <paramref name="License"/> on trust. Required in practice for anything that is not a permissive
/// standard license - a name alone tells an author nothing about eligibility or obligations.
/// </param>
public record ScenePackage(
string Name,
string Version,
Expand All @@ -35,4 +45,6 @@ public record ScenePackage(
IReadOnlyList<string> Themes,
string? DisplayName = null,
string? Description = null,
string? Module = null);
string? Module = null,
string? License = null,
string? LicenseUrl = null);
4 changes: 3 additions & 1 deletion Source/DotNET/Model/Profiles/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/// </param>
/// <param name="AuthorUrl">A link to the original creator or the theme's home, shown alongside <paramref name="Author"/>.</param>
/// <param name="License">The license the theme is used under, so redistributing it stays honest.</param>
/// <param name="LicenseUrl">Where those license terms live, so a reader can check them rather than take <paramref name="License"/> on trust.</param>

Check failure on line 26 in Source/DotNET/Model/Profiles/Theme.cs

View workflow job for this annotation

GitHub Actions / dotnet-build

Order elements in documentation comment (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1232)

Check failure on line 26 in Source/DotNET/Model/Profiles/Theme.cs

View workflow job for this annotation

GitHub Actions / dotnet-build

Order elements in documentation comment (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1232)

Check failure on line 26 in Source/DotNET/Model/Profiles/Theme.cs

View workflow job for this annotation

GitHub Actions / dotnet-build

Order elements in documentation comment (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1232)

Check failure on line 26 in Source/DotNET/Model/Profiles/Theme.cs

View workflow job for this annotation

GitHub Actions / dotnet-build

Order elements in documentation comment (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1232)

Check failure on line 26 in Source/DotNET/Model/Profiles/Theme.cs

View workflow job for this annotation

GitHub Actions / dotnet-build

Order elements in documentation comment (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1232)

Check failure on line 26 in Source/DotNET/Model/Profiles/Theme.cs

View workflow job for this annotation

GitHub Actions / dotnet-build

Order elements in documentation comment (https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1232)
/// <param name="Description">A one-line description for a theme picker.</param>
public record Theme(
string Name,
Expand All @@ -32,4 +33,5 @@
string? Author = null,
string? AuthorUrl = null,
string? License = null,
string? Description = null);
string? Description = null,
string? LicenseUrl = null);
2 changes: 2 additions & 0 deletions Source/JavaScript/blueprint.components/componentsBlueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export const componentsBlueprintManifest: ScenePackage = {
displayName: 'Cratis Components Blueprint',
description: 'Arc-bound screen and dialog templates: whole pages built from the Cratis Components composites, for the default blueprint shell.',
module: '@cratis/scene.blueprint.components',
license: 'MIT',
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
};

/**
Expand Down
2 changes: 2 additions & 0 deletions Source/JavaScript/blueprint.default/defaultBlueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export const defaultBlueprintManifest: ScenePackage = {
displayName: 'Cratis Default Blueprint',
description: 'Application shells with eight menu modes, the components that fill their slots, and a full screen and dialog template set.',
module: '@cratis/scene.blueprint.default',
license: 'MIT',
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
};

/**
Expand Down
2 changes: 2 additions & 0 deletions Source/JavaScript/components/cratisComponentsPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export const cratisComponentsPackageManifest: ScenePackage = {
displayName: 'Cratis Components',
description: "Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind.",
module: '@cratis/scene.components',
license: 'MIT',
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
};

/**
Expand Down
16 changes: 16 additions & 0 deletions Source/JavaScript/model/packages/ScenePackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ export interface ScenePackage {
* tooling needs it to know what to import; the model itself never loads anything.
*/
module?: string;

/**
* The license the package is available under, as a short human-readable name (`MIT`,
* `PrimeUI Community`). A package picker shows it, because "what am I taking on by selecting this"
* is a question an author needs answered before they select it, not after.
*/
license?: string;

/**
* Where the license terms actually live, so a reader can go and check rather than take `license` on
* trust. Required in practice for anything that is not a permissive standard license — a name alone
* tells an author nothing about eligibility or obligations.
*/
licenseUrl?: string;
}

export const ScenePackagePropertyNames: (keyof ScenePackage)[] = [
Expand All @@ -87,4 +101,6 @@ export const ScenePackagePropertyNames: (keyof ScenePackage)[] = [
'displayName',
'description',
'module',
'license',
'licenseUrl',
];
6 changes: 6 additions & 0 deletions Source/JavaScript/model/profiles/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export interface Theme {
* A one-line description for a theme picker.
*/
description?: string;

/**
* Where those license terms live, so a reader can check them rather than take `license` on trust.
*/
licenseUrl?: string;
}

export const ThemePropertyNames: (keyof Theme)[] = [
Expand All @@ -61,4 +66,5 @@ export const ThemePropertyNames: (keyof Theme)[] = [
'authorUrl',
'license',
'description',
'licenseUrl',
];
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Cratis. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

import { primeReactThemes } from '../theme';
import { primeReactThemeLicense, primeReactThemeLicenseUrl, primeReactThemes } from '../theme';

describe('when checking attribution', () => {
it('should credit an author on every theme', () => {
Expand All @@ -27,7 +27,17 @@ describe('when checking attribution', () => {
* catalog would have gone on advertising MIT indefinitely.
*/
it('should state the commercial license PrimeReact 11 actually ships under, not the MIT of v10', () => {
primeReactThemes.filter((theme) => theme.license !== 'PrimeUI Commercial').should.deep.equal([]);
primeReactThemeLicense.should.equal('PrimeUI Community / Commercial');
primeReactThemes.filter((theme) => theme.license !== primeReactThemeLicense).should.deep.equal([]);
});

/**
* A license name on its own does not tell a reader whether they qualify for the free Community tier
* or owe a commercial fee. The link is the part that answers that, so it is pinned too.
*/
it('should link to the terms on every theme, not just name them', () => {
primeReactThemeLicenseUrl.should.equal('https://primeui.dev/licenses/community');
primeReactThemes.filter((theme) => theme.licenseUrl !== primeReactThemeLicenseUrl).should.deep.equal([]);
});

it('should describe every theme for a picker', () => {
Expand Down
5 changes: 5 additions & 0 deletions Source/JavaScript/primereact/primeReactPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export const primeReactPackageManifest: ScenePackage = {
displayName: 'PrimeReact',
description: 'PrimeReact 11 components and PrimeTek\'s @primeuix/themes presets, mapped onto Scene\'s abstract component names.',
module: '@cratis/scene.primereact',
// PrimeReact 11 is PrimeTek's commercial PrimeUI, not MIT as version 10 was. The Community
// tier is free for eligible projects but still requires a key, so an author selecting this
// package needs to see the terms before they select it, not after a banner appears.
license: 'PrimeUI Community / Commercial',
licenseUrl: 'https://primeui.dev/licenses/community',
};

/**
Expand Down
10 changes: 9 additions & 1 deletion Source/JavaScript/primereact/theme/primeReactThemes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ export const primeReactThemeCompatibility: string[] = ['PrimeReact', 'Tailwind',
* @see https://primeui.dev/licenses/community for the free community tier and its eligibility limits.
* @see https://primeui.dev/licenses/commercial for the paid tier.
*/
export const primeReactThemeLicense = 'PrimeUI Commercial';
export const primeReactThemeLicense = 'PrimeUI Community / Commercial';

/**
* Where those terms live. A license name alone tells a reader nothing about whether they qualify for the
* free Community tier or owe a commercial fee, so the catalog carries the link rather than making them
* search for it.
*/
export const primeReactThemeLicenseUrl = 'https://primeui.dev/licenses/community';

/**
* Every theme this package ships, as Scene {@link Theme}s.
Expand All @@ -61,6 +68,7 @@ export const primeReactThemes: Theme[] = themePresets.map((preset) => ({
author: 'PrimeTek',
authorUrl: 'https://primereact.org',
license: primeReactThemeLicense,
licenseUrl: primeReactThemeLicenseUrl,
}));

/**
Expand Down
2 changes: 2 additions & 0 deletions Source/JavaScript/react/core/corePackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const corePackageManifest: ScenePackage = {
displayName: 'Core',
description: 'The built-in fallback vocabulary every ui profile resolves against.',
module: '@cratis/scene.react',
license: 'MIT',
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
};

/**
Expand Down
2 changes: 2 additions & 0 deletions Source/JavaScript/tailwind/tailwindPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export const tailwindPackageManifest: ScenePackage = {
displayName: 'Tailwind CSS',
description: 'Utility-first CSS. The styling system Cratis Components and the default layouts are written against.',
module: '@cratis/scene.tailwind',
license: 'MIT',
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
};

/**
Expand Down
7 changes: 5 additions & 2 deletions scene-model-shape.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@
"author",
"authorUrl",
"license",
"description"
"description",
"licenseUrl"
],
"PackageDependency": [
"name",
Expand All @@ -209,7 +210,9 @@
"themes",
"displayName",
"description",
"module"
"module",
"license",
"licenseUrl"
],
"Screen": [
"name",
Expand Down
Loading