Follow up per locale bundle (#16381)

* fix docker build

* enable check spdx license id in frontend-builder

* fix eslint config

* run eslint for frontend-builder in ci

* fix eslint

* add license headers

* fix unnecessary comments

* update changelog

* fix generateDts

* fix tsx
This commit is contained in:
anatawa12
2025-08-08 18:47:35 +09:00
committed by GitHub
parent 8598f3912e
commit adb3ad6b7f
17 changed files with 133 additions and 143 deletions

View File

@@ -73,7 +73,7 @@ export default function generateDTS() {
ts.NodeFlags.Const,
),
),
ts.factory.createInterfaceDeclaration(
ts.factory.createTypeAliasDeclaration(
[ts.factory.createToken(ts.SyntaxKind.ExportKeyword)],
ts.factory.createIdentifier('ParameterizedString'),
[
@@ -84,20 +84,22 @@ export default function generateDTS() {
ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),
),
],
undefined,
[
ts.factory.createPropertySignature(
undefined,
ts.factory.createComputedPropertyName(
ts.factory.createIdentifier('kParameters'),
),
undefined,
ts.factory.createTypeReferenceNode(
ts.factory.createIdentifier('T'),
ts.factory.createIntersectionTypeNode([
ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),
ts.factory.createTypeLiteralNode([
ts.factory.createPropertySignature(
undefined,
ts.factory.createComputedPropertyName(
ts.factory.createIdentifier('kParameters'),
),
undefined,
ts.factory.createTypeReferenceNode(
ts.factory.createIdentifier('T'),
undefined,
),
),
),
],
])
]),
),
ts.factory.createInterfaceDeclaration(
[ts.factory.createToken(ts.SyntaxKind.ExportKeyword)],

4
locales/index.d.ts vendored
View File

@@ -2,9 +2,9 @@
// This file is generated by locales/generateDTS.js
// Do not edit this file directly.
declare const kParameters: unique symbol;
export interface ParameterizedString<T extends string = string> {
export type ParameterizedString<T extends string = string> = string & {
[kParameters]: T;
}
};
export interface ILocale {
[_: string]: string | ParameterizedString | ILocale;
}