feat(settings): add open source license notices (#8962)
Co-authored-by: maria <[email protected]>
This commit is contained in:
1 parent
e816064945
commit
4a4c6dd2ad
38 files changed
+3007
-59
No files matched your search
@@ -30,6 +30,8 @@ dist-electron/
|
||||
.electron-runtime/
|
||||
.showcase/
|
||||
apps/mobile/.showcase/
|
||||
apps/mobile/.generated/
|
||||
/.generated/
|
||||
artifacts/app-store/screenshots/
|
||||
.github/pr-assets/
|
||||
native/**/target/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const { pathToFileURL } = require("node:url");
|
||||
const { getDefaultConfig } = require("expo/metro-config");
|
||||
const { withUniwindConfig } = require("uniwind/metro");
|
||||
const extraThemes = require("./generated-uniwind-theme-names.json");
|
||||
@@ -7,6 +8,13 @@ const extraThemes = require("./generated-uniwind-theme-names.json");
|
||||
/** @type {import("expo/metro-config").MetroConfig} */
|
||||
const config = getDefaultConfig(__dirname);
|
||||
const workspaceRoot = path.resolve(__dirname, "../..");
|
||||
const generatedLicenseModuleRoot = path.join(__dirname, ".generated", "third-party-licenses");
|
||||
const licenseGeneratorSource = path.join(
|
||||
workspaceRoot,
|
||||
"scripts",
|
||||
"lib",
|
||||
"third-party-licenses.ts",
|
||||
);
|
||||
const escapedWorkspaceRoot = workspaceRoot.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
const mobileShikiRoot = path.dirname(require.resolve("shiki/package.json", { paths: [__dirname] }));
|
||||
const resolveShikiDependencyRoot = (packageName) => {
|
||||
@@ -37,6 +45,7 @@ config.resolver = {
|
||||
],
|
||||
extraNodeModules: {
|
||||
...config.resolver?.extraNodeModules,
|
||||
"@t3tools/mobile-third-party-licenses": generatedLicenseModuleRoot,
|
||||
shiki: mobileShikiRoot,
|
||||
"@shikijs/core": resolveShikiDependencyRoot("@shikijs/core"),
|
||||
"@shikijs/engine-javascript": resolveShikiDependencyRoot("@shikijs/engine-javascript"),
|
||||
@@ -48,8 +57,46 @@ config.resolver = {
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = withUniwindConfig(config, {
|
||||
cssEntryFile: "./global.css",
|
||||
extraThemes,
|
||||
polyfills: { rem: 14 },
|
||||
});
|
||||
async function writeFileIfChanged(filePath, contents) {
|
||||
try {
|
||||
if ((await fs.promises.readFile(filePath, "utf8")) === contents) return;
|
||||
} catch (error) {
|
||||
if (error?.code !== "ENOENT") throw error;
|
||||
}
|
||||
await fs.promises.writeFile(filePath, contents, "utf8");
|
||||
}
|
||||
|
||||
async function generateMobileThirdPartyLicenses() {
|
||||
await fs.promises.mkdir(generatedLicenseModuleRoot, { recursive: true });
|
||||
const generatorVersion = (await fs.promises.stat(licenseGeneratorSource)).mtimeMs;
|
||||
const { generateThirdPartyLicenseManifest } = await import(
|
||||
`${pathToFileURL(licenseGeneratorSource).href}?version=${String(generatorVersion)}`
|
||||
);
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: path.join(workspaceRoot, "third-party-licenses.config.json"),
|
||||
packageManifests: [{ bundle: "mobile", path: path.join(__dirname, "package.json") }],
|
||||
allowMissingGeneratedNotices:
|
||||
process.env.NODE_ENV !== "production" &&
|
||||
process.env.EAS_BUILD !== "true" &&
|
||||
process.env.T3CODE_LICENSES_STRICT !== "1",
|
||||
});
|
||||
|
||||
await Promise.all([
|
||||
writeFileIfChanged(
|
||||
path.join(generatedLicenseModuleRoot, "index.js"),
|
||||
`module.exports = ${JSON.stringify(manifest)};\n`,
|
||||
),
|
||||
writeFileIfChanged(
|
||||
path.join(generatedLicenseModuleRoot, "package.json"),
|
||||
'{"main":"index.js"}\n',
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
module.exports = generateMobileThirdPartyLicenses().then(() =>
|
||||
withUniwindConfig(config, {
|
||||
cssEntryFile: "./global.css",
|
||||
extraThemes,
|
||||
polyfills: { rem: 14 },
|
||||
}),
|
||||
);
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 472 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB |
@@ -79,11 +79,7 @@ const colors = {
|
||||
|
||||
const customIcons = {
|
||||
agents: "t3-file-icon-agents",
|
||||
claude: "t3-file-icon-claude",
|
||||
package: "t3-file-icon-package-json",
|
||||
pnpm: "t3-file-icon-pnpm",
|
||||
readme: "t3-file-icon-readme",
|
||||
tsconfig: "t3-file-icon-tsconfig",
|
||||
video: "t3-file-icon-video",
|
||||
};
|
||||
|
||||
|
||||
@@ -30,13 +30,11 @@ export const MARKDOWN_FILE_ICON_SOURCES = {
|
||||
nextjs: require("../assets/file-icons/pierre_nextjs.png"),
|
||||
npm: require("../assets/file-icons/pierre_npm.png"),
|
||||
oxc: require("../assets/file-icons/pierre_oxc.png"),
|
||||
package: require("../assets/file-icons/pierre_package.png"),
|
||||
pnpm: require("../assets/file-icons/pierre_pnpm.png"),
|
||||
postcss: require("../assets/file-icons/pierre_postcss.png"),
|
||||
prettier: require("../assets/file-icons/pierre_prettier.png"),
|
||||
python: require("../assets/file-icons/pierre_python.png"),
|
||||
react: require("../assets/file-icons/pierre_react.png"),
|
||||
readme: require("../assets/file-icons/pierre_readme.png"),
|
||||
ruby: require("../assets/file-icons/pierre_ruby.png"),
|
||||
rust: require("../assets/file-icons/pierre_rust.png"),
|
||||
sass: require("../assets/file-icons/pierre_sass.png"),
|
||||
@@ -49,7 +47,6 @@ export const MARKDOWN_FILE_ICON_SOURCES = {
|
||||
tailwind: require("../assets/file-icons/pierre_tailwind.png"),
|
||||
terraform: require("../assets/file-icons/pierre_terraform.png"),
|
||||
text: require("../assets/file-icons/pierre_text.png"),
|
||||
tsconfig: require("../assets/file-icons/pierre_tsconfig.png"),
|
||||
typescript: require("../assets/file-icons/pierre_typescript.png"),
|
||||
video: require("../assets/file-icons/pierre_video.png"),
|
||||
vite: require("../assets/file-icons/pierre_vite.png"),
|
||||
|
||||
@@ -116,7 +116,7 @@ const FILE_ICON_BY_NAME: Readonly<Record<string, MarkdownFileIcon>> = {
|
||||
"next.config.mjs": "nextjs",
|
||||
"next.config.mts": "nextjs",
|
||||
"next.config.ts": "nextjs",
|
||||
"package.json": "package",
|
||||
"package.json": "npm",
|
||||
"pnpm-lock.yaml": "pnpm",
|
||||
"pnpm-workspace.yaml": "pnpm",
|
||||
"postcss.config.js": "postcss",
|
||||
@@ -127,7 +127,7 @@ const FILE_ICON_BY_NAME: Readonly<Record<string, MarkdownFileIcon>> = {
|
||||
"prettier.config.cjs": "prettier",
|
||||
"prettier.config.mjs": "prettier",
|
||||
rakefile: "ruby",
|
||||
"readme.md": "readme",
|
||||
"readme.md": "markdown",
|
||||
"stylelint.config.js": "stylelint",
|
||||
"stylelint.config.cjs": "stylelint",
|
||||
"stylelint.config.mjs": "stylelint",
|
||||
@@ -139,7 +139,7 @@ const FILE_ICON_BY_NAME: Readonly<Record<string, MarkdownFileIcon>> = {
|
||||
"tailwind.config.cjs": "tailwind",
|
||||
"tailwind.config.mjs": "tailwind",
|
||||
"tailwind.config.ts": "tailwind",
|
||||
"tsconfig.json": "tsconfig",
|
||||
"tsconfig.json": "typescript",
|
||||
"vite.config.js": "vite",
|
||||
"vite.config.mjs": "vite",
|
||||
"vite.config.mts": "vite",
|
||||
@@ -253,7 +253,7 @@ export function resolveMarkdownFileIcon(value: string): MarkdownFileIcon {
|
||||
const exactIcon = FILE_ICON_BY_NAME[basename];
|
||||
if (exactIcon) return exactIcon;
|
||||
if (basename.startsWith("tsconfig.") && basename.endsWith(".json")) {
|
||||
return "tsconfig";
|
||||
return "typescript";
|
||||
}
|
||||
const segments = basename.split(".");
|
||||
for (let index = 1; index < segments.length; index += 1) {
|
||||
|
||||
@@ -55,6 +55,10 @@ import { SettingsClientStorageRouteScreen } from "./features/settings/SettingsCl
|
||||
import { SettingsAuthRouteScreen } from "./features/settings/SettingsAuthRouteScreen";
|
||||
import { SettingsEnvironmentsRouteScreen } from "./features/settings/SettingsEnvironmentsRouteScreen";
|
||||
import { SettingsLegalRouteScreen } from "./features/settings/SettingsLegalRouteScreen";
|
||||
import {
|
||||
SettingsOpenSourceLicenseRouteScreen,
|
||||
SettingsOpenSourceLicensesRouteScreen,
|
||||
} from "./features/settings/SettingsOpenSourceLicensesRouteScreen";
|
||||
import { SettingsProjectGroupingRouteScreen } from "./features/settings/SettingsProjectGroupingRouteScreen";
|
||||
import { UsageLimitAccountScreen } from "./features/usage/UsageLimitsPooled";
|
||||
import { UsageRouteScreen } from "./features/usage/UsageRouteScreen";
|
||||
@@ -197,6 +201,20 @@ const SettingsContentStack = createNativeStackNavigator({
|
||||
screen: UsageLimitAccountScreen,
|
||||
options: { title: "Account" },
|
||||
}),
|
||||
SettingsOpenSourceLicenses: createNativeStackScreen({
|
||||
screen: SettingsOpenSourceLicensesRouteScreen,
|
||||
linking: "open-source-licenses",
|
||||
options: {
|
||||
title: "Open source licenses",
|
||||
},
|
||||
}),
|
||||
SettingsOpenSourceLicense: createNativeStackScreen({
|
||||
screen: SettingsOpenSourceLicenseRouteScreen,
|
||||
linking: "open-source-licenses/:entryKey",
|
||||
options: {
|
||||
title: "License notice",
|
||||
},
|
||||
}),
|
||||
SettingsUsage: createNativeStackScreen({
|
||||
screen: UsageRouteScreen,
|
||||
linking: "usage",
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
import { LegendList } from "@legendapp/list/react-native";
|
||||
import { type StaticScreenProps, useNavigation } from "@react-navigation/native";
|
||||
import {
|
||||
filterThirdPartyLicenseEntries,
|
||||
findThirdPartyLicenseEntry,
|
||||
formatLicenseBundles,
|
||||
thirdPartyLicenseEntryKey,
|
||||
type ThirdPartyLicenseEntry,
|
||||
} from "@t3tools/shared/thirdPartyLicenses";
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import { Linking, Platform, Pressable, ScrollView, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import { AndroidScreenHeader } from "../../components/AndroidScreenHeader";
|
||||
import { SymbolView } from "../../components/AppSymbol";
|
||||
import { AppText as Text, AppTextInput as TextInput } from "../../components/AppText";
|
||||
import { NativeStackScreenOptions } from "../../native/StackHeader";
|
||||
import { getMobileThirdPartyLicenses } from "./mobileThirdPartyLicenses";
|
||||
|
||||
function useMobileThirdPartyLicenses() {
|
||||
return useMemo(() => {
|
||||
try {
|
||||
return getMobileThirdPartyLicenses();
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}, []);
|
||||
}
|
||||
|
||||
function LicenseRow(props: {
|
||||
readonly entry: ThirdPartyLicenseEntry;
|
||||
readonly onPress: () => void;
|
||||
}) {
|
||||
return (
|
||||
<Pressable
|
||||
accessibilityHint="Opens the complete license notice"
|
||||
accessibilityLabel={`${props.entry.name}, ${props.entry.license}`}
|
||||
accessibilityRole="button"
|
||||
onPress={props.onPress}
|
||||
className="border-b border-border bg-card px-5 py-4 active:bg-card-alt"
|
||||
>
|
||||
<View className="flex-row items-start gap-3">
|
||||
<View className="min-w-0 flex-1 gap-1">
|
||||
<Text className="text-base font-t3-medium text-foreground" numberOfLines={2}>
|
||||
{props.entry.name}
|
||||
</Text>
|
||||
<Text className="text-sm text-foreground-muted" numberOfLines={2}>
|
||||
{props.entry.version ? `${props.entry.version} · ` : ""}
|
||||
{props.entry.license}
|
||||
</Text>
|
||||
</View>
|
||||
<SymbolView
|
||||
name="chevron.right"
|
||||
size={16}
|
||||
tintColorClassName={"accent-chevron"}
|
||||
type="monochrome"
|
||||
weight="semibold"
|
||||
/>
|
||||
</View>
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
|
||||
export function SettingsOpenSourceLicensesRouteScreen() {
|
||||
const navigation = useNavigation();
|
||||
const insets = useSafeAreaInsets();
|
||||
const [query, setQuery] = useState("");
|
||||
const manifest = useMobileThirdPartyLicenses();
|
||||
const entries = manifest?.entries ?? [];
|
||||
const filteredEntries = useMemo(
|
||||
() => filterThirdPartyLicenseEntries(entries, query),
|
||||
[entries, query],
|
||||
);
|
||||
const renderItem = useCallback(
|
||||
({ item }: { readonly item: ThirdPartyLicenseEntry }) => (
|
||||
<LicenseRow
|
||||
entry={item}
|
||||
onPress={() =>
|
||||
navigation.navigate("SettingsSheet", {
|
||||
screen: "SettingsContent",
|
||||
params: {
|
||||
screen: "SettingsOpenSourceLicense",
|
||||
params: { entryKey: thirdPartyLicenseEntryKey(item) },
|
||||
},
|
||||
})
|
||||
}
|
||||
/>
|
||||
),
|
||||
[navigation],
|
||||
);
|
||||
|
||||
if (!manifest) {
|
||||
return (
|
||||
<View collapsable={false} className="flex-1 bg-sheet">
|
||||
{Platform.OS === "android" ? (
|
||||
<>
|
||||
<NativeStackScreenOptions options={{ headerShown: false }} />
|
||||
<AndroidScreenHeader title="Open source licenses" onBack={() => navigation.goBack()} />
|
||||
</>
|
||||
) : null}
|
||||
<View className="flex-1 items-center justify-center px-6">
|
||||
<Text className="text-center text-base text-foreground-muted">
|
||||
License notices are unavailable in this build.
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View collapsable={false} className="flex-1 bg-sheet">
|
||||
{Platform.OS === "android" ? (
|
||||
<>
|
||||
<NativeStackScreenOptions options={{ headerShown: false }} />
|
||||
<AndroidScreenHeader title="Open source licenses" onBack={() => navigation.goBack()} />
|
||||
</>
|
||||
) : null}
|
||||
<LegendList
|
||||
className="flex-1"
|
||||
contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
data={filteredEntries}
|
||||
estimatedItemSize={78}
|
||||
keyboardDismissMode="on-drag"
|
||||
keyboardShouldPersistTaps="handled"
|
||||
keyExtractor={thirdPartyLicenseEntryKey}
|
||||
ListEmptyComponent={
|
||||
<View className="items-center px-6 py-12">
|
||||
<Text className="text-center text-base text-foreground-muted">
|
||||
No licenses match that search.
|
||||
</Text>
|
||||
</View>
|
||||
}
|
||||
ListHeaderComponent={
|
||||
<View className="gap-4 px-5 pt-4 pb-5">
|
||||
<Text className="text-base leading-normal text-foreground-muted">
|
||||
Notices for dependencies, assets, and optional tools used by T3 Code Mobile.
|
||||
</Text>
|
||||
<TextInput
|
||||
accessibilityLabel="Search open-source licenses"
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
clearButtonMode="while-editing"
|
||||
onChangeText={setQuery}
|
||||
placeholder="Search packages"
|
||||
returnKeyType="search"
|
||||
value={query}
|
||||
/>
|
||||
<Text className="tabular-nums text-sm text-foreground-muted">
|
||||
{filteredEntries.length === entries.length
|
||||
? `${String(entries.length)} notices`
|
||||
: `${String(filteredEntries.length)} of ${String(entries.length)} notices`}
|
||||
</Text>
|
||||
</View>
|
||||
}
|
||||
renderItem={renderItem}
|
||||
showsVerticalScrollIndicator={false}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
type LicenseDetailProps = StaticScreenProps<{ readonly entryKey: string }>;
|
||||
|
||||
export function SettingsOpenSourceLicenseRouteScreen({ route }: LicenseDetailProps) {
|
||||
const navigation = useNavigation();
|
||||
const insets = useSafeAreaInsets();
|
||||
const manifest = useMobileThirdPartyLicenses();
|
||||
const entry = manifest
|
||||
? findThirdPartyLicenseEntry(manifest.entries, route.params.entryKey)
|
||||
: undefined;
|
||||
const sourceUrl = entry?.sourceUrl?.match(/^https?:\/\//) ? entry.sourceUrl : null;
|
||||
|
||||
if (!entry) {
|
||||
return (
|
||||
<View collapsable={false} className="flex-1 bg-sheet">
|
||||
{Platform.OS === "android" ? (
|
||||
<>
|
||||
<NativeStackScreenOptions options={{ headerShown: false }} />
|
||||
<AndroidScreenHeader title="License notice" onBack={() => navigation.goBack()} />
|
||||
</>
|
||||
) : null}
|
||||
<View className="flex-1 items-center justify-center px-6">
|
||||
<Text className="text-center text-base text-foreground-muted">
|
||||
This license notice is unavailable.
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View collapsable={false} className="flex-1 bg-sheet">
|
||||
{Platform.OS === "android" ? (
|
||||
<>
|
||||
<NativeStackScreenOptions options={{ headerShown: false }} />
|
||||
<AndroidScreenHeader title="License notice" onBack={() => navigation.goBack()} />
|
||||
</>
|
||||
) : null}
|
||||
<ScrollView
|
||||
className="flex-1"
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
contentContainerClassName="gap-5 px-5 pt-4"
|
||||
contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
|
||||
showsVerticalScrollIndicator={false}
|
||||
>
|
||||
<View className="gap-2 px-1">
|
||||
<Text className="text-2xl font-t3-bold text-foreground">{entry.name}</Text>
|
||||
<Text className="text-base leading-normal text-foreground-muted">
|
||||
{[entry.version, entry.license, formatLicenseBundles(entry.bundles)]
|
||||
.filter((value): value is string => Boolean(value))
|
||||
.join(" · ")}
|
||||
</Text>
|
||||
{sourceUrl ? (
|
||||
<Pressable
|
||||
accessibilityHint="Opens the project website"
|
||||
accessibilityRole="link"
|
||||
onPress={() => void Linking.openURL(sourceUrl)}
|
||||
className="min-h-12 flex-row items-center gap-2 self-start py-2 active:opacity-60"
|
||||
>
|
||||
<Text className="font-t3-medium text-primary">Project source</Text>
|
||||
<SymbolView
|
||||
name="arrow.up.right"
|
||||
size={16}
|
||||
tintColorClassName={"accent-primary"}
|
||||
type="monochrome"
|
||||
weight="semibold"
|
||||
/>
|
||||
</Pressable>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
<View className="overflow-hidden rounded-[24px] border-continuous bg-card p-4">
|
||||
<Text selectable className="font-mono text-base leading-normal text-foreground">
|
||||
{entry.noticeText}
|
||||
</Text>
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -821,6 +821,11 @@ function AppSettingsSection() {
|
||||
return (
|
||||
<SettingsSection title="App">
|
||||
<SettingsRow icon="internaldrive" label="Client Storage" target="SettingsClientStorage" />
|
||||
<SettingsRow
|
||||
icon="doc.on.doc"
|
||||
label="Open source licenses"
|
||||
target="SettingsOpenSourceLicenses"
|
||||
/>
|
||||
<SettingsRow icon="doc.text" label="Legal" fullScreenTarget="SettingsLegal" />
|
||||
{updateCheckAvailable ? (
|
||||
<Pressable
|
||||
|
||||
@@ -4,6 +4,7 @@ export type SettingsSheetTarget =
|
||||
| "SettingsAppearance"
|
||||
| "SettingsProjectGrouping"
|
||||
| "SettingsClientStorage"
|
||||
| "SettingsOpenSourceLicenses"
|
||||
| "SettingsUsage";
|
||||
|
||||
export type SettingsLegalDocumentTarget = "SettingsLegal";
|
||||
@@ -0,0 +1,13 @@
|
||||
import {
|
||||
decodeThirdPartyLicenseManifest,
|
||||
type ThirdPartyLicenseManifest,
|
||||
} from "@t3tools/shared/thirdPartyLicenses";
|
||||
|
||||
let cachedManifest: ThirdPartyLicenseManifest | undefined;
|
||||
|
||||
export function getMobileThirdPartyLicenses(): ThirdPartyLicenseManifest {
|
||||
if (cachedManifest) return cachedManifest;
|
||||
const generatedManifest: unknown = require("@t3tools/mobile-third-party-licenses");
|
||||
cachedManifest = decodeThirdPartyLicenseManifest(generatedManifest);
|
||||
return cachedManifest;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ describe("resolveMarkdownLinkPresentation", () => {
|
||||
expect(resolveMarkdownLinkPresentation("package.json")).toEqual({
|
||||
kind: "file",
|
||||
href: "package.json",
|
||||
icon: "package",
|
||||
icon: "npm",
|
||||
label: "package.json",
|
||||
path: "package.json",
|
||||
});
|
||||
|
||||
@@ -95,7 +95,7 @@ describe("nativeMarkdownTextRuns", () => {
|
||||
{
|
||||
text: "README.md:12",
|
||||
href: "file:///repo/README.md#L12",
|
||||
fileIcon: "readme",
|
||||
fileIcon: "markdown",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
declare module "@t3tools/mobile-third-party-licenses" {
|
||||
const manifest: unknown;
|
||||
export default manifest;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
# Third-Party Notices
|
||||
|
||||
## vscode-icons
|
||||
|
||||
The custom file icon symbols in `src/pierre-icons.ts` are adapted from the
|
||||
[`vscode-icons`](https://github.com/vscode-icons/vscode-icons) project.
|
||||
|
||||
Copyright (c) 2016 Roberto Huertas
|
||||
|
||||
Licensed under the MIT License. The full license text is available in the
|
||||
upstream repository: <https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE>.
|
||||
@@ -0,0 +1,270 @@
|
||||
import { ChevronRightIcon, ExternalLinkIcon, SearchIcon } from "lucide-react";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
|
||||
import {
|
||||
decodeThirdPartyLicenseManifest,
|
||||
filterThirdPartyLicenseEntries,
|
||||
formatLicenseBundles,
|
||||
thirdPartyLicenseEntryKey,
|
||||
type ThirdPartyLicenseEntry,
|
||||
type ThirdPartyLicenseManifest,
|
||||
} from "@t3tools/shared/thirdPartyLicenses";
|
||||
|
||||
import { Button } from "../ui/button";
|
||||
import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "../ui/collapsible";
|
||||
import { InputGroup, InputGroupAddon, InputGroupInput } from "../ui/input-group";
|
||||
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
|
||||
import { SettingsPageContainer, SettingsSection } from "./settingsLayout";
|
||||
|
||||
type LicenseManifestState =
|
||||
| { readonly status: "loading" }
|
||||
| { readonly status: "error"; readonly message: string }
|
||||
| { readonly status: "ready"; readonly manifest: ThirdPartyLicenseManifest };
|
||||
|
||||
async function loadLicenseManifest(signal: AbortSignal): Promise<ThirdPartyLicenseManifest> {
|
||||
const response = await fetch(
|
||||
`${import.meta.env.BASE_URL.replace(/\/$/, "")}/third-party-licenses.json`,
|
||||
{ signal },
|
||||
);
|
||||
if (!response.ok) {
|
||||
throw new Error(`The license manifest request failed with status ${String(response.status)}.`);
|
||||
}
|
||||
return decodeThirdPartyLicenseManifest((await response.json()) as unknown);
|
||||
}
|
||||
|
||||
function LicenseNoticeRow({
|
||||
entry,
|
||||
open,
|
||||
onOpenChange,
|
||||
}: {
|
||||
readonly entry: ThirdPartyLicenseEntry;
|
||||
readonly open: boolean;
|
||||
readonly onOpenChange: (open: boolean) => void;
|
||||
}) {
|
||||
return (
|
||||
<Collapsible open={open} onOpenChange={onOpenChange}>
|
||||
<article>
|
||||
<div className="flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9">
|
||||
<CollapsibleTrigger className="group flex min-h-10 min-w-0 flex-1 items-center gap-2.5 px-3 text-left sm:min-h-9 sm:px-4">
|
||||
<ChevronRightIcon
|
||||
aria-hidden
|
||||
className="size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90"
|
||||
/>
|
||||
<span className="flex min-w-0 flex-1 items-baseline gap-2">
|
||||
<span className="truncate font-medium text-foreground">{entry.name}</span>
|
||||
{entry.version ? (
|
||||
<code className="shrink-0 text-xs text-muted-foreground">{entry.version}</code>
|
||||
) : null}
|
||||
</span>
|
||||
<span className="max-w-[42%] shrink-0 truncate text-xs text-muted-foreground">
|
||||
{entry.license} · {formatLicenseBundles(entry.bundles)}
|
||||
</span>
|
||||
</CollapsibleTrigger>
|
||||
{entry.sourceUrl ? (
|
||||
<Button
|
||||
aria-label={`View project source for ${entry.name}`}
|
||||
className="me-3 shrink-0 sm:me-4"
|
||||
render={<a href={entry.sourceUrl} rel="noreferrer noopener" target="_blank" />}
|
||||
size="icon-micro"
|
||||
title="Project source"
|
||||
variant="ghost-muted"
|
||||
>
|
||||
<ExternalLinkIcon aria-hidden className="size-3" />
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
<CollapsiblePanel>
|
||||
{open ? (
|
||||
<div className="px-9 pt-1 pb-4 sm:px-10">
|
||||
<pre className="max-w-[76ch] whitespace-pre-wrap break-words font-mono text-xs/5 text-foreground/80">
|
||||
{entry.noticeText}
|
||||
</pre>
|
||||
</div>
|
||||
) : null}
|
||||
</CollapsiblePanel>
|
||||
</article>
|
||||
</Collapsible>
|
||||
);
|
||||
}
|
||||
|
||||
function LicenseCount({
|
||||
filteredCount,
|
||||
totalCount,
|
||||
}: {
|
||||
filteredCount: number;
|
||||
totalCount: number;
|
||||
}) {
|
||||
return (
|
||||
<p className="whitespace-nowrap text-xs font-normal text-muted-foreground tabular-nums">
|
||||
{filteredCount === totalCount
|
||||
? `${String(totalCount)} notices`
|
||||
: `${String(filteredCount)} of ${String(totalCount)}`}
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
||||
function LicenseHeaderAction({
|
||||
query,
|
||||
onQueryChange,
|
||||
searchOpen,
|
||||
onSearchOpenChange,
|
||||
filteredCount,
|
||||
totalCount,
|
||||
}: {
|
||||
query: string;
|
||||
onQueryChange: (value: string) => void;
|
||||
searchOpen: boolean;
|
||||
onSearchOpenChange: (open: boolean) => void;
|
||||
filteredCount: number;
|
||||
totalCount: number;
|
||||
}) {
|
||||
if (!searchOpen) {
|
||||
return (
|
||||
<div className="flex items-center gap-1.5">
|
||||
<LicenseCount filteredCount={filteredCount} totalCount={totalCount} />
|
||||
<Tooltip>
|
||||
<TooltipTrigger
|
||||
render={
|
||||
<Button
|
||||
aria-label="Search open-source licenses"
|
||||
onClick={() => onSearchOpenChange(true)}
|
||||
size="icon-micro"
|
||||
type="button"
|
||||
variant="ghost-muted"
|
||||
>
|
||||
<SearchIcon className="size-3" />
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
<TooltipPopup side="top">Search licenses</TooltipPopup>
|
||||
</Tooltip>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="hidden sm:block">
|
||||
<LicenseCount filteredCount={filteredCount} totalCount={totalCount} />
|
||||
</div>
|
||||
<InputGroup className="w-36 sm:w-44">
|
||||
<InputGroupAddon>
|
||||
<SearchIcon aria-hidden className="size-3" />
|
||||
</InputGroupAddon>
|
||||
<InputGroupInput
|
||||
aria-label="Search open-source licenses"
|
||||
autoFocus
|
||||
onBlur={() => {
|
||||
if (query.length === 0) onSearchOpenChange(false);
|
||||
}}
|
||||
onChange={(event) => onQueryChange(event.currentTarget.value)}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key !== "Escape") return;
|
||||
event.preventDefault();
|
||||
onQueryChange("");
|
||||
onSearchOpenChange(false);
|
||||
}}
|
||||
placeholder="Search licenses"
|
||||
size="sm"
|
||||
type="search"
|
||||
value={query}
|
||||
/>
|
||||
</InputGroup>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function LicenseManifestError({ message, onRetry }: { message: string; onRetry: () => void }) {
|
||||
return (
|
||||
<div className="flex flex-col items-start gap-3 px-3 py-5 sm:px-4">
|
||||
<div className="flex flex-col gap-1">
|
||||
<h3 className="text-sm font-medium text-foreground">Open-source notices are unavailable</h3>
|
||||
<p className="max-w-[70ch] text-pretty text-[13px] leading-[1.45] text-muted-foreground/80">
|
||||
{message}
|
||||
</p>
|
||||
</div>
|
||||
<Button type="button" size="xs" variant="outline" onClick={onRetry}>
|
||||
Try again
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function OpenSourceLicensesPanel() {
|
||||
const [state, setState] = useState<LicenseManifestState>({ status: "loading" });
|
||||
const [query, setQuery] = useState("");
|
||||
const [searchOpen, setSearchOpen] = useState(false);
|
||||
const [openEntryKey, setOpenEntryKey] = useState<string | null>(null);
|
||||
const [requestVersion, setRequestVersion] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
const controller = new AbortController();
|
||||
setState({ status: "loading" });
|
||||
void loadLicenseManifest(controller.signal).then(
|
||||
(manifest) => setState({ status: "ready", manifest }),
|
||||
(error: unknown) => {
|
||||
if (controller.signal.aborted) return;
|
||||
setState({
|
||||
status: "error",
|
||||
message: error instanceof Error ? error.message : "The license manifest could not load.",
|
||||
});
|
||||
},
|
||||
);
|
||||
return () => controller.abort();
|
||||
}, [requestVersion]);
|
||||
|
||||
const entries = state.status === "ready" ? state.manifest.entries : [];
|
||||
const filteredEntries = useMemo(
|
||||
() => filterThirdPartyLicenseEntries(entries, query),
|
||||
[entries, query],
|
||||
);
|
||||
const retry = useCallback(() => setRequestVersion((value) => value + 1), []);
|
||||
|
||||
return (
|
||||
<SettingsPageContainer>
|
||||
<SettingsSection
|
||||
title="Third-party notices"
|
||||
headerAction={
|
||||
state.status === "ready" ? (
|
||||
<LicenseHeaderAction
|
||||
query={query}
|
||||
onQueryChange={setQuery}
|
||||
searchOpen={searchOpen}
|
||||
onSearchOpenChange={setSearchOpen}
|
||||
filteredCount={filteredEntries.length}
|
||||
totalCount={entries.length}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
>
|
||||
{state.status === "ready" ? (
|
||||
<div className="text-base sm:text-sm">
|
||||
{filteredEntries.length > 0 ? (
|
||||
filteredEntries.map((entry) => {
|
||||
const entryKey = thirdPartyLicenseEntryKey(entry);
|
||||
return (
|
||||
<LicenseNoticeRow
|
||||
key={entryKey}
|
||||
entry={entry}
|
||||
open={openEntryKey === entryKey}
|
||||
onOpenChange={(open) => setOpenEntryKey(open ? entryKey : null)}
|
||||
/>
|
||||
);
|
||||
})
|
||||
) : (
|
||||
<p className="px-3 py-8 text-center text-sm/6 text-muted-foreground sm:px-4">
|
||||
No licenses match that search.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
) : state.status === "error" ? (
|
||||
<LicenseManifestError message={state.message} onRetry={retry} />
|
||||
) : (
|
||||
<p className="px-3 py-5 text-sm/6 text-muted-foreground sm:px-4">
|
||||
Loading open-source notices…
|
||||
</p>
|
||||
)}
|
||||
</SettingsSection>
|
||||
</SettingsPageContainer>
|
||||
);
|
||||
}
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
const SETTINGS_BREADCRUMB_LABELS: Readonly<Record<string, string>> = {
|
||||
...SETTINGS_SECTION_LABELS,
|
||||
"/settings/diagnostics": "Diagnostics",
|
||||
"/settings/open-source-licenses": "Open source licenses",
|
||||
};
|
||||
|
||||
function settingsBreadcrumbLabel(pathname: string): string | null {
|
||||
|
||||
@@ -2907,6 +2907,19 @@ export function GeneralSettingsPanel() {
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
<SettingsRow
|
||||
{...searchableSetting("open-source-licenses")}
|
||||
description="Notices for dependencies, assets, and optional tools used by T3 Code."
|
||||
control={
|
||||
<Button
|
||||
render={<Link to="/settings/open-source-licenses" />}
|
||||
size="xs"
|
||||
variant="outline"
|
||||
>
|
||||
View licenses
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</SettingsSection>
|
||||
|
||||
<LegacyFeaturesSection />
|
||||
|
||||
@@ -322,7 +322,10 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
|
||||
<SidebarMenu className="ps-px">
|
||||
{navItems.map((item) => {
|
||||
const Icon = item.icon;
|
||||
const isActive = pathname === item.to || pathname.startsWith(`${item.to}/`);
|
||||
const isGeneralDetailPage =
|
||||
item.to === "/settings/general" && pathname === "/settings/open-source-licenses";
|
||||
const isActive =
|
||||
isGeneralDetailPage || pathname === item.to || pathname.startsWith(`${item.to}/`);
|
||||
return (
|
||||
<SidebarMenuItem key={item.to}>
|
||||
<SidebarMenuButton
|
||||
|
||||
@@ -355,6 +355,11 @@ export const SETTINGS_SEARCH_ITEMS = [
|
||||
to: "/settings/general",
|
||||
searchTerms: ["logs traces processes resource history failures spans cpu memory"],
|
||||
},
|
||||
{
|
||||
id: "open-source-licenses",
|
||||
title: "Open source licenses",
|
||||
to: "/settings/general",
|
||||
},
|
||||
{
|
||||
id: "legacy-plan-mode",
|
||||
title: "Plan mode (legacy)",
|
||||
|
||||
@@ -14,18 +14,21 @@ describe("Pierre file icons", () => {
|
||||
assert.equal(resolvePierreIconForEntry("vite.config.ts", "file")?.token, "vite");
|
||||
});
|
||||
|
||||
it("extends Pierre with T3-specific exact filename icons", () => {
|
||||
assert.equal(
|
||||
resolvePierreIconForEntry("package.json", "file")?.name,
|
||||
"t3-file-icon-package-json",
|
||||
);
|
||||
it("uses built-in Pierre icons where available", () => {
|
||||
assert.equal(resolvePierreIconForEntry("package.json", "file")?.name, "file-tree-builtin-npm");
|
||||
assert.equal(
|
||||
resolvePierreIconForEntry("config/tsconfig.json", "file")?.name,
|
||||
"t3-file-icon-tsconfig",
|
||||
"file-tree-builtin-typescript",
|
||||
);
|
||||
assert.equal(resolvePierreIconForEntry("CLAUDE.md", "file")?.name, "file-tree-builtin-claude");
|
||||
assert.equal(
|
||||
resolvePierreIconForEntry("README.md", "file")?.name,
|
||||
"file-tree-builtin-markdown",
|
||||
);
|
||||
});
|
||||
|
||||
it("extends Pierre with T3-specific exact filename icons", () => {
|
||||
assert.equal(resolvePierreIconForEntry("AGENTS.md", "file")?.name, "t3-file-icon-agents");
|
||||
assert.equal(resolvePierreIconForEntry("CLAUDE.md", "file")?.name, "t3-file-icon-claude");
|
||||
assert.equal(resolvePierreIconForEntry("README.md", "file")?.name, "t3-file-icon-readme");
|
||||
assert.equal(resolvePierreIconForEntry("pnpm-lock.yaml", "file")?.name, "t3-file-icon-pnpm");
|
||||
assert.equal(
|
||||
resolvePierreIconForEntry("pnpm-workspace.yaml", "file")?.name,
|
||||
@@ -34,7 +37,9 @@ describe("Pierre file icons", () => {
|
||||
});
|
||||
|
||||
it("ships every custom icon referenced by the extended resolver", () => {
|
||||
const customIconNames = new Set(Object.values(T3_PIERRE_ICONS.byFileName));
|
||||
const customIconNames = new Set(
|
||||
Object.values(T3_PIERRE_ICONS.byFileName).filter((name) => name.startsWith("t3-")),
|
||||
);
|
||||
for (const iconName of customIconNames) {
|
||||
assert.include(T3_PIERRE_ICONS.spriteSheet, `id="${iconName}"`);
|
||||
}
|
||||
|
||||
@@ -21,24 +21,9 @@ const T3_FILE_ICON_SPRITE = `
|
||||
<path d="M7 3v18M3 7.5h4M3 12h18M3 16.5h4M17 3v18M17 7.5h4M17 16.5h4" />
|
||||
</g>
|
||||
</symbol>
|
||||
<symbol id="t3-file-icon-package-json" viewBox="0 0 32 32">
|
||||
<path d="M2 2H30V30H2" fill="#c12127" />
|
||||
<path d="M7.25 7.25h17.5v17.5h-3.5v-14H16v14H7.25" fill="#fff" />
|
||||
</symbol>
|
||||
<symbol id="t3-file-icon-tsconfig" viewBox="0 0 32 32">
|
||||
<path d="M23.827 8.243a4.424 4.424 0 0 1 2.223 1.281 5.853 5.853 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662-.034.023-.169-.124-.322-.35a2.014 2.014 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383 2.544 1.1 3.636 1.817 4.31 2.843a5.158 5.158 0 0 1 .416 4.333 4.764 4.764 0 0 1-3.932 2.815 10.9 10.9 0 0 1-2.708-.028 6.531 6.531 0 0 1-3.616-1.884 6.278 6.278 0 0 1-.926-1.371 2.655 2.655 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6.214.312a4.771 4.771 0 0 0 1.35 1.292 3.3 3.3 0 0 0 3.458-.175 1.545 1.545 0 0 0 .2-1.974c-.276-.4-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055 4.687 4.687 0 0 1-.976-1.777 7.116 7.116 0 0 1-.062-2.268 4.332 4.332 0 0 1 3.644-3.374 9 9 0 0 1 2.71.01ZM15.484 9.726l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a13.986 13.986 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z" fill="#007acc" />
|
||||
<path d="m27.075 25.107.363-.361c1.68.055 1.706 0 1.78-.177l.462-1.124.034-.107-.038-.093c-.02-.049-.081-.2-1.13-1.2v-.526c1.211-1.166 1.185-1.226 1.116-1.4l-.46-1.136c-.069-.17-.1-.237-1.763-.191l-.364-.367a8.138 8.138 0 0 0-.057-1.657l-.047-.106-1.2-.525c-.177-.081-.239-.11-1.372 1.124l-.509-.008c-1.167-1.245-1.222-1.223-1.4-1.152l-1.115.452c-.175.071-.236.1-.169 1.79l-.36.359c-1.68-.055-1.7 0-1.778.177L18.606 20l-.036.108.038.094c.02.048.078.194 1.13 1.2v.525c-1.211 1.166-1.184 1.226-1.115 1.4l.459 1.137c.07.174.1.236 1.763.192l.363.377a8.169 8.169 0 0 0 .055 1.654l.047.107 1.208.528c.176.073.236.1 1.366-1.13l.509.006c1.168 1.247 1.228 1.223 1.4 1.154l1.113-.45c.176-.075.237-.102.169-1.795Zm-4.788-2.632a2 2 0 1 1 2.618 1.14 2.023 2.023 0 0 1-2.618-1.14Z" fill="#99b8c4" />
|
||||
</symbol>
|
||||
<symbol id="t3-file-icon-agents" viewBox="0 0 32 32">
|
||||
<path fill="currentColor" d="M27.2 16c0-6.19-5.01-11.2-11.2-11.2C9.81 4.8 4.8 9.81 4.8 16S9.81 27.2 16 27.2c6.19 0 11.2-5.01 11.2-11.2Zm-5.6 2.1a1.4 1.4 0 1 1 0 2.8h-4.2a1.4 1.4 0 1 1 0-2.8Zm-11.2-6.8c.622-.373 1.42-.208 1.84.361l.079.119 2.1 3.5.088.171c.15.351.15.748 0 1.1l-.088.171-2.1 3.5a1.4 1.4 0 0 1-2.4-1.44L11.59 16l-1.67-2.78-.067-.127c-.302-.642-.075-1.42.547-1.79ZM30 16c0 7.73-6.27 14-14 14S2 23.73 2 16 8.27 2 16 2s14 6.27 14 14Z" />
|
||||
</symbol>
|
||||
<symbol id="t3-file-icon-claude" viewBox="0 0 32 32">
|
||||
<path fill="#d97757" d="m7.5 20.61 5.5-3.08.1-.27-.1-.15h-.27l-.92-.06a234.2 234.2 0 0 1-8.51-.34l-.67-.14-.62-.82.06-.41.56-.38.8.07c3.08.2 6.15.4 9.21.72h.46l.06-.19-.16-.1-.12-.12-2.74-1.86c-2.04-1.3-3.55-2.43-5.38-3.68l-.43-.54-.18-1.18.76-.84 1.03.07.26.07c2.03 1.6 4.1 3.14 6.17 4.66l.43.36.17-.12.02-.09-.2-.32c-1.43-2.6-2.55-4.62-4-6.96l-.2-.72c-.08-.3-.13-.55-.13-.85l.87-1.18.49-.16 1.16.16.49.42c1.4 3.31 2.76 5.93 4.23 8.83l.29.97.1.3h.19v-.17c.65-3.42 0-6.57 1.22-9.53l.87-.57.68.33.56.8-.08.51c-.37 2.62-.92 5.22-1.4 7.82h.24l.29-.29a68.66 68.66 0 0 1 4.91-5.94l.64-.5h1.2l.89 1.32-.4 1.36a53.45 53.45 0 0 0-4.66 6.47l.09.13.22-.02c2.4-.57 4.84-.99 7.27-1.4l.97.45.1.46-.37.94c-3 .72-6 1.34-9 2.05l-.05.04.06.07c2.7.26 5.62.3 7.99.47l.92.61.55.75-.1.56-1.4.73c-2.93-.7-5.19-1.22-7.91-1.9h-.22v.13c2.18 2.12 4.6 4.27 6.54 6.07l.15.68-.38.53-.4-.06c-2.04-1.43-3.9-3.09-5.8-4.7h-.15v.2l.52.76c1.14 1.79 2.64 3.25 2.87 5.37l-.2.41-.7.25-.78-.14a73.16 73.16 0 0 1-4.58-7.04l-.17.09-.78 8.46-.37.43-.85.33-.71-.54-.38-.87a114 114 0 0 0 1.53-7.97l.2-.73-.01-.05-.16.02a76.67 76.67 0 0 1-6.23 7.88l-.48.2-.84-.44.08-.77.47-.69c2.07-2.57 3.54-4.66 5.54-7v-.19h-.07l-7.4 4.8-1.31.17-.57-.53.07-.87.27-.28 2.23-1.53Z" />
|
||||
</symbol>
|
||||
<symbol id="t3-file-icon-readme" viewBox="0 0 32 32">
|
||||
<rect x="2.5" y="7.955" width="27" height="16.091" fill="none" stroke="#b48a5a" />
|
||||
<path fill="#b48a5a" d="M5.909 20.636v-9.272h2.727l2.728 3.409 2.727-3.409h2.727v9.272h-2.727v-5.318l-2.727 3.409-2.728-3.409v5.318H5.91Zm17.046 0-4.091-4.5h2.727v-4.772h2.727v4.772h2.727l-4.09 4.5Z" />
|
||||
</symbol>
|
||||
<symbol id="t3-file-icon-pnpm" viewBox="0 0 32 32">
|
||||
<path fill="#f9ad00" d="M30 10.75h-8.749V2H30Zm-9.626 0h-8.75V2h8.75Zm-9.625 0H2V2h8.749ZM30 20.375h-8.749v-8.75H30Z" />
|
||||
<path fill="currentColor" d="M20.374 20.375h-8.75v-8.75h8.75Zm0 9.625h-8.75v-8.75h8.75ZM30 30h-8.749v-8.75H30Zm-19.251 0H2v-8.75h8.749Z" />
|
||||
@@ -50,11 +35,9 @@ export const T3_PIERRE_ICONS = {
|
||||
colored: true,
|
||||
spriteSheet: T3_FILE_ICON_SPRITE,
|
||||
byFileName: {
|
||||
"package.json": "t3-file-icon-package-json",
|
||||
"tsconfig.json": "t3-file-icon-tsconfig",
|
||||
"package.json": "file-tree-builtin-npm",
|
||||
"tsconfig.json": "file-tree-builtin-typescript",
|
||||
"agents.md": "t3-file-icon-agents",
|
||||
"claude.md": "t3-file-icon-claude",
|
||||
"readme.md": "t3-file-icon-readme",
|
||||
"pnpm-lock.yaml": "t3-file-icon-pnpm",
|
||||
"pnpm-workspace.yaml": "t3-file-icon-pnpm",
|
||||
},
|
||||
|
||||
@@ -20,6 +20,7 @@ import { Route as SettingsSourceControlRouteImport } from './routes/settings.sou
|
||||
import { Route as SettingsSnapShotRouteImport } from './routes/settings.snap-shot'
|
||||
import { Route as SettingsProvidersRouteImport } from './routes/settings.providers'
|
||||
import { Route as SettingsProjectsRouteImport } from './routes/settings.projects'
|
||||
import { Route as SettingsOpenSourceLicensesRouteImport } from './routes/settings.open-source-licenses'
|
||||
import { Route as SettingsKeybindingsRouteImport } from './routes/settings.keybindings'
|
||||
import { Route as SettingsIntegrationsRouteImport } from './routes/settings.integrations'
|
||||
import { Route as SettingsGeneralRouteImport } from './routes/settings.general'
|
||||
@@ -87,6 +88,12 @@ const SettingsProjectsRoute = SettingsProjectsRouteImport.update({
|
||||
path: '/projects',
|
||||
getParentRoute: () => SettingsRoute,
|
||||
} as any)
|
||||
const SettingsOpenSourceLicensesRoute =
|
||||
SettingsOpenSourceLicensesRouteImport.update({
|
||||
id: '/open-source-licenses',
|
||||
path: '/open-source-licenses',
|
||||
getParentRoute: () => SettingsRoute,
|
||||
} as any)
|
||||
const SettingsKeybindingsRoute = SettingsKeybindingsRouteImport.update({
|
||||
id: '/keybindings',
|
||||
path: '/keybindings',
|
||||
@@ -166,6 +173,7 @@ export interface FileRoutesByFullPath {
|
||||
'/settings/general': typeof SettingsGeneralRoute
|
||||
'/settings/integrations': typeof SettingsIntegrationsRoute
|
||||
'/settings/keybindings': typeof SettingsKeybindingsRoute
|
||||
'/settings/open-source-licenses': typeof SettingsOpenSourceLicensesRoute
|
||||
'/settings/projects': typeof SettingsProjectsRoute
|
||||
'/settings/providers': typeof SettingsProvidersRoute
|
||||
'/settings/snap-shot': typeof SettingsSnapShotRoute
|
||||
@@ -189,6 +197,7 @@ export interface FileRoutesByTo {
|
||||
'/settings/general': typeof SettingsGeneralRoute
|
||||
'/settings/integrations': typeof SettingsIntegrationsRoute
|
||||
'/settings/keybindings': typeof SettingsKeybindingsRoute
|
||||
'/settings/open-source-licenses': typeof SettingsOpenSourceLicensesRoute
|
||||
'/settings/projects': typeof SettingsProjectsRoute
|
||||
'/settings/providers': typeof SettingsProvidersRoute
|
||||
'/settings/snap-shot': typeof SettingsSnapShotRoute
|
||||
@@ -215,6 +224,7 @@ export interface FileRoutesById {
|
||||
'/settings/general': typeof SettingsGeneralRoute
|
||||
'/settings/integrations': typeof SettingsIntegrationsRoute
|
||||
'/settings/keybindings': typeof SettingsKeybindingsRoute
|
||||
'/settings/open-source-licenses': typeof SettingsOpenSourceLicensesRoute
|
||||
'/settings/projects': typeof SettingsProjectsRoute
|
||||
'/settings/providers': typeof SettingsProvidersRoute
|
||||
'/settings/snap-shot': typeof SettingsSnapShotRoute
|
||||
@@ -242,6 +252,7 @@ export interface FileRouteTypes {
|
||||
| '/settings/general'
|
||||
| '/settings/integrations'
|
||||
| '/settings/keybindings'
|
||||
| '/settings/open-source-licenses'
|
||||
| '/settings/projects'
|
||||
| '/settings/providers'
|
||||
| '/settings/snap-shot'
|
||||
@@ -265,6 +276,7 @@ export interface FileRouteTypes {
|
||||
| '/settings/general'
|
||||
| '/settings/integrations'
|
||||
| '/settings/keybindings'
|
||||
| '/settings/open-source-licenses'
|
||||
| '/settings/projects'
|
||||
| '/settings/providers'
|
||||
| '/settings/snap-shot'
|
||||
@@ -290,6 +302,7 @@ export interface FileRouteTypes {
|
||||
| '/settings/general'
|
||||
| '/settings/integrations'
|
||||
| '/settings/keybindings'
|
||||
| '/settings/open-source-licenses'
|
||||
| '/settings/projects'
|
||||
| '/settings/providers'
|
||||
| '/settings/snap-shot'
|
||||
@@ -389,6 +402,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof SettingsProjectsRouteImport
|
||||
parentRoute: typeof SettingsRoute
|
||||
}
|
||||
'/settings/open-source-licenses': {
|
||||
id: '/settings/open-source-licenses'
|
||||
path: '/open-source-licenses'
|
||||
fullPath: '/settings/open-source-licenses'
|
||||
preLoaderRoute: typeof SettingsOpenSourceLicensesRouteImport
|
||||
parentRoute: typeof SettingsRoute
|
||||
}
|
||||
'/settings/keybindings': {
|
||||
id: '/settings/keybindings'
|
||||
path: '/keybindings'
|
||||
@@ -500,6 +520,7 @@ interface SettingsRouteChildren {
|
||||
SettingsGeneralRoute: typeof SettingsGeneralRoute
|
||||
SettingsIntegrationsRoute: typeof SettingsIntegrationsRoute
|
||||
SettingsKeybindingsRoute: typeof SettingsKeybindingsRoute
|
||||
SettingsOpenSourceLicensesRoute: typeof SettingsOpenSourceLicensesRoute
|
||||
SettingsProjectsRoute: typeof SettingsProjectsRoute
|
||||
SettingsProvidersRoute: typeof SettingsProvidersRoute
|
||||
SettingsSnapShotRoute: typeof SettingsSnapShotRoute
|
||||
@@ -514,6 +535,7 @@ const SettingsRouteChildren: SettingsRouteChildren = {
|
||||
SettingsGeneralRoute: SettingsGeneralRoute,
|
||||
SettingsIntegrationsRoute: SettingsIntegrationsRoute,
|
||||
SettingsKeybindingsRoute: SettingsKeybindingsRoute,
|
||||
SettingsOpenSourceLicensesRoute: SettingsOpenSourceLicensesRoute,
|
||||
SettingsProjectsRoute: SettingsProjectsRoute,
|
||||
SettingsProvidersRoute: SettingsProvidersRoute,
|
||||
SettingsSnapShotRoute: SettingsSnapShotRoute,
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
import { OpenSourceLicensesPanel } from "../components/settings/OpenSourceLicenses";
|
||||
|
||||
export const Route = createFileRoute("/settings/open-source-licenses")({
|
||||
component: OpenSourceLicensesPanel,
|
||||
});
|
||||
@@ -32,6 +32,7 @@
|
||||
"vercel.ts",
|
||||
"test",
|
||||
"scripts/warm-dep-cache.ts",
|
||||
"../../scripts/lib/public-config.ts"
|
||||
"../../scripts/lib/public-config.ts",
|
||||
"../../scripts/lib/third-party-licenses.ts"
|
||||
]
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import pkg from "./package.json" with { type: "json" };
|
||||
import { DEV_PROXIED_PATH_PREFIXES } from "@t3tools/shared/devProxy";
|
||||
|
||||
import { loadRepoEnv } from "../../scripts/lib/public-config";
|
||||
import { thirdPartyLicensesPlugin } from "../../scripts/lib/third-party-licenses";
|
||||
import { tailwindPlugins } from "./vite/tailwind";
|
||||
|
||||
const repoEnv = loadRepoEnv();
|
||||
@@ -157,6 +158,15 @@ export default defineConfig(() => {
|
||||
assetsInclude: ["**/*.wasm"],
|
||||
plugins: [
|
||||
devCompressionPlugin(),
|
||||
thirdPartyLicensesPlugin({
|
||||
bundleName: "web",
|
||||
configFile: new URL("../../third-party-licenses.config.json", import.meta.url),
|
||||
packageManifests: [
|
||||
{ bundle: "web", path: new URL("./package.json", import.meta.url) },
|
||||
{ bundle: "server", path: new URL("../server/package.json", import.meta.url) },
|
||||
{ bundle: "desktop", path: new URL("../desktop/package.json", import.meta.url) },
|
||||
],
|
||||
}),
|
||||
// Route components load as split chunks so settings, pull-request, and
|
||||
// usage code stay out of the cold-start payload; the router prefetches
|
||||
// them on navigation intent (see getRouter's defaultPreload).
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
# Open source license notices
|
||||
|
||||
License notices are generated independently for the client that ships them:
|
||||
|
||||
- The web build emits `third-party-licenses.json` beside `index.html`. The Settings page loads that
|
||||
static file, so the same artifact works in hosted web, the client bundled with `npx t3`, and
|
||||
desktop.
|
||||
- The mobile Metro config generates an ignored virtual module before each development, native, or
|
||||
over-the-air JavaScript bundle. Mobile loads and decodes that module only when a license screen
|
||||
opens, so the notice text does not occupy memory during ordinary app startup. It does not need a
|
||||
network request.
|
||||
|
||||
Neither path depends on the connected environment or an RPC.
|
||||
|
||||
## What the build collects
|
||||
|
||||
The generator follows installed production and optional dependencies, including dependencies of
|
||||
workspace packages, and omits first-party `@t3tools/*` packages. The web manifest starts from the
|
||||
web, server, and desktop package manifests. The mobile manifest starts from the mobile package
|
||||
manifest. During the web bundle, the generator also checks emitted module ids to catch a bundled
|
||||
npm import missing from a package manifest.
|
||||
|
||||
The mobile manifest deliberately follows the complete production dependency closure declared by
|
||||
Expo and React Native. That is conservative and can include build tooling that is not present in
|
||||
the final JavaScript bundle, but it avoids dropping a notice when platform bundling changes.
|
||||
|
||||
The build fails when a collected package has no distributable license identifier or contains no
|
||||
license or notice text. Generated notices use license templates from the pinned SPDX License List.
|
||||
Strict web and EAS builds download a missing template into the gitignored `.generated/` cache;
|
||||
`pnpm licenses:sync` can warm that cache explicitly. Local web and Metro development do not make a
|
||||
network request and omit generated rows until the cache exists. This keeps dev startup optional
|
||||
while preventing incomplete release artifacts.
|
||||
|
||||
## Custom notices and package overrides
|
||||
|
||||
The repository-level `third-party-licenses.config.json` holds manually maintained exceptions for
|
||||
all clients. Add an entry to `customNotices` for adapted icons, fonts, media, native modules, or
|
||||
another asset that did not come from an npm package:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "asset-name",
|
||||
"license": "CC-BY-4.0",
|
||||
"generatedNotices": [
|
||||
{
|
||||
"licenseId": "CC-BY-4.0",
|
||||
"preamble": ["Asset by Example Author. Changes: converted to MP3."]
|
||||
}
|
||||
],
|
||||
"sourceUrl": "https://example.com/source",
|
||||
"bundles": ["assets", "web"]
|
||||
}
|
||||
```
|
||||
|
||||
Each `generatedNotices` item names an SPDX license template and can add `copyrights` or a short
|
||||
`preamble` for attribution and provenance. Multiple items are joined into one row for software
|
||||
that vendors separately licensed code. Keep `noticeFile` or `noticeFiles` only when a vendored
|
||||
source tree already carries an intrinsic license file that should remain beside it. Paths are
|
||||
relative to the config file. `bundles` controls which generated manifests include the entry and
|
||||
supplies the label shown to users. Use `includeInBundles` when those differ, such as an optional
|
||||
server tool that should appear in both client manifests but is not bundled into either client.
|
||||
|
||||
Use `packageOverrides` only when an installed npm archive omits its notice or has incorrect
|
||||
metadata:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "package-name",
|
||||
"version": "1.2.3",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2026 Example Author"]
|
||||
},
|
||||
"license": "MIT",
|
||||
"sourceUrl": "https://example.com/package-name"
|
||||
}
|
||||
```
|
||||
|
||||
`version`, `license`, and `sourceUrl` are optional. Omitting `version` applies the override to every
|
||||
installed version of that package. An override can use `repositoryUrl` instead of `name` when
|
||||
several packages from one monorepo share the same notice:
|
||||
|
||||
```json
|
||||
{
|
||||
"repositoryUrl": "https://github.com/example/project",
|
||||
"generatedNotice": {
|
||||
"licenseId": "Apache-2.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The generator also reuses an installed sibling package's notice when both packages declare the
|
||||
same normalized repository and license. A name-and-version override always wins over these
|
||||
repository fallbacks.
|
||||
|
||||
The `@react-grab/cli` override uses the root React Grab repository's MIT license because the CLI's
|
||||
npm archive omits both its license field and license file. Keep the override until the published
|
||||
CLI package carries that metadata itself.
|
||||
|
||||
Generated mobile files live under `apps/mobile/.generated/`, while fetched SPDX templates live
|
||||
under the repository `.generated/` directory. Both are ignored. Do not commit or edit them;
|
||||
updating dependencies or configuration is enough for the next strict build to refresh the output.
|
||||
@@ -0,0 +1,13 @@
|
||||
# Open source licenses
|
||||
|
||||
T3 Code includes third-party software and adapted assets. To read their license and attribution
|
||||
notices:
|
||||
|
||||
- On web and desktop, open **Settings → General**, find **Open source licenses** under **About**,
|
||||
and select **View licenses**.
|
||||
- On mobile, open **Settings → App → Open source licenses**.
|
||||
|
||||
The page lists the version when available, license identifier, and the parts of T3 Code that include
|
||||
or use the item. This also covers optional device tools that T3 Code installs on demand instead of
|
||||
bundling. Select a row to read the complete notice text. Use the search field to find a package,
|
||||
version, license, or app component.
|
||||
@@ -18,6 +18,7 @@
|
||||
"screenshots:mobile": "node scripts/mobile-showcase.ts",
|
||||
"icons:export": "node scripts/export-brand-icons.ts",
|
||||
"icons:check": "node scripts/export-brand-icons.ts --check",
|
||||
"licenses:sync": "node scripts/sync-third-party-license-notices.ts",
|
||||
"icons:export:android": "node scripts/export-android-icons.ts",
|
||||
"build": "vp run --filter './apps/*' build",
|
||||
"build:marketing": "vp run --filter @t3tools/marketing build",
|
||||
|
||||
@@ -275,6 +275,10 @@
|
||||
"types": "./src/desktopAppControl.ts",
|
||||
"import": "./src/desktopAppControl.ts"
|
||||
},
|
||||
"./thirdPartyLicenses": {
|
||||
"types": "./src/thirdPartyLicenses.ts",
|
||||
"import": "./src/thirdPartyLicenses.ts"
|
||||
},
|
||||
"./claudeCompaction": {
|
||||
"types": "./src/claudeCompaction.ts",
|
||||
"import": "./src/claudeCompaction.ts"
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
import { describe, expect, it } from "vite-plus/test";
|
||||
|
||||
import {
|
||||
decodeThirdPartyLicenseManifest,
|
||||
filterThirdPartyLicenseEntries,
|
||||
findThirdPartyLicenseEntry,
|
||||
formatLicenseBundles,
|
||||
thirdPartyLicenseEntryKey,
|
||||
type ThirdPartyLicenseEntry,
|
||||
} from "./thirdPartyLicenses.js";
|
||||
|
||||
const ENTRIES: ReadonlyArray<ThirdPartyLicenseEntry> = [
|
||||
{
|
||||
bundles: ["web"],
|
||||
kind: "package",
|
||||
license: "MIT",
|
||||
name: "react",
|
||||
noticeText: "React license",
|
||||
sourceUrl: "https://react.dev",
|
||||
version: "19.2.6",
|
||||
},
|
||||
{
|
||||
bundles: ["assets", "mobile"],
|
||||
kind: "custom",
|
||||
license: "CC-BY-4.0",
|
||||
name: "sample-icons",
|
||||
noticeText: "Icon notice",
|
||||
sourceUrl: null,
|
||||
version: null,
|
||||
},
|
||||
];
|
||||
|
||||
describe("third-party license manifests", () => {
|
||||
it("decodes the generated manifest shape", () => {
|
||||
expect(decodeThirdPartyLicenseManifest({ schemaVersion: 1, entries: ENTRIES })).toEqual({
|
||||
schemaVersion: 1,
|
||||
entries: ENTRIES,
|
||||
});
|
||||
});
|
||||
|
||||
it("rejects unsupported manifest versions", () => {
|
||||
expect(() => decodeThirdPartyLicenseManifest({ schemaVersion: 2, entries: [] })).toThrow(
|
||||
"unsupported format",
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects unsafe source links", () => {
|
||||
expect(() =>
|
||||
decodeThirdPartyLicenseManifest({
|
||||
schemaVersion: 1,
|
||||
entries: [{ ...ENTRIES[0]!, sourceUrl: "javascript:alert(1)" }],
|
||||
}),
|
||||
).toThrow("invalid shape");
|
||||
});
|
||||
|
||||
it("rejects duplicate navigation keys", () => {
|
||||
expect(() =>
|
||||
decodeThirdPartyLicenseManifest({ schemaVersion: 1, entries: [ENTRIES[0]!, ENTRIES[0]!] }),
|
||||
).toThrow("duplicate entry");
|
||||
});
|
||||
|
||||
it("filters by package, license, version, and bundle", () => {
|
||||
expect(filterThirdPartyLicenseEntries(ENTRIES, "react 19.2")).toEqual([ENTRIES[0]]);
|
||||
expect(filterThirdPartyLicenseEntries(ENTRIES, "cc-by mobile")).toEqual([ENTRIES[1]]);
|
||||
expect(filterThirdPartyLicenseEntries(ENTRIES, "apache")).toEqual([]);
|
||||
});
|
||||
|
||||
it("formats platform bundle names for display", () => {
|
||||
expect(
|
||||
formatLicenseBundles(["android", "assets", "ios", "mobile", "plugin", "constructor"]),
|
||||
).toBe("Android, Assets, iOS, Mobile, plugin, constructor");
|
||||
});
|
||||
|
||||
it("finds an entry by its stable navigation key", () => {
|
||||
const entry = ENTRIES[0]!;
|
||||
expect(findThirdPartyLicenseEntry(ENTRIES, thirdPartyLicenseEntryKey(entry))).toBe(entry);
|
||||
});
|
||||
|
||||
it("uses path-safe navigation keys for scoped packages", () => {
|
||||
expect(thirdPartyLicenseEntryKey({ ...ENTRIES[0]!, name: "@scope/package" })).not.toContain(
|
||||
"/",
|
||||
);
|
||||
});
|
||||
|
||||
it("uses distinct navigation keys when names and versions contain delimiters", () => {
|
||||
const first = thirdPartyLicenseEntryKey({ ...ENTRIES[0]!, name: "a:1", version: null });
|
||||
const second = thirdPartyLicenseEntryKey({ ...ENTRIES[0]!, name: "a", version: "1:custom" });
|
||||
|
||||
expect(first).not.toBe(second);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,127 @@
|
||||
export interface ThirdPartyLicenseEntry {
|
||||
readonly bundles: ReadonlyArray<string>;
|
||||
readonly kind: "custom" | "package";
|
||||
readonly license: string;
|
||||
readonly name: string;
|
||||
readonly noticeText: string;
|
||||
readonly sourceUrl: string | null;
|
||||
readonly version: string | null;
|
||||
}
|
||||
|
||||
export interface ThirdPartyLicenseManifest {
|
||||
readonly schemaVersion: 1;
|
||||
readonly entries: ReadonlyArray<ThirdPartyLicenseEntry>;
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
}
|
||||
|
||||
function isStringArray(value: unknown): value is ReadonlyArray<string> {
|
||||
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
||||
}
|
||||
|
||||
function isHttpUrl(value: unknown): value is string {
|
||||
if (typeof value !== "string") return false;
|
||||
try {
|
||||
const protocol = new URL(value).protocol;
|
||||
return protocol === "http:" || protocol === "https:";
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function decodeEntry(value: unknown, index: number): ThirdPartyLicenseEntry {
|
||||
if (!isRecord(value)) {
|
||||
throw new Error(`License entry ${String(index + 1)} is not an object.`);
|
||||
}
|
||||
if (
|
||||
!isStringArray(value.bundles) ||
|
||||
value.bundles.length === 0 ||
|
||||
(value.kind !== "custom" && value.kind !== "package") ||
|
||||
typeof value.license !== "string" ||
|
||||
typeof value.name !== "string" ||
|
||||
typeof value.noticeText !== "string" ||
|
||||
(value.sourceUrl !== null && !isHttpUrl(value.sourceUrl)) ||
|
||||
(value.version !== null && typeof value.version !== "string")
|
||||
) {
|
||||
throw new Error(`License entry ${String(index + 1)} has an invalid shape.`);
|
||||
}
|
||||
return {
|
||||
bundles: value.bundles,
|
||||
kind: value.kind,
|
||||
license: value.license,
|
||||
name: value.name,
|
||||
noticeText: value.noticeText,
|
||||
sourceUrl: value.sourceUrl,
|
||||
version: value.version,
|
||||
};
|
||||
}
|
||||
|
||||
export function decodeThirdPartyLicenseManifest(value: unknown): ThirdPartyLicenseManifest {
|
||||
if (!isRecord(value) || value.schemaVersion !== 1 || !Array.isArray(value.entries)) {
|
||||
throw new Error("The open-source license manifest has an unsupported format.");
|
||||
}
|
||||
const entries = value.entries.map(decodeEntry);
|
||||
const entryKeys = new Set<string>();
|
||||
for (const entry of entries) {
|
||||
const key = thirdPartyLicenseEntryKey(entry);
|
||||
if (entryKeys.has(key)) {
|
||||
throw new Error(`The open-source license manifest contains a duplicate entry: ${key}`);
|
||||
}
|
||||
entryKeys.add(key);
|
||||
}
|
||||
return {
|
||||
schemaVersion: 1,
|
||||
entries,
|
||||
};
|
||||
}
|
||||
|
||||
export function filterThirdPartyLicenseEntries(
|
||||
entries: ReadonlyArray<ThirdPartyLicenseEntry>,
|
||||
query: string,
|
||||
): ReadonlyArray<ThirdPartyLicenseEntry> {
|
||||
const terms = query
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.split(/\s+/)
|
||||
.filter((term) => term.length > 0);
|
||||
if (terms.length === 0) return entries;
|
||||
return entries.filter((entry) => {
|
||||
const searchable = [entry.name, entry.version, entry.license, ...entry.bundles]
|
||||
.filter((value): value is string => value !== null)
|
||||
.join(" ")
|
||||
.toLowerCase();
|
||||
return terms.every((term) => searchable.includes(term));
|
||||
});
|
||||
}
|
||||
|
||||
const BUNDLE_LABELS: Readonly<Record<string, string>> = {
|
||||
android: "Android",
|
||||
assets: "Assets",
|
||||
desktop: "Desktop",
|
||||
"device-tools": "Device tools",
|
||||
ios: "iOS",
|
||||
mobile: "Mobile",
|
||||
server: "Server",
|
||||
web: "Web",
|
||||
};
|
||||
|
||||
export function formatLicenseBundles(bundles: ReadonlyArray<string>): string {
|
||||
return bundles
|
||||
.map((bundle) =>
|
||||
Object.prototype.hasOwnProperty.call(BUNDLE_LABELS, bundle) ? BUNDLE_LABELS[bundle] : bundle,
|
||||
)
|
||||
.join(", ");
|
||||
}
|
||||
|
||||
export function thirdPartyLicenseEntryKey(entry: ThirdPartyLicenseEntry): string {
|
||||
return encodeURIComponent(JSON.stringify([entry.kind, entry.name, entry.version]));
|
||||
}
|
||||
|
||||
export function findThirdPartyLicenseEntry(
|
||||
entries: ReadonlyArray<ThirdPartyLicenseEntry>,
|
||||
key: string,
|
||||
): ThirdPartyLicenseEntry | undefined {
|
||||
return entries.find((entry) => thirdPartyLicenseEntryKey(entry) === key);
|
||||
}
|
||||
@@ -0,0 +1,504 @@
|
||||
// @effect-diagnostics nodeBuiltinImport:off - Tests exercise the Node filesystem build boundary.
|
||||
|
||||
import * as NodeFSP from "node:fs/promises";
|
||||
import * as NodeOS from "node:os";
|
||||
import * as NodePath from "node:path";
|
||||
import * as NodeURL from "node:url";
|
||||
|
||||
import { afterEach, describe, expect, it } from "vite-plus/test";
|
||||
|
||||
import {
|
||||
generateThirdPartyLicenseManifest,
|
||||
THIRD_PARTY_LICENSES_FILE_NAME,
|
||||
thirdPartyLicensesPlugin,
|
||||
} from "./third-party-licenses.js";
|
||||
|
||||
const tempDirectories: string[] = [];
|
||||
const REPOSITORY_ROOT = NodePath.resolve(
|
||||
NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)),
|
||||
"../..",
|
||||
);
|
||||
|
||||
async function writeJson(path: string, value: unknown): Promise<void> {
|
||||
await NodeFSP.mkdir(NodePath.dirname(path), { recursive: true });
|
||||
await NodeFSP.writeFile(path, `${JSON.stringify(value)}\n`, "utf8");
|
||||
}
|
||||
|
||||
async function createFixture(): Promise<{
|
||||
readonly appManifest: string;
|
||||
readonly configFile: string;
|
||||
readonly dependencyRoot: string;
|
||||
readonly root: string;
|
||||
}> {
|
||||
const root = await NodeFSP.mkdtemp(NodePath.join(NodeOS.tmpdir(), "t3code-licenses-"));
|
||||
tempDirectories.push(root);
|
||||
const appManifest = NodePath.join(root, "package.json");
|
||||
const dependencyRoot = NodePath.join(root, "node_modules", "demo-dependency");
|
||||
const configFile = NodePath.join(root, "third-party-licenses.config.json");
|
||||
|
||||
await writeJson(appManifest, {
|
||||
name: "fixture-app",
|
||||
dependencies: { "demo-dependency": "1.2.3" },
|
||||
});
|
||||
await writeJson(NodePath.join(dependencyRoot, "package.json"), {
|
||||
name: "demo-dependency",
|
||||
version: "1.2.3",
|
||||
license: "MIT",
|
||||
main: "index.js",
|
||||
repository: "example/demo-dependency",
|
||||
});
|
||||
await NodeFSP.writeFile(NodePath.join(dependencyRoot, "index.js"), "export {};\n", "utf8");
|
||||
await NodeFSP.writeFile(
|
||||
NodePath.join(dependencyRoot, "LICENSE"),
|
||||
"Demo MIT license text\n",
|
||||
"utf8",
|
||||
);
|
||||
await NodeFSP.writeFile(NodePath.join(root, "asset-notice.txt"), "Asset notice text\n", "utf8");
|
||||
await writeJson(configFile, {
|
||||
customNotices: [
|
||||
{
|
||||
name: "demo-asset",
|
||||
license: "CC-BY-4.0",
|
||||
noticeFile: "asset-notice.txt",
|
||||
bundles: ["assets", "web"],
|
||||
},
|
||||
],
|
||||
packageOverrides: [],
|
||||
});
|
||||
return { appManifest, configFile, dependencyRoot, root };
|
||||
}
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all(
|
||||
tempDirectories
|
||||
.splice(0)
|
||||
.map((directory) => NodeFSP.rm(directory, { force: true, recursive: true })),
|
||||
);
|
||||
});
|
||||
|
||||
describe("third-party license generation", () => {
|
||||
it("keeps the GhosttyKit notice pinned to the vendored framework revision", async () => {
|
||||
const [config, revision] = await Promise.all([
|
||||
NodeFSP.readFile(NodePath.join(REPOSITORY_ROOT, "third-party-licenses.config.json"), "utf8"),
|
||||
NodeFSP.readFile(
|
||||
NodePath.join(REPOSITORY_ROOT, "apps/mobile/modules/t3-terminal/Vendor/libghostty/VERSION"),
|
||||
"utf8",
|
||||
),
|
||||
]);
|
||||
|
||||
expect(config).toContain(revision.trim());
|
||||
expect(config).toContain(
|
||||
"https://github.com/Yash-Singh1/ghostty/tree/t3code/custom-io-ordered-feed",
|
||||
);
|
||||
});
|
||||
|
||||
it("collects production packages and custom asset notices", async () => {
|
||||
const fixture = await createFixture();
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest).toEqual({
|
||||
schemaVersion: 1,
|
||||
entries: [
|
||||
{
|
||||
bundles: ["assets", "web"],
|
||||
kind: "custom",
|
||||
license: "CC-BY-4.0",
|
||||
name: "demo-asset",
|
||||
noticeText: "Asset notice text",
|
||||
sourceUrl: null,
|
||||
version: null,
|
||||
},
|
||||
{
|
||||
bundles: ["web"],
|
||||
kind: "package",
|
||||
license: "MIT",
|
||||
name: "demo-dependency",
|
||||
noticeText: "Demo MIT license text",
|
||||
sourceUrl: "https://github.com/example/demo-dependency",
|
||||
version: "1.2.3",
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("renders generated notices from the ignored SPDX cache", async () => {
|
||||
const fixture = await createFixture();
|
||||
await writeJson(
|
||||
NodePath.join(fixture.root, ".generated/third-party-licenses/spdx/v3.28.0/MIT.json"),
|
||||
{
|
||||
licenseId: "MIT",
|
||||
licenseText: "MIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission text",
|
||||
},
|
||||
);
|
||||
await writeJson(fixture.configFile, {
|
||||
customNotices: [
|
||||
{
|
||||
name: "generated-asset",
|
||||
license: "MIT",
|
||||
generatedNotices: [
|
||||
{
|
||||
licenseId: "MIT",
|
||||
copyrights: ["Copyright (c) 2026 Example Author"],
|
||||
preamble: ["Adapted for T3 Code."],
|
||||
},
|
||||
],
|
||||
bundles: ["assets", "web"],
|
||||
},
|
||||
],
|
||||
packageOverrides: [],
|
||||
});
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest.entries.find((entry) => entry.name === "generated-asset")?.noticeText).toBe(
|
||||
"Adapted for T3 Code.\n\nMIT License\n\nCopyright (c) 2026 Example Author\n\nPermission text",
|
||||
);
|
||||
});
|
||||
|
||||
it("omits generated rows without a cache during optional development", async () => {
|
||||
const fixture = await createFixture();
|
||||
await writeJson(fixture.configFile, {
|
||||
customNotices: [
|
||||
{
|
||||
name: "generated-asset",
|
||||
license: "MIT",
|
||||
generatedNotices: [{ licenseId: "MIT" }],
|
||||
bundles: ["assets", "web"],
|
||||
},
|
||||
],
|
||||
packageOverrides: [],
|
||||
});
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
allowMissingGeneratedNotices: true,
|
||||
});
|
||||
|
||||
expect(manifest.entries.some((entry) => entry.name === "generated-asset")).toBe(false);
|
||||
});
|
||||
|
||||
it("finds packages whose exports hide both their manifest and entry point", async () => {
|
||||
const fixture = await createFixture();
|
||||
await writeJson(NodePath.join(fixture.dependencyRoot, "package.json"), {
|
||||
name: "demo-dependency",
|
||||
version: "1.2.3",
|
||||
license: "MIT",
|
||||
exports: {},
|
||||
repository: "example/demo-dependency",
|
||||
});
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest.entries.some((entry) => entry.name === "demo-dependency")).toBe(true);
|
||||
});
|
||||
|
||||
it("includes custom notices selected by the dev server bundle", async () => {
|
||||
const fixture = await createFixture();
|
||||
await writeJson(fixture.configFile, {
|
||||
customNotices: [
|
||||
{
|
||||
name: "desktop-only-asset",
|
||||
license: "CC-BY-4.0",
|
||||
noticeFile: "asset-notice.txt",
|
||||
bundles: ["assets"],
|
||||
includeInBundles: ["desktop"],
|
||||
},
|
||||
],
|
||||
packageOverrides: [],
|
||||
});
|
||||
|
||||
const plugin = thirdPartyLicensesPlugin({
|
||||
bundleName: "desktop",
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
});
|
||||
let middleware:
|
||||
| ((
|
||||
request: { readonly url: string },
|
||||
response: {
|
||||
statusCode: number;
|
||||
setHeader(name: string, value: string): void;
|
||||
end(body: string): void;
|
||||
},
|
||||
next: (error?: Error) => void,
|
||||
) => void)
|
||||
| undefined;
|
||||
if (typeof plugin.configureServer !== "function") {
|
||||
throw new Error("Expected the license plugin to define a configureServer hook.");
|
||||
}
|
||||
plugin.configureServer.call(
|
||||
{} as never,
|
||||
{
|
||||
middlewares: {
|
||||
use(handler: typeof middleware) {
|
||||
middleware = handler;
|
||||
},
|
||||
},
|
||||
} as never,
|
||||
);
|
||||
if (!middleware) throw new Error("Expected the license plugin to register middleware.");
|
||||
|
||||
const responseBody = await new Promise<string>((resolve, reject) => {
|
||||
middleware!(
|
||||
{ url: `/${THIRD_PARTY_LICENSES_FILE_NAME}` },
|
||||
{
|
||||
statusCode: 0,
|
||||
setHeader() {},
|
||||
end: resolve,
|
||||
},
|
||||
(error) => reject(error ?? new Error("License middleware skipped the request.")),
|
||||
);
|
||||
});
|
||||
const manifest = JSON.parse(responseBody) as { entries: ReadonlyArray<{ name: string }> };
|
||||
|
||||
expect(manifest.entries.some((entry) => entry.name === "desktop-only-asset")).toBe(true);
|
||||
});
|
||||
|
||||
it("fails when a production package has no distributable notice text", async () => {
|
||||
const fixture = await createFixture();
|
||||
await NodeFSP.rm(NodePath.join(fixture.dependencyRoot, "LICENSE"));
|
||||
|
||||
await expect(
|
||||
generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
}),
|
||||
).rejects.toThrow("does not include a license or notice file");
|
||||
});
|
||||
|
||||
it("collects nested notices even when a package also has a root license", async () => {
|
||||
const fixture = await createFixture();
|
||||
await NodeFSP.mkdir(NodePath.join(fixture.dependencyRoot, "dist", "third-party"), {
|
||||
recursive: true,
|
||||
});
|
||||
await NodeFSP.mkdir(NodePath.join(fixture.dependencyRoot, "lib"), { recursive: true });
|
||||
await NodeFSP.writeFile(
|
||||
NodePath.join(fixture.dependencyRoot, "dist", "third-party", "NOTICE.txt"),
|
||||
"Nested notice\n",
|
||||
"utf8",
|
||||
);
|
||||
await NodeFSP.writeFile(
|
||||
NodePath.join(fixture.dependencyRoot, "lib", "license_header.js"),
|
||||
"require('not-a-license');\n",
|
||||
"utf8",
|
||||
);
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest.entries.find((entry) => entry.name === "demo-dependency")?.noticeText).toBe(
|
||||
"dist/third-party/NOTICE.txt\n\nNested notice\n\n---\n\nLICENSE\n\nDemo MIT license text",
|
||||
);
|
||||
});
|
||||
|
||||
it("uses package overrides for notices published outside the npm archive", async () => {
|
||||
const fixture = await createFixture();
|
||||
await NodeFSP.rm(NodePath.join(fixture.dependencyRoot, "LICENSE"));
|
||||
await NodeFSP.writeFile(NodePath.join(fixture.root, "override.txt"), "Override text\n", "utf8");
|
||||
await writeJson(fixture.configFile, {
|
||||
customNotices: [],
|
||||
packageOverrides: [
|
||||
{
|
||||
name: "demo-dependency",
|
||||
noticeFile: "override.txt",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest.entries[0]?.noticeText).toBe("Override text");
|
||||
});
|
||||
|
||||
it("applies repository overrides across monorepo packages", async () => {
|
||||
const fixture = await createFixture();
|
||||
await NodeFSP.rm(NodePath.join(fixture.dependencyRoot, "LICENSE"));
|
||||
await NodeFSP.writeFile(
|
||||
NodePath.join(fixture.root, "override.txt"),
|
||||
"Repository text\n",
|
||||
"utf8",
|
||||
);
|
||||
await writeJson(fixture.configFile, {
|
||||
customNotices: [],
|
||||
packageOverrides: [
|
||||
{
|
||||
repositoryUrl: "https://github.com/example/demo-dependency",
|
||||
noticeFile: "override.txt",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest.entries[0]?.noticeText).toBe("Repository text");
|
||||
});
|
||||
|
||||
it("reuses a repository license for packages from the same monorepo", async () => {
|
||||
const fixture = await createFixture();
|
||||
const siblingRoot = NodePath.join(fixture.root, "node_modules", "demo-sibling");
|
||||
await writeJson(fixture.appManifest, {
|
||||
name: "fixture-app",
|
||||
dependencies: { "demo-dependency": "1.2.3", "demo-sibling": "2.0.0" },
|
||||
});
|
||||
await writeJson(NodePath.join(siblingRoot, "package.json"), {
|
||||
name: "demo-sibling",
|
||||
version: "2.0.0",
|
||||
license: "MIT",
|
||||
main: "index.js",
|
||||
repository: "https://github.com/example/demo-dependency.git#main",
|
||||
});
|
||||
await NodeFSP.writeFile(NodePath.join(siblingRoot, "index.js"), "export {};\n", "utf8");
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest.entries.find((entry) => entry.name === "demo-sibling")?.noticeText).toBe(
|
||||
"Demo MIT license text",
|
||||
);
|
||||
});
|
||||
|
||||
it("prefers version-specific repository overrides", async () => {
|
||||
const fixture = await createFixture();
|
||||
await NodeFSP.writeFile(NodePath.join(fixture.root, "generic.txt"), "Generic text\n", "utf8");
|
||||
await NodeFSP.writeFile(NodePath.join(fixture.root, "exact.txt"), "Exact text\n", "utf8");
|
||||
await writeJson(fixture.configFile, {
|
||||
customNotices: [],
|
||||
packageOverrides: [
|
||||
{
|
||||
repositoryUrl: "https://github.com/example/demo-dependency",
|
||||
noticeFile: "generic.txt",
|
||||
},
|
||||
{
|
||||
repositoryUrl: "https://github.com/example/demo-dependency",
|
||||
version: "1.2.3",
|
||||
noticeFile: "exact.txt",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest.entries[0]?.noticeText).toBe("Exact text");
|
||||
});
|
||||
|
||||
it("omits custom notices for other bundles", async () => {
|
||||
const fixture = await createFixture();
|
||||
await writeJson(fixture.configFile, {
|
||||
customNotices: [
|
||||
{
|
||||
name: "web-only-asset",
|
||||
license: "MIT",
|
||||
noticeFile: "asset-notice.txt",
|
||||
bundles: ["assets", "web"],
|
||||
},
|
||||
],
|
||||
packageOverrides: [],
|
||||
});
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "mobile", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest.entries.some((entry) => entry.name === "web-only-asset")).toBe(false);
|
||||
});
|
||||
|
||||
it("can show a multi-file notice under a label that differs from its client manifests", async () => {
|
||||
const fixture = await createFixture();
|
||||
await NodeFSP.writeFile(
|
||||
NodePath.join(fixture.root, "tool-license.txt"),
|
||||
"Tool license\n",
|
||||
"utf8",
|
||||
);
|
||||
await NodeFSP.writeFile(
|
||||
NodePath.join(fixture.root, "vendor-notice.txt"),
|
||||
"Vendor notice\n",
|
||||
"utf8",
|
||||
);
|
||||
await writeJson(fixture.configFile, {
|
||||
customNotices: [
|
||||
{
|
||||
name: "optional-tool",
|
||||
license: "MIT AND Apache-2.0",
|
||||
noticeFiles: ["tool-license.txt", "vendor-notice.txt"],
|
||||
bundles: ["device-tools"],
|
||||
includeInBundles: ["mobile", "web"],
|
||||
},
|
||||
],
|
||||
packageOverrides: [],
|
||||
});
|
||||
|
||||
const manifest = await generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "mobile", path: fixture.appManifest }],
|
||||
});
|
||||
|
||||
expect(manifest.entries.find((entry) => entry.name === "optional-tool")).toMatchObject({
|
||||
bundles: ["device-tools"],
|
||||
noticeText: "Tool license\n\n---\n\nVendor notice",
|
||||
});
|
||||
});
|
||||
|
||||
it("fails when a custom notice file is empty", async () => {
|
||||
const fixture = await createFixture();
|
||||
await NodeFSP.writeFile(NodePath.join(fixture.root, "asset-notice.txt"), "\n", "utf8");
|
||||
|
||||
await expect(
|
||||
generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
}),
|
||||
).rejects.toThrow('Custom third-party notice "demo-asset" is empty');
|
||||
});
|
||||
|
||||
it("fails generation when custom notices produce duplicate navigation keys", async () => {
|
||||
const fixture = await createFixture();
|
||||
await writeJson(fixture.configFile, {
|
||||
customNotices: [
|
||||
{
|
||||
name: "duplicate-asset",
|
||||
license: "MIT",
|
||||
noticeFile: "asset-notice.txt",
|
||||
bundles: ["assets", "web"],
|
||||
},
|
||||
{
|
||||
name: "duplicate-asset",
|
||||
license: "CC0-1.0",
|
||||
noticeFile: "asset-notice.txt",
|
||||
bundles: ["assets", "web"],
|
||||
},
|
||||
],
|
||||
packageOverrides: [],
|
||||
});
|
||||
|
||||
await expect(
|
||||
generateThirdPartyLicenseManifest({
|
||||
configFile: fixture.configFile,
|
||||
packageManifests: [{ bundle: "web", path: fixture.appManifest }],
|
||||
}),
|
||||
).rejects.toThrow("duplicate custom notice for duplicate-asset");
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,9 @@
|
||||
// @effect-diagnostics nodeBuiltinImport:off - This is a build-time filesystem script.
|
||||
|
||||
import * as NodePath from "node:path";
|
||||
|
||||
import { syncThirdPartyLicenseNotices } from "./lib/third-party-licenses.ts";
|
||||
|
||||
const configFile = NodePath.resolve("third-party-licenses.config.json");
|
||||
|
||||
await syncThirdPartyLicenseNotices(configFile);
|
||||
@@ -0,0 +1,450 @@
|
||||
{
|
||||
"customNotices": [
|
||||
{
|
||||
"bundles": ["assets", "desktop", "web"],
|
||||
"license": "CC0-1.0",
|
||||
"name": "Folder_Whoosh.wav by BaggoNotes",
|
||||
"sourceUrl": "https://freesound.org/people/BaggoNotes/sounds/704258/",
|
||||
"generatedNotices": [
|
||||
{
|
||||
"licenseId": "CC0-1.0",
|
||||
"preamble": [
|
||||
"The bundled snap-shot-whoosh.mp3 is derived from Folder_Whoosh.wav by BaggoNotes:\nhttps://freesound.org/people/BaggoNotes/sounds/704258/\n\nThe original sound is dedicated to the public domain under CC0 1.0 Universal."
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"bundles": ["assets", "desktop", "web"],
|
||||
"license": "CC0-1.0",
|
||||
"name": "Contarex camera shutter.wav by Tonik1105",
|
||||
"sourceUrl": "https://freesound.org/people/Tonik1105/sounds/520684/",
|
||||
"generatedNotices": [
|
||||
{
|
||||
"licenseId": "CC0-1.0",
|
||||
"preamble": [
|
||||
"The bundled snap-shot-click.mp3 is derived from Contarex camera shutter.wav by Tonik1105:\nhttps://freesound.org/people/Tonik1105/sounds/520684/\n\nThe original sound is dedicated to the public domain under CC0 1.0 Universal."
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"bundles": ["device-tools"],
|
||||
"includeInBundles": ["mobile", "web"],
|
||||
"license": "MIT",
|
||||
"name": "agent-device",
|
||||
"sourceUrl": "https://github.com/callstack/agent-device",
|
||||
"version": "0.20.10",
|
||||
"generatedNotices": [
|
||||
{
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2026 Callstack"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"bundles": ["device-tools"],
|
||||
"includeInBundles": ["mobile", "web"],
|
||||
"license": "MIT AND Apache-2.0 AND BSD-3-Clause",
|
||||
"name": "expo-device-hub",
|
||||
"sourceUrl": "https://github.com/expo/expo-device-hub",
|
||||
"version": "0.9.0",
|
||||
"generatedNotices": [
|
||||
{
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)"]
|
||||
},
|
||||
{
|
||||
"licenseId": "Apache-2.0",
|
||||
"preamble": [
|
||||
"This distribution includes software from the original serve-sim project, created and open-sourced by Evan Bacon:\nhttps://github.com/EvanBacon/serve-sim\n\nOriginal work copyright 2026 Evan Bacon. This fork contains modifications by Expo and other contributors."
|
||||
]
|
||||
},
|
||||
{
|
||||
"licenseId": "BSD-3-Clause",
|
||||
"copyrights": ["Copyright (c) 2011, The WebRTC project authors. All rights reserved."]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"bundles": ["android", "assets", "mobile", "web"],
|
||||
"license": "MIT",
|
||||
"name": "libghostty-vt",
|
||||
"noticeFile": "native/libghostty-vt/LICENSE",
|
||||
"sourceUrl": "https://github.com/ghostty-org/ghostty"
|
||||
},
|
||||
{
|
||||
"bundles": ["assets", "web"],
|
||||
"license": "MIT",
|
||||
"name": "Symbols Nerd Font Mono",
|
||||
"noticeFile": "apps/web/src/terminal/ghostty/fonts/LICENSE",
|
||||
"sourceUrl": "https://github.com/ryanoasis/nerd-fonts"
|
||||
},
|
||||
{
|
||||
"bundles": ["ios", "mobile"],
|
||||
"license": "MIT",
|
||||
"name": "GhosttyKit",
|
||||
"sourceUrl": "https://github.com/Yash-Singh1/ghostty/tree/t3code/custom-io-ordered-feed",
|
||||
"generatedNotices": [
|
||||
{
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2024 Mitchell Hashimoto, Ghostty contributors"],
|
||||
"preamble": [
|
||||
"GhosttyKit\n\nThe iOS terminal renderer vendors GhosttyKit.xcframework, a libghostty build produced from VVTerm's custom-I/O and live-padding Ghostty branch.\n\nUpstream project: https://github.com/ghostty-org/ghostty\nBased on: https://github.com/wiedymi/ghostty/tree/vvterm/custom-io-padding\nVendored source branch: https://github.com/Yash-Singh1/ghostty/tree/t3code/custom-io-ordered-feed\nVendored revision: cf8edc23f3a6a87a96e41a90013e89e987d34980\nReference integration: https://github.com/vivy-company/vvterm"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"bundles": ["android", "assets", "mobile"],
|
||||
"license": "Apache-2.0",
|
||||
"name": "MesloLGS NF",
|
||||
"sourceUrl": "https://github.com/romkatv/powerlevel10k-media",
|
||||
"generatedNotices": [
|
||||
{
|
||||
"licenseId": "Apache-2.0",
|
||||
"copyrights": ["Copyright 2009, 2010, 2013 André Berg"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"bundles": ["mobile"],
|
||||
"license": "MIT",
|
||||
"name": "react-native-uitextview",
|
||||
"noticeFile": "apps/mobile/modules/t3-markdown-text/LICENSE",
|
||||
"sourceUrl": "https://github.com/bluesky-social/react-native-uitextview",
|
||||
"version": "2.2.0"
|
||||
},
|
||||
{
|
||||
"bundles": ["mobile"],
|
||||
"license": "MIT",
|
||||
"name": "Expo text editor implementation",
|
||||
"noticeFile": "apps/mobile/modules/t3-composer-editor/LICENSE",
|
||||
"sourceUrl": "https://github.com/expo/expo"
|
||||
}
|
||||
],
|
||||
"packageOverrides": [
|
||||
{
|
||||
"license": "MIT",
|
||||
"name": "@react-grab/cli",
|
||||
"sourceUrl": "https://github.com/aidenybai/react-grab/tree/main/packages/cli",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2025 Aiden Bai"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "glob-to-regexp",
|
||||
"generatedNotice": {
|
||||
"licenseId": "BSD-2-Clause",
|
||||
"copyrights": ["Copyright (c) 2013, Nick Fitzgerald"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "kubernetes-types",
|
||||
"generatedNotice": {
|
||||
"licenseId": "Apache-2.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@msgpackr-extract/msgpackr-extract-linux-x64",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2020 Kris Zyp"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "isarray",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2013 Julian Gruber <[email protected]>"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "keyv",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2017-2021 Luke Childs", "Copyright (c) 2021-2022 Jared Wray"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"license": "MIT",
|
||||
"name": "type-fest",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": [
|
||||
"Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "lazy-val",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) Vladimir Krivosheev"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@pierre/theming",
|
||||
"generatedNotice": {
|
||||
"licenseId": "Apache-2.0",
|
||||
"copyrights": ["Copyright 2025 Pierre Computer Company"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "lru_map",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2010-2016 Rasmus Andersson <https://rsms.me/>"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@electron-internal/extract-zip",
|
||||
"generatedNotice": {
|
||||
"licenseId": "BSD-2-Clause",
|
||||
"copyrights": ["Copyright (c) 2026 Samuel Attard and Electron contributors"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"repositoryUrl": "https://github.com/xa11y/xa11y",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2025 Stephen Crowe"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"license": "MIT",
|
||||
"name": "map-stream",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2011 Dominic Tarr"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"license": "Apache-2.0",
|
||||
"name": "jsbi"
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-android-arm64",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-darwin-arm64",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-darwin-x64",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-linux-arm-gnueabihf",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-linux-arm64-gnu",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-linux-arm64-musl",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-linux-x64-gnu",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-linux-x64-musl",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-win32-arm64-msvc",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-win32-ia32-msvc",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@yuuang/ffi-rs-win32-x64-msvc",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2019 zhangyuang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"repositoryUrl": "https://github.com/facebook/metro",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) Meta Platforms, Inc. and affiliates."]
|
||||
}
|
||||
},
|
||||
{
|
||||
"repositoryUrl": "https://github.com/react/metro",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) Meta Platforms, Inc. and affiliates."]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@react-native-ai/apple",
|
||||
"sourceUrl": "https://github.com/callstackincubator/ai",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": [
|
||||
"Copyright (c) 2024-2025 Szymon Rybczak",
|
||||
"Copyright (c) 2025-present Callstack"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "react-remove-scroll-bar",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) Anton Korzunov <[email protected]>"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "standard-navigation",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2026 React Navigation Contributors"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@expo/sdk-runtime-versions",
|
||||
"noticeFile": "apps/mobile/modules/t3-composer-editor/LICENSE"
|
||||
},
|
||||
{
|
||||
"name": "@expo/ws-tunnel",
|
||||
"noticeFile": "apps/mobile/modules/t3-composer-editor/LICENSE"
|
||||
},
|
||||
{
|
||||
"name": "stream-buffers",
|
||||
"generatedNotice": {
|
||||
"licenseId": "Unlicense"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "bplist-parser",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2012 Near Infinity Corporation"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@expo/devcert",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) Dave Wasmer"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "jimp-compact",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2018 Oliver Moran"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fb-watchman",
|
||||
"generatedNotice": {
|
||||
"licenseId": "Apache-2.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "bser",
|
||||
"generatedNotice": {
|
||||
"licenseId": "Apache-2.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@expo/xcpretty",
|
||||
"generatedNotice": {
|
||||
"licenseId": "BSD-3-Clause",
|
||||
"copyrights": ["Copyright (c) 2016-present, 650 Industries, Inc. (Expo)"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"license": "MIT",
|
||||
"name": "fb-dotslash",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) Meta Platforms, Inc. and affiliates."]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "structured-headers",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2018 Evert Pot"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "badgin",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) Julian Hundeloh and Tinycon contributors"],
|
||||
"preamble": ["badgin is a refactored fork of Tinycon."]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "react-native-nitro-modules",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2024 Marc Rousavy"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "boolbase",
|
||||
"generatedNotice": {
|
||||
"licenseId": "ISC",
|
||||
"copyrights": ["Copyright (c) 2014-2015, Felix Boehm <[email protected]>"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"repositoryUrl": "https://github.com/dmtrKovalenko/fff",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2025 Dmitriy Kovalenko"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@opencode-ai/sdk",
|
||||
"sourceUrl": "https://github.com/anomalyco/opencode/tree/dev/packages/sdk/js",
|
||||
"generatedNotice": {
|
||||
"licenseId": "MIT",
|
||||
"copyrights": ["Copyright (c) 2025 opencode"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user