@inlang/project-settings
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -1,2 +0,2 @@ | ||
export { ProjectSettings, _MessageLintRuleId, _MessageLintRuleLevel, } from "./interface.js"; | ||
export { ProjectSettings, ExternalProjectSettings, _MessageLintRuleId, _MessageLintRuleLevel, } from "./interface.js"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,4 +0,4 @@ | ||
export { ProjectSettings, | ||
export { ProjectSettings, ExternalProjectSettings, | ||
// the types beneath are exported to avoid circular dependencies. | ||
// use the types from the corresponding package directly instead. | ||
_MessageLintRuleId, _MessageLintRuleLevel, } from "./interface.js"; |
@@ -23,3 +23,3 @@ import { Type } from "@sinclair/typebox"; | ||
*/ | ||
const InternalSettings = Type.Object({ | ||
const InternalProjectSettings = Type.Object({ | ||
$schema: Type.Optional(Type.Literal("https://inlang.com/schema/project-settings")), | ||
@@ -69,8 +69,5 @@ sourceLanguageTag: LanguageTag, | ||
}); | ||
/** | ||
* Settings defined via apps, plugins, lint rules, etc. | ||
*/ | ||
const ExternalSettings = Type.Record(Type.String({ | ||
export const ExternalProjectSettings = Type.Record(Type.String({ | ||
// pattern includes ProjectSettings keys | ||
pattern: `^((messageLintRule|plugin|app|library)\\.([a-z][a-zA-Z0-9]*)\\.([a-z][a-zA-Z0-9]*(?:[A-Z][a-z0-9]*)*)|\\$schema|${Object.keys(InternalSettings.properties) | ||
pattern: `^((messageLintRule|plugin|app|library)\\.([a-z][a-zA-Z0-9]*)\\.([a-z][a-zA-Z0-9]*(?:[A-Z][a-z0-9]*)*)|\\$schema|${Object.keys(InternalProjectSettings.properties) | ||
.map((key) => key.replaceAll(".", "\\.")) | ||
@@ -85,2 +82,2 @@ .join("|")})$`, | ||
JSON, { additionalProperties: false, description: "Settings defined by apps, plugins, etc." }); | ||
export const ProjectSettings = Type.Intersect([InternalSettings, ExternalSettings]); | ||
export const ProjectSettings = Type.Intersect([InternalProjectSettings, ExternalProjectSettings]); |
{ | ||
"name": "@inlang/project-settings", | ||
"type": "module", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "publishConfig": { |
export { | ||
ProjectSettings, | ||
ExternalProjectSettings, | ||
// the types beneath are exported to avoid circular dependencies. | ||
@@ -4,0 +5,0 @@ // use the types from the corresponding package directly instead. |
@@ -28,3 +28,3 @@ import { type Static, type TLiteral, type TTemplateLiteral, Type } from "@sinclair/typebox" | ||
const InternalSettings = Type.Object({ | ||
const InternalProjectSettings = Type.Object({ | ||
$schema: Type.Optional(Type.Literal("https://inlang.com/schema/project-settings")), | ||
@@ -67,3 +67,3 @@ sourceLanguageTag: LanguageTag, | ||
], | ||
}, | ||
} | ||
), | ||
@@ -79,3 +79,3 @@ messageLintRuleLevels: Type.Optional( | ||
], | ||
}), | ||
}) | ||
), | ||
@@ -87,7 +87,8 @@ }) | ||
*/ | ||
const ExternalSettings = Type.Record( | ||
export type ExternalProjectSettings = Static<typeof ExternalProjectSettings> | ||
export const ExternalProjectSettings = Type.Record( | ||
Type.String({ | ||
// pattern includes ProjectSettings keys | ||
pattern: `^((messageLintRule|plugin|app|library)\\.([a-z][a-zA-Z0-9]*)\\.([a-z][a-zA-Z0-9]*(?:[A-Z][a-z0-9]*)*)|\\$schema|${Object.keys( | ||
InternalSettings.properties, | ||
InternalProjectSettings.properties | ||
) | ||
@@ -106,6 +107,6 @@ .map((key) => key.replaceAll(".", "\\.")) | ||
JSON as unknown as typeof JSONObject, | ||
{ additionalProperties: false, description: "Settings defined by apps, plugins, etc." }, | ||
{ additionalProperties: false, description: "Settings defined by apps, plugins, etc." } | ||
) | ||
export type ProjectSettings = Static<typeof ProjectSettings> | ||
export const ProjectSettings = Type.Intersect([InternalSettings, ExternalSettings]) | ||
export const ProjectSettings = Type.Intersect([InternalProjectSettings, ExternalProjectSettings]) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156475
1363