Refactored all the schemas;

Splitted them in a folder and renamed them to have the same name of typescript type;
Added more SemanticKeys;
Removed Schema resolution via string;
This commit is contained in:
Alexander Cerutti
2021-06-17 23:34:22 +02:00
parent 87321b8dc9
commit 17de1c7d79
16 changed files with 850 additions and 771 deletions

View File

@@ -1,5 +1,5 @@
import { EOL } from "os";
import { PartitionedBundle, BundleUnit } from "./schema";
import type * as Schemas from "./schemas";
import { sep } from "path";
/**
@@ -118,12 +118,12 @@ export function generateStringFile(lang: { [index: string]: string }): Buffer {
*/
type PartitionedBundleElements = [
PartitionedBundle["l10nBundle"],
PartitionedBundle["bundle"],
Schemas.PartitionedBundle["l10nBundle"],
Schemas.PartitionedBundle["bundle"],
];
export function splitBufferBundle(
origin: BundleUnit,
origin: Schemas.BundleUnit,
): PartitionedBundleElements {
const initialValue: PartitionedBundleElements = [{}, {}];
@@ -180,7 +180,7 @@ export function hasFilesWithName(
}
export function deletePersonalization(
source: BundleUnit,
source: Schemas.BundleUnit,
logosNames: string[] = [],
): void {
[...logosNames, "personalization.json"].forEach(