ai-localize-config 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
- package/src/loader.ts +2 -2
- package/src/schema.ts +1 -1
package/CHANGELOG.md
ADDED
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { LocalizationConfig } from '
|
|
2
|
+
import { LocalizationConfig } from 'ai-localize-shared';
|
|
3
3
|
|
|
4
4
|
declare const LocalizationConfigSchema: z.ZodObject<{
|
|
5
5
|
framework: z.ZodDefault<z.ZodEnum<["react", "react-cra", "react-vite", "react-nextjs", "angular", "angular-ngx", "angular-i18n", "vue", "vue-i18n", "jquery", "vanilla-js", "jsp", "unknown"]>>;
|
|
@@ -12,7 +12,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
12
12
|
ignorePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
13
13
|
incrementalCache: z.ZodDefault<z.ZodBoolean>;
|
|
14
14
|
cacheDir: z.ZodDefault<z.ZodString>;
|
|
15
|
-
aws: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
aws: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
16
16
|
region: z.ZodDefault<z.ZodString>;
|
|
17
17
|
bucket: z.ZodString;
|
|
18
18
|
distributionId: z.ZodString;
|
|
@@ -36,7 +36,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
36
36
|
legacyCdnPattern?: string | undefined;
|
|
37
37
|
assetsPrefix?: string | undefined;
|
|
38
38
|
profile?: string | undefined;
|
|
39
|
-
}
|
|
39
|
+
}>>>;
|
|
40
40
|
plugins: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
42
|
framework: "react" | "react-cra" | "react-vite" | "react-nextjs" | "angular" | "angular-ngx" | "angular-i18n" | "vue" | "vue-i18n" | "jquery" | "vanilla-js" | "jsp" | "unknown";
|
|
@@ -58,7 +58,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
58
58
|
cdnBaseUrl?: string | undefined;
|
|
59
59
|
legacyCdnPattern?: string | undefined;
|
|
60
60
|
profile?: string | undefined;
|
|
61
|
-
} | undefined;
|
|
61
|
+
} | null | undefined;
|
|
62
62
|
}, {
|
|
63
63
|
framework?: "react" | "react-cra" | "react-vite" | "react-nextjs" | "angular" | "angular-ngx" | "angular-i18n" | "vue" | "vue-i18n" | "jquery" | "vanilla-js" | "jsp" | "unknown" | undefined;
|
|
64
64
|
defaultLanguage?: string | undefined;
|
|
@@ -78,7 +78,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
78
78
|
legacyCdnPattern?: string | undefined;
|
|
79
79
|
assetsPrefix?: string | undefined;
|
|
80
80
|
profile?: string | undefined;
|
|
81
|
-
} | undefined;
|
|
81
|
+
} | null | undefined;
|
|
82
82
|
plugins?: string[] | undefined;
|
|
83
83
|
}>;
|
|
84
84
|
type LocalizationConfigInput = z.input<typeof LocalizationConfigSchema>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { LocalizationConfig } from '
|
|
2
|
+
import { LocalizationConfig } from 'ai-localize-shared';
|
|
3
3
|
|
|
4
4
|
declare const LocalizationConfigSchema: z.ZodObject<{
|
|
5
5
|
framework: z.ZodDefault<z.ZodEnum<["react", "react-cra", "react-vite", "react-nextjs", "angular", "angular-ngx", "angular-i18n", "vue", "vue-i18n", "jquery", "vanilla-js", "jsp", "unknown"]>>;
|
|
@@ -12,7 +12,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
12
12
|
ignorePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
13
13
|
incrementalCache: z.ZodDefault<z.ZodBoolean>;
|
|
14
14
|
cacheDir: z.ZodDefault<z.ZodString>;
|
|
15
|
-
aws: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
aws: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
16
16
|
region: z.ZodDefault<z.ZodString>;
|
|
17
17
|
bucket: z.ZodString;
|
|
18
18
|
distributionId: z.ZodString;
|
|
@@ -36,7 +36,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
36
36
|
legacyCdnPattern?: string | undefined;
|
|
37
37
|
assetsPrefix?: string | undefined;
|
|
38
38
|
profile?: string | undefined;
|
|
39
|
-
}
|
|
39
|
+
}>>>;
|
|
40
40
|
plugins: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
42
|
framework: "react" | "react-cra" | "react-vite" | "react-nextjs" | "angular" | "angular-ngx" | "angular-i18n" | "vue" | "vue-i18n" | "jquery" | "vanilla-js" | "jsp" | "unknown";
|
|
@@ -58,7 +58,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
58
58
|
cdnBaseUrl?: string | undefined;
|
|
59
59
|
legacyCdnPattern?: string | undefined;
|
|
60
60
|
profile?: string | undefined;
|
|
61
|
-
} | undefined;
|
|
61
|
+
} | null | undefined;
|
|
62
62
|
}, {
|
|
63
63
|
framework?: "react" | "react-cra" | "react-vite" | "react-nextjs" | "angular" | "angular-ngx" | "angular-i18n" | "vue" | "vue-i18n" | "jquery" | "vanilla-js" | "jsp" | "unknown" | undefined;
|
|
64
64
|
defaultLanguage?: string | undefined;
|
|
@@ -78,7 +78,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
|
|
|
78
78
|
legacyCdnPattern?: string | undefined;
|
|
79
79
|
assetsPrefix?: string | undefined;
|
|
80
80
|
profile?: string | undefined;
|
|
81
|
-
} | undefined;
|
|
81
|
+
} | null | undefined;
|
|
82
82
|
plugins?: string[] | undefined;
|
|
83
83
|
}>;
|
|
84
84
|
type LocalizationConfigInput = z.input<typeof LocalizationConfigSchema>;
|
package/dist/index.js
CHANGED
|
@@ -74,7 +74,7 @@ var LocalizationConfigSchema = import_zod.z.object({
|
|
|
74
74
|
ignorePatterns: import_zod.z.array(import_zod.z.string()).default(["node_modules", "dist", ".git", "coverage"]),
|
|
75
75
|
incrementalCache: import_zod.z.boolean().default(true),
|
|
76
76
|
cacheDir: import_zod.z.string().default(".ai-localize-cache"),
|
|
77
|
-
aws: AwsConfigSchema.optional(),
|
|
77
|
+
aws: AwsConfigSchema.optional().nullable(),
|
|
78
78
|
plugins: import_zod.z.array(import_zod.z.string()).default([])
|
|
79
79
|
});
|
|
80
80
|
|
|
@@ -83,13 +83,13 @@ var fs = __toESM(require("fs"));
|
|
|
83
83
|
var path = __toESM(require("path"));
|
|
84
84
|
var import_cosmiconfig = require("cosmiconfig");
|
|
85
85
|
var dotenv = __toESM(require("dotenv"));
|
|
86
|
-
var
|
|
86
|
+
var import_ai_localize_shared = require("ai-localize-shared");
|
|
87
87
|
async function loadConfig(cwd = process.cwd(), overrides = {}) {
|
|
88
88
|
dotenv.config({ path: path.join(cwd, ".env") });
|
|
89
89
|
dotenv.config({ path: path.join(cwd, ".env.local") });
|
|
90
90
|
const explorer = (0, import_cosmiconfig.cosmiconfig)("ai-localize", {
|
|
91
91
|
searchPlaces: [
|
|
92
|
-
|
|
92
|
+
import_ai_localize_shared.CONFIG_FILE_NAME,
|
|
93
93
|
"ai-localize.config.js",
|
|
94
94
|
"ai-localize.config.ts",
|
|
95
95
|
".ai-localizerc",
|
|
@@ -134,7 +134,7 @@ function extractAwsFromEnv() {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
function writeDefaultConfig(cwd = process.cwd(), framework = "unknown") {
|
|
137
|
-
const configPath = path.join(cwd,
|
|
137
|
+
const configPath = path.join(cwd, import_ai_localize_shared.CONFIG_FILE_NAME);
|
|
138
138
|
const defaultConfig = {
|
|
139
139
|
framework,
|
|
140
140
|
defaultLanguage: "en",
|
package/dist/index.mjs
CHANGED
|
@@ -35,7 +35,7 @@ var LocalizationConfigSchema = z.object({
|
|
|
35
35
|
ignorePatterns: z.array(z.string()).default(["node_modules", "dist", ".git", "coverage"]),
|
|
36
36
|
incrementalCache: z.boolean().default(true),
|
|
37
37
|
cacheDir: z.string().default(".ai-localize-cache"),
|
|
38
|
-
aws: AwsConfigSchema.optional(),
|
|
38
|
+
aws: AwsConfigSchema.optional().nullable(),
|
|
39
39
|
plugins: z.array(z.string()).default([])
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -44,7 +44,7 @@ import * as fs from "fs";
|
|
|
44
44
|
import * as path from "path";
|
|
45
45
|
import { cosmiconfig } from "cosmiconfig";
|
|
46
46
|
import * as dotenv from "dotenv";
|
|
47
|
-
import { CONFIG_FILE_NAME } from "
|
|
47
|
+
import { CONFIG_FILE_NAME } from "ai-localize-shared";
|
|
48
48
|
async function loadConfig(cwd = process.cwd(), overrides = {}) {
|
|
49
49
|
dotenv.config({ path: path.join(cwd, ".env") });
|
|
50
50
|
dotenv.config({ path: path.join(cwd, ".env.local") });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-localize-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Configuration loader and schema validator for ai-localize-core",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"zod": "^3.22.4",
|
|
17
17
|
"cosmiconfig": "^9.0.0",
|
|
18
18
|
"dotenv": "^16.4.1",
|
|
19
|
-
"ai-localize-shared": "
|
|
19
|
+
"ai-localize-shared": "2.0.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"tsup": "^8.0.1",
|
package/src/loader.ts
CHANGED
|
@@ -3,8 +3,8 @@ import * as path from 'path';
|
|
|
3
3
|
import { cosmiconfig } from 'cosmiconfig';
|
|
4
4
|
import * as dotenv from 'dotenv';
|
|
5
5
|
|
|
6
|
-
import type { LocalizationConfig } from '
|
|
7
|
-
import { CONFIG_FILE_NAME } from '
|
|
6
|
+
import type { LocalizationConfig } from 'ai-localize-shared';
|
|
7
|
+
import { CONFIG_FILE_NAME } from 'ai-localize-shared';
|
|
8
8
|
import { LocalizationConfigSchema } from './schema.js';
|
|
9
9
|
|
|
10
10
|
export interface ConfigLoadResult {
|
package/src/schema.ts
CHANGED
|
@@ -39,7 +39,7 @@ export const LocalizationConfigSchema = z.object({
|
|
|
39
39
|
.default(['node_modules', 'dist', '.git', 'coverage']),
|
|
40
40
|
incrementalCache: z.boolean().default(true),
|
|
41
41
|
cacheDir: z.string().default('.ai-localize-cache'),
|
|
42
|
-
aws: AwsConfigSchema.optional(),
|
|
42
|
+
aws: AwsConfigSchema.optional().nullable(),
|
|
43
43
|
plugins: z.array(z.string()).default([]),
|
|
44
44
|
});
|
|
45
45
|
|