@intlayer/chokidar 9.0.0-canary.3 → 9.0.0-canary.5
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/dist/assets/initConfig/templates/cjs.txt +7 -0
- package/dist/assets/initConfig/templates/json.txt +7 -1
- package/dist/assets/initConfig/templates/mjs.txt +7 -0
- package/dist/assets/initConfig/templates/ts.txt +7 -0
- package/dist/assets/installSkills/skills/cli.md +0 -1
- package/dist/cjs/cli.cjs +9 -0
- package/dist/cjs/init/cms.cjs +140 -0
- package/dist/cjs/init/cms.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/index.cjs +27 -0
- package/dist/cjs/init/frameworkSetup/index.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/detect.cjs +56 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/detect.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/index.cjs +103 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/index.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/restructure.cjs +147 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/restructure.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/templates.cjs +122 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/templates.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs +211 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/detect.cjs +31 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/detect.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/index.cjs +74 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/index.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/restructure.cjs +79 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/restructure.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/templates.cjs +104 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/templates.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/transforms.cjs +128 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/transforms.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/types.cjs +0 -0
- package/dist/cjs/init/index.cjs +60 -21
- package/dist/cjs/init/index.cjs.map +1 -1
- package/dist/cjs/init/utils/configManipulation.cjs +103 -11
- package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
- package/dist/cjs/init/utils/index.cjs +10 -0
- package/dist/cjs/init/utils/nextCompilerBabel.cjs +119 -0
- package/dist/cjs/init/utils/nextCompilerBabel.cjs.map +1 -0
- package/dist/cjs/init/utils/packageManager.cjs +73 -2
- package/dist/cjs/init/utils/packageManager.cjs.map +1 -1
- package/dist/esm/cli.mjs +4 -1
- package/dist/esm/init/cms.mjs +131 -0
- package/dist/esm/init/cms.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/index.mjs +26 -0
- package/dist/esm/init/frameworkSetup/index.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/detect.mjs +52 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/detect.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/index.mjs +100 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/index.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/restructure.mjs +142 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/restructure.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/templates.mjs +113 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/templates.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs +208 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/detect.mjs +28 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/detect.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/index.mjs +71 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/index.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/restructure.mjs +74 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/restructure.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/templates.mjs +100 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/templates.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/transforms.mjs +126 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/transforms.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/types.mjs +0 -0
- package/dist/esm/init/index.mjs +61 -22
- package/dist/esm/init/index.mjs.map +1 -1
- package/dist/esm/init/utils/configManipulation.mjs +102 -12
- package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
- package/dist/esm/init/utils/index.mjs +4 -3
- package/dist/esm/init/utils/nextCompilerBabel.mjs +115 -0
- package/dist/esm/init/utils/nextCompilerBabel.mjs.map +1 -0
- package/dist/esm/init/utils/packageManager.mjs +70 -4
- package/dist/esm/init/utils/packageManager.mjs.map +1 -1
- package/dist/types/cli.d.ts +5 -1
- package/dist/types/init/cms.d.ts +51 -0
- package/dist/types/init/cms.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/index.d.ts +13 -0
- package/dist/types/init/frameworkSetup/index.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/detect.d.ts +25 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/detect.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/index.d.ts +12 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/index.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/restructure.d.ts +44 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/restructure.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/templates.d.ts +26 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/templates.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/transforms.d.ts +23 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/transforms.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/detect.d.ts +19 -0
- package/dist/types/init/frameworkSetup/tanstackStart/detect.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/index.d.ts +13 -0
- package/dist/types/init/frameworkSetup/tanstackStart/index.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/restructure.d.ts +35 -0
- package/dist/types/init/frameworkSetup/tanstackStart/restructure.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/templates.d.ts +20 -0
- package/dist/types/init/frameworkSetup/tanstackStart/templates.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/transforms.d.ts +17 -0
- package/dist/types/init/frameworkSetup/tanstackStart/transforms.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/types.d.ts +35 -0
- package/dist/types/init/frameworkSetup/types.d.ts.map +1 -0
- package/dist/types/init/index.d.ts +24 -0
- package/dist/types/init/index.d.ts.map +1 -1
- package/dist/types/init/utils/configManipulation.d.ts +21 -1
- package/dist/types/init/utils/configManipulation.d.ts.map +1 -1
- package/dist/types/init/utils/index.d.ts +4 -3
- package/dist/types/init/utils/nextCompilerBabel.d.ts +53 -0
- package/dist/types/init/utils/nextCompilerBabel.d.ts.map +1 -0
- package/dist/types/init/utils/packageManager.d.ts +52 -1
- package/dist/types/init/utils/packageManager.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -24,6 +24,13 @@ const config = {
|
|
|
24
24
|
* Default: "prefix-no-default"
|
|
25
25
|
*/
|
|
26
26
|
mode: 'prefix-no-default',
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Enables the Intlayer locale-routing proxy (middleware).
|
|
30
|
+
* Handles locale detection, redirects and rewrites in dev, preview and SSR.
|
|
31
|
+
* Default: true
|
|
32
|
+
*/
|
|
33
|
+
enableProxy: true,
|
|
27
34
|
},
|
|
28
35
|
editor: {
|
|
29
36
|
/**
|
|
@@ -19,7 +19,13 @@
|
|
|
19
19
|
* - "search-params": Use search params to define the locale (e.g., /dashboard/?locale=en, /dashboard/?locale=fr)
|
|
20
20
|
* Default: "prefix-no-default"
|
|
21
21
|
*/
|
|
22
|
-
"mode": "prefix-no-default"
|
|
22
|
+
"mode": "prefix-no-default",
|
|
23
|
+
/**
|
|
24
|
+
* Enables the Intlayer locale-routing proxy (middleware).
|
|
25
|
+
* Handles locale detection, redirects and rewrites in dev, preview and SSR.
|
|
26
|
+
* Default: true
|
|
27
|
+
*/
|
|
28
|
+
"enableProxy": true
|
|
23
29
|
},
|
|
24
30
|
"editor": {
|
|
25
31
|
/**
|
|
@@ -24,6 +24,13 @@ const config = {
|
|
|
24
24
|
* Default: "prefix-no-default"
|
|
25
25
|
*/
|
|
26
26
|
mode: 'prefix-no-default',
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Enables the Intlayer locale-routing proxy (middleware).
|
|
30
|
+
* Handles locale detection, redirects and rewrites in dev, preview and SSR.
|
|
31
|
+
* Default: true
|
|
32
|
+
*/
|
|
33
|
+
enableProxy: true,
|
|
27
34
|
},
|
|
28
35
|
editor: {
|
|
29
36
|
/**
|
|
@@ -23,6 +23,13 @@ const config: IntlayerConfig = {
|
|
|
23
23
|
* Default: "prefix-no-default"
|
|
24
24
|
*/
|
|
25
25
|
mode: 'prefix-no-default',
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Enables the Intlayer locale-routing proxy (middleware).
|
|
29
|
+
* Handles locale detection, redirects and rewrites in dev, preview and SSR.
|
|
30
|
+
* Default: true
|
|
31
|
+
*/
|
|
32
|
+
enableProxy: true,
|
|
26
33
|
},
|
|
27
34
|
editor: {
|
|
28
35
|
/**
|
|
@@ -40,7 +40,6 @@ npm install intlayer-cli
|
|
|
40
40
|
|
|
41
41
|
- [Build](https://intlayer.org/doc/concept/cli/build.md)
|
|
42
42
|
- [CI](https://intlayer.org/doc/concept/cli.md)
|
|
43
|
-
- [CLI Overview](https://intlayer.org/doc/concept/cli/export.md)
|
|
44
43
|
- [Configuration](https://intlayer.org/doc/concept/cli/configuration.md)
|
|
45
44
|
- [Debug](https://intlayer.org/doc/concept/cli/debug.md)
|
|
46
45
|
- [Doc Review](https://intlayer.org/doc/concept/cli/doc-review.md)
|
package/dist/cjs/cli.cjs
CHANGED
|
@@ -9,23 +9,30 @@ const require_detectFormatCommand = require('./detectFormatCommand.cjs');
|
|
|
9
9
|
const require_getContentDeclarationFileTemplate_getContentDeclarationFileTemplate = require('./getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs');
|
|
10
10
|
const require_writeContentDeclaration_writeJSFile = require('./writeContentDeclaration/writeJSFile.cjs');
|
|
11
11
|
const require_writeContentDeclaration_writeContentDeclaration = require('./writeContentDeclaration/writeContentDeclaration.cjs');
|
|
12
|
+
const require_init_cms = require('./init/cms.cjs');
|
|
13
|
+
const require_init_utils_packageManager = require('./init/utils/packageManager.cjs');
|
|
14
|
+
const require_init_utils_nextCompilerBabel = require('./init/utils/nextCompilerBabel.cjs');
|
|
12
15
|
const require_init_index = require('./init/index.cjs');
|
|
13
16
|
const require_installSkills_index = require('./installSkills/index.cjs');
|
|
14
17
|
const require_installMCP_installMCP = require('./installMCP/installMCP.cjs');
|
|
15
18
|
const require_listGitFiles = require('./listGitFiles.cjs');
|
|
16
19
|
const require_logConfigDetails = require('./logConfigDetails.cjs');
|
|
17
20
|
|
|
21
|
+
exports.NEXT_INTLAYER_BABEL_CONFIG_CONTENT = require_init_utils_nextCompilerBabel.NEXT_INTLAYER_BABEL_CONFIG_CONTENT;
|
|
18
22
|
exports.PLATFORMS = require_installSkills_index.PLATFORMS;
|
|
19
23
|
exports.PLATFORMS_METADATA = require_installSkills_index.PLATFORMS_METADATA;
|
|
20
24
|
exports.SKILLS = require_installSkills_index.SKILLS;
|
|
21
25
|
exports.SKILLS_METADATA = require_installSkills_index.SKILLS_METADATA;
|
|
22
26
|
exports.detectExportedComponentName = require_writeContentDeclaration_detectExportedComponentName.detectExportedComponentName;
|
|
23
27
|
exports.detectFormatCommand = require_detectFormatCommand.detectFormatCommand;
|
|
28
|
+
exports.detectPackageManager = require_init_utils_packageManager.detectPackageManager;
|
|
29
|
+
exports.enableEditorInConfig = require_init_cms.enableEditorInConfig;
|
|
24
30
|
exports.getContentDeclarationFileTemplate = require_getContentDeclarationFileTemplate_getContentDeclarationFileTemplate.getContentDeclarationFileTemplate;
|
|
25
31
|
exports.getInitialSkills = require_installSkills_index.getInitialSkills;
|
|
26
32
|
exports.initIntlayer = require_init_index.initIntlayer;
|
|
27
33
|
exports.installLSP = require_installLSP.installLSP;
|
|
28
34
|
exports.installMCP = require_installMCP_installMCP.installMCP;
|
|
35
|
+
exports.installPackages = require_init_utils_packageManager.installPackages;
|
|
29
36
|
exports.installSkills = require_installSkills_index.installSkills;
|
|
30
37
|
exports.listDictionaries = require_listDictionariesPath.listDictionaries;
|
|
31
38
|
exports.listDictionariesWithStats = require_listDictionariesPath.listDictionariesWithStats;
|
|
@@ -34,6 +41,8 @@ exports.listGitLines = require_listGitFiles.listGitLines;
|
|
|
34
41
|
exports.listProjects = require_listProjects.listProjects;
|
|
35
42
|
exports.logConfigDetails = require_logConfigDetails.logConfigDetails;
|
|
36
43
|
exports.prepareIntlayer = require_prepareIntlayer.prepareIntlayer;
|
|
44
|
+
exports.setupCmsCredentials = require_init_cms.setupCmsCredentials;
|
|
37
45
|
exports.transformJSFile = require_writeContentDeclaration_transformJSFile.transformJSFile;
|
|
46
|
+
exports.writeCmsCredentialsToEnv = require_init_cms.writeCmsCredentialsToEnv;
|
|
38
47
|
exports.writeContentDeclaration = require_writeContentDeclaration_writeContentDeclaration.writeContentDeclaration;
|
|
39
48
|
exports.writeJSFile = require_writeContentDeclaration_writeJSFile.writeJSFile;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_init_utils_configManipulation = require('./utils/configManipulation.cjs');
|
|
4
|
+
const require_init_utils_fileSystem = require('./utils/fileSystem.cjs');
|
|
5
|
+
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
6
|
+
let fast_glob = require("fast-glob");
|
|
7
|
+
fast_glob = require_runtime.__toESM(fast_glob);
|
|
8
|
+
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
9
|
+
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
|
|
10
|
+
|
|
11
|
+
//#region src/init/cms.ts
|
|
12
|
+
/**
|
|
13
|
+
* Intlayer configuration file candidates, ordered by the precedence used when
|
|
14
|
+
* resolving which file to mutate.
|
|
15
|
+
*/
|
|
16
|
+
const INTLAYER_CONFIG_FILE_CANDIDATES = [
|
|
17
|
+
"intlayer.config.ts",
|
|
18
|
+
"intlayer.config.mjs",
|
|
19
|
+
"intlayer.config.js",
|
|
20
|
+
"intlayer.config.cjs",
|
|
21
|
+
"intlayer.config.json"
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Environment files searched (most-preferred first) when persisting the CMS
|
|
25
|
+
* credentials. The first existing match is reused; otherwise a `.env` file is
|
|
26
|
+
* created at the project root.
|
|
27
|
+
*/
|
|
28
|
+
const ENV_FILE_CANDIDATES = [
|
|
29
|
+
".env",
|
|
30
|
+
".env.local",
|
|
31
|
+
".env.development"
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Resolves the first existing Intlayer configuration file at the project root,
|
|
35
|
+
* or `undefined` when none is present.
|
|
36
|
+
*/
|
|
37
|
+
const findIntlayerConfigFile = async (rootDir) => {
|
|
38
|
+
for (const candidate of INTLAYER_CONFIG_FILE_CANDIDATES) if (await require_init_utils_fileSystem.exists(rootDir, candidate)) return candidate;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Locates the environment file the CMS credentials should be written to. Uses
|
|
42
|
+
* `fast-glob` to detect an existing dotenv file at the project root, preferring
|
|
43
|
+
* a plain `.env`; falls back to `.env` (to be created) when none exist.
|
|
44
|
+
*/
|
|
45
|
+
const findEnvFile = async (rootDir) => {
|
|
46
|
+
const matches = await (0, fast_glob.default)([...ENV_FILE_CANDIDATES], {
|
|
47
|
+
cwd: rootDir,
|
|
48
|
+
dot: true,
|
|
49
|
+
deep: 1,
|
|
50
|
+
onlyFiles: true
|
|
51
|
+
});
|
|
52
|
+
return ENV_FILE_CANDIDATES.find((candidate) => matches.includes(candidate)) ?? ".env";
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Inserts or updates a `KEY=value` line in dotenv file content. An existing
|
|
56
|
+
* assignment of the same key is replaced in place; otherwise the line is
|
|
57
|
+
* appended with a trailing newline.
|
|
58
|
+
*/
|
|
59
|
+
const upsertEnvVariable = (content, key, value) => {
|
|
60
|
+
const line = `${key}=${value}`;
|
|
61
|
+
const keyMatcher = new RegExp(`^${key}=.*$`, "m");
|
|
62
|
+
if (keyMatcher.test(content)) return content.replace(keyMatcher, line);
|
|
63
|
+
return `${content}${content.length > 0 && !content.endsWith("\n") ? "\n" : ""}${line}\n`;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Persists the CMS access-key credentials to the project's environment file as
|
|
67
|
+
* `INTLAYER_CLIENT_ID` / `INTLAYER_CLIENT_SECRET`. The target file is detected
|
|
68
|
+
* with {@link findEnvFile} and created when missing. Returns the relative path
|
|
69
|
+
* of the file that was written.
|
|
70
|
+
*/
|
|
71
|
+
const writeCmsCredentialsToEnv = async (rootDir, { clientId, clientSecret }) => {
|
|
72
|
+
const envFile = await findEnvFile(rootDir);
|
|
73
|
+
let content = "";
|
|
74
|
+
if (await require_init_utils_fileSystem.exists(rootDir, envFile)) content = await require_init_utils_fileSystem.readFileFromRoot(rootDir, envFile);
|
|
75
|
+
let updatedContent = content;
|
|
76
|
+
updatedContent = upsertEnvVariable(updatedContent, "INTLAYER_CLIENT_ID", clientId);
|
|
77
|
+
updatedContent = upsertEnvVariable(updatedContent, "INTLAYER_CLIENT_SECRET", clientSecret);
|
|
78
|
+
await require_init_utils_fileSystem.writeFileToRoot(rootDir, envFile, updatedContent);
|
|
79
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Saved Intlayer CMS credentials to ${(0, _intlayer_config_logger.colorizePath)(envFile)} (${(0, _intlayer_config_logger.colorize)("INTLAYER_CLIENT_ID", _intlayer_config_colors.GREY_LIGHT)}, ${(0, _intlayer_config_logger.colorize)("INTLAYER_CLIENT_SECRET", _intlayer_config_colors.GREY_LIGHT)})`);
|
|
80
|
+
return envFile;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Enables the Intlayer visual editor in the project's configuration file:
|
|
84
|
+
* flips `editor.enabled` to `true` and wires `clientId` / `clientSecret` to the
|
|
85
|
+
* matching environment variables. JSON configs cannot reference `process.env`,
|
|
86
|
+
* so they are skipped with a warning. Returns the config file that was updated,
|
|
87
|
+
* or `undefined` when no editable config was found.
|
|
88
|
+
*/
|
|
89
|
+
const enableEditorInConfig = async (rootDir) => {
|
|
90
|
+
const configFile = await findIntlayerConfigFile(rootDir);
|
|
91
|
+
if (!configFile) {
|
|
92
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.x} Could not find an Intlayer configuration file to enable the editor.`, { level: "warn" });
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (configFile.split(".").pop() === "json") {
|
|
96
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.x} ${(0, _intlayer_config_logger.colorizePath)(configFile)} is a JSON config and cannot reference environment variables. Enable the editor and set clientId/clientSecret manually.`, { level: "warn" });
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const content = await require_init_utils_fileSystem.readFileFromRoot(rootDir, configFile);
|
|
100
|
+
const updatedContent = require_init_utils_configManipulation.enableIntlayerEditorConfig(content);
|
|
101
|
+
if (updatedContent !== content) {
|
|
102
|
+
await require_init_utils_fileSystem.writeFileToRoot(rootDir, configFile, updatedContent);
|
|
103
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Enabled the Intlayer editor in ${(0, _intlayer_config_logger.colorizePath)(configFile)}`);
|
|
104
|
+
} else (0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} ${(0, _intlayer_config_logger.colorizePath)(configFile)} already has the Intlayer editor enabled`);
|
|
105
|
+
return configFile;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Sets `routing.mode` in the project's Intlayer configuration file. Returns the
|
|
109
|
+
* config file that was updated, or `undefined` when none was found.
|
|
110
|
+
*/
|
|
111
|
+
const setRoutingModeInConfig = async (rootDir, mode) => {
|
|
112
|
+
const configFile = await findIntlayerConfigFile(rootDir);
|
|
113
|
+
if (!configFile) return void 0;
|
|
114
|
+
const extension = configFile.split(".").pop();
|
|
115
|
+
const content = await require_init_utils_fileSystem.readFileFromRoot(rootDir, configFile);
|
|
116
|
+
const updatedContent = require_init_utils_configManipulation.setIntlayerConfigRoutingMode(content, extension, mode);
|
|
117
|
+
if (updatedContent !== content) {
|
|
118
|
+
await require_init_utils_fileSystem.writeFileToRoot(rootDir, configFile, updatedContent);
|
|
119
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Set ${(0, _intlayer_config_logger.colorize)(`routing.mode = '${mode}'`, _intlayer_config_colors.GREY_LIGHT)} in ${(0, _intlayer_config_logger.colorizePath)(configFile)}`);
|
|
120
|
+
}
|
|
121
|
+
return configFile;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Completes the CMS setup once credentials are received from the login flow:
|
|
125
|
+
* writes them to the environment file and enables the editor in the Intlayer
|
|
126
|
+
* configuration file.
|
|
127
|
+
*/
|
|
128
|
+
const setupCmsCredentials = async (rootDir, credentials) => {
|
|
129
|
+
await writeCmsCredentialsToEnv(rootDir, credentials);
|
|
130
|
+
await enableEditorInConfig(rootDir);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
exports.INTLAYER_CONFIG_FILE_CANDIDATES = INTLAYER_CONFIG_FILE_CANDIDATES;
|
|
135
|
+
exports.enableEditorInConfig = enableEditorInConfig;
|
|
136
|
+
exports.findEnvFile = findEnvFile;
|
|
137
|
+
exports.setRoutingModeInConfig = setRoutingModeInConfig;
|
|
138
|
+
exports.setupCmsCredentials = setupCmsCredentials;
|
|
139
|
+
exports.writeCmsCredentialsToEnv = writeCmsCredentialsToEnv;
|
|
140
|
+
//# sourceMappingURL=cms.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cms.cjs","names":["exists","readFileFromRoot","writeFileToRoot","v","ANSIColors","x","enableIntlayerEditorConfig","setIntlayerConfigRoutingMode"],"sources":["../../../src/init/cms.ts"],"sourcesContent":["import * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, colorizePath, logger, v, x } from '@intlayer/config/logger';\nimport fg from 'fast-glob';\nimport {\n enableIntlayerEditorConfig,\n type RoutingMode,\n setIntlayerConfigRoutingMode,\n} from './utils/configManipulation';\nimport { exists, readFileFromRoot, writeFileToRoot } from './utils/fileSystem';\n\n/**\n * Intlayer configuration file candidates, ordered by the precedence used when\n * resolving which file to mutate.\n */\nexport const INTLAYER_CONFIG_FILE_CANDIDATES = [\n 'intlayer.config.ts',\n 'intlayer.config.mjs',\n 'intlayer.config.js',\n 'intlayer.config.cjs',\n 'intlayer.config.json',\n] as const;\n\n/**\n * Environment files searched (most-preferred first) when persisting the CMS\n * credentials. The first existing match is reused; otherwise a `.env` file is\n * created at the project root.\n */\nconst ENV_FILE_CANDIDATES = ['.env', '.env.local', '.env.development'] as const;\n\n/** Credentials returned by the CMS login flow (access key pair). */\nexport type CmsCredentials = {\n clientId: string;\n clientSecret: string;\n};\n\n/**\n * Resolves the first existing Intlayer configuration file at the project root,\n * or `undefined` when none is present.\n */\nconst findIntlayerConfigFile = async (\n rootDir: string\n): Promise<(typeof INTLAYER_CONFIG_FILE_CANDIDATES)[number] | undefined> => {\n for (const candidate of INTLAYER_CONFIG_FILE_CANDIDATES) {\n if (await exists(rootDir, candidate)) {\n return candidate;\n }\n }\n\n return undefined;\n};\n\n/**\n * Locates the environment file the CMS credentials should be written to. Uses\n * `fast-glob` to detect an existing dotenv file at the project root, preferring\n * a plain `.env`; falls back to `.env` (to be created) when none exist.\n */\nexport const findEnvFile = async (rootDir: string): Promise<string> => {\n const matches = await fg([...ENV_FILE_CANDIDATES], {\n cwd: rootDir,\n dot: true,\n deep: 1,\n onlyFiles: true,\n });\n\n return (\n ENV_FILE_CANDIDATES.find((candidate) => matches.includes(candidate)) ??\n '.env'\n );\n};\n\n/**\n * Inserts or updates a `KEY=value` line in dotenv file content. An existing\n * assignment of the same key is replaced in place; otherwise the line is\n * appended with a trailing newline.\n */\nconst upsertEnvVariable = (\n content: string,\n key: string,\n value: string\n): string => {\n const line = `${key}=${value}`;\n const keyMatcher = new RegExp(`^${key}=.*$`, 'm');\n\n if (keyMatcher.test(content)) {\n return content.replace(keyMatcher, line);\n }\n\n const needsLeadingNewline = content.length > 0 && !content.endsWith('\\n');\n\n return `${content}${needsLeadingNewline ? '\\n' : ''}${line}\\n`;\n};\n\n/**\n * Persists the CMS access-key credentials to the project's environment file as\n * `INTLAYER_CLIENT_ID` / `INTLAYER_CLIENT_SECRET`. The target file is detected\n * with {@link findEnvFile} and created when missing. Returns the relative path\n * of the file that was written.\n */\nexport const writeCmsCredentialsToEnv = async (\n rootDir: string,\n { clientId, clientSecret }: CmsCredentials\n): Promise<string> => {\n const envFile = await findEnvFile(rootDir);\n\n let content = '';\n if (await exists(rootDir, envFile)) {\n content = await readFileFromRoot(rootDir, envFile);\n }\n\n let updatedContent = content;\n updatedContent = upsertEnvVariable(\n updatedContent,\n 'INTLAYER_CLIENT_ID',\n clientId\n );\n updatedContent = upsertEnvVariable(\n updatedContent,\n 'INTLAYER_CLIENT_SECRET',\n clientSecret\n );\n\n await writeFileToRoot(rootDir, envFile, updatedContent);\n logger(\n `${v} Saved Intlayer CMS credentials to ${colorizePath(envFile)} (${colorize('INTLAYER_CLIENT_ID', ANSIColors.GREY_LIGHT)}, ${colorize('INTLAYER_CLIENT_SECRET', ANSIColors.GREY_LIGHT)})`\n );\n\n return envFile;\n};\n\n/**\n * Enables the Intlayer visual editor in the project's configuration file:\n * flips `editor.enabled` to `true` and wires `clientId` / `clientSecret` to the\n * matching environment variables. JSON configs cannot reference `process.env`,\n * so they are skipped with a warning. Returns the config file that was updated,\n * or `undefined` when no editable config was found.\n */\nexport const enableEditorInConfig = async (\n rootDir: string\n): Promise<string | undefined> => {\n const configFile = await findIntlayerConfigFile(rootDir);\n\n if (!configFile) {\n logger(\n `${x} Could not find an Intlayer configuration file to enable the editor.`,\n { level: 'warn' }\n );\n return undefined;\n }\n\n const extension = configFile.split('.').pop()!;\n\n if (extension === 'json') {\n logger(\n `${x} ${colorizePath(configFile)} is a JSON config and cannot reference environment variables. Enable the editor and set clientId/clientSecret manually.`,\n { level: 'warn' }\n );\n return undefined;\n }\n\n const content = await readFileFromRoot(rootDir, configFile);\n const updatedContent = enableIntlayerEditorConfig(content);\n\n if (updatedContent !== content) {\n await writeFileToRoot(rootDir, configFile, updatedContent);\n logger(`${v} Enabled the Intlayer editor in ${colorizePath(configFile)}`);\n } else {\n logger(\n `${v} ${colorizePath(configFile)} already has the Intlayer editor enabled`\n );\n }\n\n return configFile;\n};\n\n/**\n * Sets `routing.mode` in the project's Intlayer configuration file. Returns the\n * config file that was updated, or `undefined` when none was found.\n */\nexport const setRoutingModeInConfig = async (\n rootDir: string,\n mode: RoutingMode\n): Promise<string | undefined> => {\n const configFile = await findIntlayerConfigFile(rootDir);\n\n if (!configFile) return undefined;\n\n const extension = configFile.split('.').pop()!;\n const content = await readFileFromRoot(rootDir, configFile);\n const updatedContent = setIntlayerConfigRoutingMode(content, extension, mode);\n\n if (updatedContent !== content) {\n await writeFileToRoot(rootDir, configFile, updatedContent);\n logger(\n `${v} Set ${colorize(`routing.mode = '${mode}'`, ANSIColors.GREY_LIGHT)} in ${colorizePath(configFile)}`\n );\n }\n\n return configFile;\n};\n\n/**\n * Completes the CMS setup once credentials are received from the login flow:\n * writes them to the environment file and enables the editor in the Intlayer\n * configuration file.\n */\nexport const setupCmsCredentials = async (\n rootDir: string,\n credentials: CmsCredentials\n): Promise<void> => {\n await writeCmsCredentialsToEnv(rootDir, credentials);\n await enableEditorInConfig(rootDir);\n};\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,kCAAkC;CAC7C;CACA;CACA;CACA;CACA;CACD;;;;;;AAOD,MAAM,sBAAsB;CAAC;CAAQ;CAAc;CAAmB;;;;;AAYtE,MAAM,yBAAyB,OAC7B,YAC0E;AAC1E,MAAK,MAAM,aAAa,gCACtB,KAAI,MAAMA,qCAAO,SAAS,UAAU,CAClC,QAAO;;;;;;;AAYb,MAAa,cAAc,OAAO,YAAqC;CACrE,MAAM,UAAU,6BAAS,CAAC,GAAG,oBAAoB,EAAE;EACjD,KAAK;EACL,KAAK;EACL,MAAM;EACN,WAAW;EACZ,CAAC;AAEF,QACE,oBAAoB,MAAM,cAAc,QAAQ,SAAS,UAAU,CAAC,IACpE;;;;;;;AASJ,MAAM,qBACJ,SACA,KACA,UACW;CACX,MAAM,OAAO,GAAG,IAAI,GAAG;CACvB,MAAM,aAAa,IAAI,OAAO,IAAI,IAAI,OAAO,IAAI;AAEjD,KAAI,WAAW,KAAK,QAAQ,CAC1B,QAAO,QAAQ,QAAQ,YAAY,KAAK;AAK1C,QAAO,GAAG,UAFkB,QAAQ,SAAS,KAAK,CAAC,QAAQ,SAAS,KAAK,GAE/B,OAAO,KAAK,KAAK;;;;;;;;AAS7D,MAAa,2BAA2B,OACtC,SACA,EAAE,UAAU,mBACQ;CACpB,MAAM,UAAU,MAAM,YAAY,QAAQ;CAE1C,IAAI,UAAU;AACd,KAAI,MAAMA,qCAAO,SAAS,QAAQ,CAChC,WAAU,MAAMC,+CAAiB,SAAS,QAAQ;CAGpD,IAAI,iBAAiB;AACrB,kBAAiB,kBACf,gBACA,sBACA,SACD;AACD,kBAAiB,kBACf,gBACA,0BACA,aACD;AAED,OAAMC,8CAAgB,SAAS,SAAS,eAAe;AACvD,qCACE,GAAGC,0BAAE,+EAAkD,QAAQ,CAAC,0CAAa,sBAAsBC,wBAAW,WAAW,CAAC,0CAAa,0BAA0BA,wBAAW,WAAW,CAAC,GACzL;AAED,QAAO;;;;;;;;;AAUT,MAAa,uBAAuB,OAClC,YACgC;CAChC,MAAM,aAAa,MAAM,uBAAuB,QAAQ;AAExD,KAAI,CAAC,YAAY;AACf,sCACE,GAAGC,0BAAE,uEACL,EAAE,OAAO,QAAQ,CAClB;AACD;;AAKF,KAFkB,WAAW,MAAM,IAAI,CAAC,KAE3B,KAAK,QAAQ;AACxB,sCACE,GAAGA,0BAAE,6CAAgB,WAAW,CAAC,0HACjC,EAAE,OAAO,QAAQ,CAClB;AACD;;CAGF,MAAM,UAAU,MAAMJ,+CAAiB,SAAS,WAAW;CAC3D,MAAM,iBAAiBK,iEAA2B,QAAQ;AAE1D,KAAI,mBAAmB,SAAS;AAC9B,QAAMJ,8CAAgB,SAAS,YAAY,eAAe;AAC1D,sCAAO,GAAGC,0BAAE,4EAA+C,WAAW,GAAG;OAEzE,qCACE,GAAGA,0BAAE,6CAAgB,WAAW,CAAC,0CAClC;AAGH,QAAO;;;;;;AAOT,MAAa,yBAAyB,OACpC,SACA,SACgC;CAChC,MAAM,aAAa,MAAM,uBAAuB,QAAQ;AAExD,KAAI,CAAC,WAAY,QAAO;CAExB,MAAM,YAAY,WAAW,MAAM,IAAI,CAAC,KAAK;CAC7C,MAAM,UAAU,MAAMF,+CAAiB,SAAS,WAAW;CAC3D,MAAM,iBAAiBM,mEAA6B,SAAS,WAAW,KAAK;AAE7E,KAAI,mBAAmB,SAAS;AAC9B,QAAML,8CAAgB,SAAS,YAAY,eAAe;AAC1D,sCACE,GAAGC,0BAAE,6CAAgB,mBAAmB,KAAK,IAAIC,wBAAW,WAAW,CAAC,gDAAmB,WAAW,GACvG;;AAGH,QAAO;;;;;;;AAQT,MAAa,sBAAsB,OACjC,SACA,gBACkB;AAClB,OAAM,yBAAyB,SAAS,YAAY;AACpD,OAAM,qBAAqB,QAAQ"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_init_frameworkSetup_nextAppRouter_index = require('./nextAppRouter/index.cjs');
|
|
3
|
+
const require_init_frameworkSetup_tanstackStart_index = require('./tanstackStart/index.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/init/frameworkSetup/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* Registered framework adapters, tried in order. The first one whose `detect`
|
|
8
|
+
* returns true handles the project. Add new adapters (Nuxt, Vite + React, …)
|
|
9
|
+
* here as they are implemented.
|
|
10
|
+
*/
|
|
11
|
+
const adapters = [require_init_frameworkSetup_nextAppRouter_index.nextAppRouterAdapter, require_init_frameworkSetup_tanstackStart_index.tanStackStartAdapter];
|
|
12
|
+
/**
|
|
13
|
+
* Runs framework-specific scaffolding (middleware/proxy, providers in
|
|
14
|
+
* layout/page, example content) for the first adapter that matches the project.
|
|
15
|
+
* No-ops when no adapter recognizes the project. Each adapter is idempotent and
|
|
16
|
+
* non-destructive, so this is safe to run on existing applications.
|
|
17
|
+
*/
|
|
18
|
+
const setupFramework = async (context) => {
|
|
19
|
+
for (const adapter of adapters) if (await adapter.detect(context)) {
|
|
20
|
+
await adapter.setup(context);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.setupFramework = setupFramework;
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["nextAppRouterAdapter","tanStackStartAdapter"],"sources":["../../../../src/init/frameworkSetup/index.ts"],"sourcesContent":["import { nextAppRouterAdapter } from './nextAppRouter';\nimport { tanStackStartAdapter } from './tanstackStart';\nimport type { FrameworkAdapter, FrameworkSetupContext } from './types';\n\nexport type { FrameworkAdapter, FrameworkSetupContext } from './types';\n\n/**\n * Registered framework adapters, tried in order. The first one whose `detect`\n * returns true handles the project. Add new adapters (Nuxt, Vite + React, …)\n * here as they are implemented.\n */\nconst adapters: FrameworkAdapter[] = [\n nextAppRouterAdapter,\n tanStackStartAdapter,\n];\n\n/**\n * Runs framework-specific scaffolding (middleware/proxy, providers in\n * layout/page, example content) for the first adapter that matches the project.\n * No-ops when no adapter recognizes the project. Each adapter is idempotent and\n * non-destructive, so this is safe to run on existing applications.\n */\nexport const setupFramework = async (\n context: FrameworkSetupContext\n): Promise<void> => {\n for (const adapter of adapters) {\n if (await adapter.detect(context)) {\n await adapter.setup(context);\n return;\n }\n }\n};\n"],"mappings":";;;;;;;;;;AAWA,MAAM,WAA+B,CACnCA,sEACAC,qEACD;;;;;;;AAQD,MAAa,iBAAiB,OAC5B,YACkB;AAClB,MAAK,MAAM,WAAW,SACpB,KAAI,MAAM,QAAQ,OAAO,QAAQ,EAAE;AACjC,QAAM,QAAQ,MAAM,QAAQ;AAC5B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_init_utils_fileSystem = require('../../utils/fileSystem.cjs');
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
|
|
6
|
+
//#region src/init/frameworkSetup/nextAppRouter/detect.ts
|
|
7
|
+
/** Script extensions probed when locating an App Router convention file. */
|
|
8
|
+
const SCRIPT_EXTENSIONS = [
|
|
9
|
+
"tsx",
|
|
10
|
+
"jsx",
|
|
11
|
+
"ts",
|
|
12
|
+
"js"
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Detects the Next.js App Router directory, preferring `src/app` over `app`.
|
|
16
|
+
* Returns `null` when neither exists (e.g. a Pages Router project).
|
|
17
|
+
*/
|
|
18
|
+
const detectNextAppDir = async (rootDir) => {
|
|
19
|
+
if (await require_init_utils_fileSystem.exists(rootDir, (0, node_path.join)("src", "app"))) return {
|
|
20
|
+
appDir: (0, node_path.join)("src", "app"),
|
|
21
|
+
srcDir: "src"
|
|
22
|
+
};
|
|
23
|
+
if (await require_init_utils_fileSystem.exists(rootDir, "app")) return {
|
|
24
|
+
appDir: "app",
|
|
25
|
+
srcDir: ""
|
|
26
|
+
};
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Finds an existing App Router convention file (e.g. `layout`, `page`) within
|
|
31
|
+
* `dir`, trying each known script extension. Returns the matching relative path
|
|
32
|
+
* or `null`.
|
|
33
|
+
*/
|
|
34
|
+
const findAppFile = async (rootDir, dir, baseName) => {
|
|
35
|
+
for (const extension of SCRIPT_EXTENSIONS) {
|
|
36
|
+
const candidate = (0, node_path.join)(dir, `${baseName}.${extension}`);
|
|
37
|
+
if (await require_init_utils_fileSystem.exists(rootDir, candidate)) return candidate;
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Returns true when the dependency `version` range targets a major >= `major`.
|
|
43
|
+
* Tolerant of leading range characters, e.g. `^16.0.0`, `~16`, `16.1.0`.
|
|
44
|
+
*/
|
|
45
|
+
const isVersionAtLeast = (version, major) => {
|
|
46
|
+
if (!version || typeof version !== "string") return false;
|
|
47
|
+
const match = version.match(/(\d+)/);
|
|
48
|
+
if (!match?.[1]) return false;
|
|
49
|
+
return parseInt(match[1], 10) >= major;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.detectNextAppDir = detectNextAppDir;
|
|
54
|
+
exports.findAppFile = findAppFile;
|
|
55
|
+
exports.isVersionAtLeast = isVersionAtLeast;
|
|
56
|
+
//# sourceMappingURL=detect.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.cjs","names":["exists"],"sources":["../../../../../src/init/frameworkSetup/nextAppRouter/detect.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { exists } from '../../utils/fileSystem';\n\n/** Script extensions probed when locating an App Router convention file. */\nconst SCRIPT_EXTENSIONS = ['tsx', 'jsx', 'ts', 'js'] as const;\n\n/** Location of the Next.js App Router directory within the project. */\nexport type NextAppDirInfo = {\n /** App Router directory relative to the root, e.g. `src/app` or `app`. */\n appDir: string;\n /** `src` when the project uses a `src/` directory, otherwise `''`. */\n srcDir: string;\n};\n\n/**\n * Detects the Next.js App Router directory, preferring `src/app` over `app`.\n * Returns `null` when neither exists (e.g. a Pages Router project).\n */\nexport const detectNextAppDir = async (\n rootDir: string\n): Promise<NextAppDirInfo | null> => {\n if (await exists(rootDir, join('src', 'app'))) {\n return { appDir: join('src', 'app'), srcDir: 'src' };\n }\n if (await exists(rootDir, 'app')) {\n return { appDir: 'app', srcDir: '' };\n }\n return null;\n};\n\n/**\n * Finds an existing App Router convention file (e.g. `layout`, `page`) within\n * `dir`, trying each known script extension. Returns the matching relative path\n * or `null`.\n */\nexport const findAppFile = async (\n rootDir: string,\n dir: string,\n baseName: string\n): Promise<string | null> => {\n for (const extension of SCRIPT_EXTENSIONS) {\n const candidate = join(dir, `${baseName}.${extension}`);\n if (await exists(rootDir, candidate)) {\n return candidate;\n }\n }\n return null;\n};\n\n/**\n * Returns true when the dependency `version` range targets a major >= `major`.\n * Tolerant of leading range characters, e.g. `^16.0.0`, `~16`, `16.1.0`.\n */\nexport const isVersionAtLeast = (\n version: string | undefined,\n major: number\n): boolean => {\n if (!version || typeof version !== 'string') return false;\n const match = version.match(/(\\d+)/);\n if (!match?.[1]) return false;\n return parseInt(match[1], 10) >= major;\n};\n"],"mappings":";;;;;;;AAIA,MAAM,oBAAoB;CAAC;CAAO;CAAO;CAAM;CAAK;;;;;AAcpD,MAAa,mBAAmB,OAC9B,YACmC;AACnC,KAAI,MAAMA,qCAAO,6BAAc,OAAO,MAAM,CAAC,CAC3C,QAAO;EAAE,4BAAa,OAAO,MAAM;EAAE,QAAQ;EAAO;AAEtD,KAAI,MAAMA,qCAAO,SAAS,MAAM,CAC9B,QAAO;EAAE,QAAQ;EAAO,QAAQ;EAAI;AAEtC,QAAO;;;;;;;AAQT,MAAa,cAAc,OACzB,SACA,KACA,aAC2B;AAC3B,MAAK,MAAM,aAAa,mBAAmB;EACzC,MAAM,gCAAiB,KAAK,GAAG,SAAS,GAAG,YAAY;AACvD,MAAI,MAAMA,qCAAO,SAAS,UAAU,CAClC,QAAO;;AAGX,QAAO;;;;;;AAOT,MAAa,oBACX,SACA,UACY;AACZ,KAAI,CAAC,WAAW,OAAO,YAAY,SAAU,QAAO;CACpD,MAAM,QAAQ,QAAQ,MAAM,QAAQ;AACpC,KAAI,CAAC,QAAQ,GAAI,QAAO;AACxB,QAAO,SAAS,MAAM,IAAI,GAAG,IAAI"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_init_utils_fileSystem = require('../../utils/fileSystem.cjs');
|
|
4
|
+
const require_init_frameworkSetup_nextAppRouter_detect = require('./detect.cjs');
|
|
5
|
+
const require_init_frameworkSetup_nextAppRouter_restructure = require('./restructure.cjs');
|
|
6
|
+
const require_init_frameworkSetup_nextAppRouter_templates = require('./templates.cjs');
|
|
7
|
+
const require_init_frameworkSetup_nextAppRouter_transforms = require('./transforms.cjs');
|
|
8
|
+
let node_path = require("node:path");
|
|
9
|
+
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
10
|
+
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
11
|
+
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
|
|
12
|
+
|
|
13
|
+
//#region src/init/frameworkSetup/nextAppRouter/index.ts
|
|
14
|
+
/**
|
|
15
|
+
* Creates the locale-detection proxy (Next >= 16) or middleware (Next < 16),
|
|
16
|
+
* but only when neither already exists, so a user's custom file is never
|
|
17
|
+
* touched. Placed next to the app directory's parent (`src/` when present).
|
|
18
|
+
*/
|
|
19
|
+
const ensureProxyOrMiddleware = async (rootDir, srcDir, isNext16) => {
|
|
20
|
+
const baseDir = srcDir || ".";
|
|
21
|
+
for (const candidate of [
|
|
22
|
+
"proxy.ts",
|
|
23
|
+
"proxy.js",
|
|
24
|
+
"middleware.ts",
|
|
25
|
+
"middleware.js"
|
|
26
|
+
]) if (await require_init_utils_fileSystem.exists(rootDir, (0, node_path.join)(baseDir, candidate))) {
|
|
27
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} ${(0, _intlayer_config_logger.colorizePath)((0, node_path.join)(baseDir, candidate))} already exists, leaving it untouched`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const fileName = isNext16 ? "proxy.ts" : "middleware.ts";
|
|
31
|
+
const content = isNext16 ? require_init_frameworkSetup_nextAppRouter_templates.PROXY_TEMPLATE : require_init_frameworkSetup_nextAppRouter_templates.MIDDLEWARE_TEMPLATE;
|
|
32
|
+
const targetPath = (0, node_path.join)(baseDir, fileName);
|
|
33
|
+
if (srcDir) await require_init_utils_fileSystem.ensureDirectory(rootDir, srcDir);
|
|
34
|
+
await require_init_utils_fileSystem.writeFileToRoot(rootDir, targetPath, content);
|
|
35
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Created ${(0, _intlayer_config_logger.colorizePath)(targetPath)} for locale detection`);
|
|
36
|
+
};
|
|
37
|
+
/** Logs the outcome of a layout/page provider-wrap transform. */
|
|
38
|
+
const logTransformOutcome = (filePath, result) => {
|
|
39
|
+
switch (result.status) {
|
|
40
|
+
case "wrapped":
|
|
41
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Added Intlayer provider to ${(0, _intlayer_config_logger.colorizePath)(filePath)}`);
|
|
42
|
+
break;
|
|
43
|
+
case "already":
|
|
44
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} ${(0, _intlayer_config_logger.colorizePath)(filePath)} already wraps the Intlayer provider`);
|
|
45
|
+
break;
|
|
46
|
+
case "skipped-client":
|
|
47
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.x} ${(0, _intlayer_config_logger.colorizePath)(filePath)} is a client component — add the Intlayer provider manually.`, { level: "warn" });
|
|
48
|
+
break;
|
|
49
|
+
case "skipped":
|
|
50
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.x} Could not safely add the Intlayer provider to ${(0, _intlayer_config_logger.colorizePath)(filePath)} — please wire it manually.`, { level: "warn" });
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
/** Transforms an existing file in place, writing it back only when changed. */
|
|
55
|
+
const transformExistingFile = async (rootDir, filePath, transform) => {
|
|
56
|
+
const result = transform(await require_init_utils_fileSystem.readFileFromRoot(rootDir, filePath));
|
|
57
|
+
if (result.status === "wrapped") await require_init_utils_fileSystem.writeFileToRoot(rootDir, filePath, result.code);
|
|
58
|
+
logTransformOutcome(filePath, result);
|
|
59
|
+
};
|
|
60
|
+
/** Creates a file from a template only when it does not already exist. */
|
|
61
|
+
const createIfMissing = async (rootDir, filePath, content, description) => {
|
|
62
|
+
if (await require_init_utils_fileSystem.exists(rootDir, filePath)) return false;
|
|
63
|
+
await require_init_utils_fileSystem.writeFileToRoot(rootDir, filePath, content);
|
|
64
|
+
(0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Created ${description} ${(0, _intlayer_config_logger.colorizePath)(filePath)}`);
|
|
65
|
+
return true;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Next.js App Router adapter. Scaffolds the locale proxy/middleware, restructures
|
|
69
|
+
* the app into a `[locale]` segment, and wraps the layout/page with the Intlayer
|
|
70
|
+
* providers — all idempotently and without overwriting recognizable user code.
|
|
71
|
+
*/
|
|
72
|
+
const nextAppRouterAdapter = {
|
|
73
|
+
name: "Next.js App Router",
|
|
74
|
+
detect: async ({ rootDir, allDeps }) => {
|
|
75
|
+
if (!allDeps.next) return false;
|
|
76
|
+
return await require_init_frameworkSetup_nextAppRouter_detect.detectNextAppDir(rootDir) !== null;
|
|
77
|
+
},
|
|
78
|
+
setup: async ({ rootDir, allDeps, useTypeScript }) => {
|
|
79
|
+
const appDirInfo = await require_init_frameworkSetup_nextAppRouter_detect.detectNextAppDir(rootDir);
|
|
80
|
+
if (!appDirInfo) return;
|
|
81
|
+
const { appDir, srcDir } = appDirInfo;
|
|
82
|
+
const isNext16 = require_init_frameworkSetup_nextAppRouter_detect.isVersionAtLeast(allDeps.next, 16);
|
|
83
|
+
const scriptExtension = useTypeScript ? "tsx" : "jsx";
|
|
84
|
+
(0, _intlayer_config_logger.logger)((0, _intlayer_config_logger.colorize)("Setting up Next.js App Router integration...", _intlayer_config_colors.CYAN));
|
|
85
|
+
await ensureProxyOrMiddleware(rootDir, srcDir, isNext16);
|
|
86
|
+
const restructureResult = await require_init_frameworkSetup_nextAppRouter_restructure.restructureAppIntoLocale(rootDir, appDir);
|
|
87
|
+
if (restructureResult.status === "moved") (0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Restructured app routes under ${(0, _intlayer_config_logger.colorizePath)((0, node_path.join)(appDir, "[locale]"))}: ${restructureResult.movedEntries.map((entry) => (0, _intlayer_config_logger.colorize)(entry, _intlayer_config_colors.MAGENTA)).join(", ")}`);
|
|
88
|
+
else if (restructureResult.status === "already-structured") (0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} ${(0, _intlayer_config_logger.colorizePath)((0, node_path.join)(appDir, "[locale]"))} already exists, skipping restructure`);
|
|
89
|
+
const localeDir = (0, node_path.join)(appDir, "[locale]");
|
|
90
|
+
await require_init_utils_fileSystem.ensureDirectory(rootDir, localeDir);
|
|
91
|
+
await createIfMissing(rootDir, (0, node_path.join)(appDir, `layout.${scriptExtension}`), useTypeScript ? require_init_frameworkSetup_nextAppRouter_templates.ROOT_LAYOUT_TEMPLATE_TS : require_init_frameworkSetup_nextAppRouter_templates.ROOT_LAYOUT_TEMPLATE_JS, "root layout");
|
|
92
|
+
const existingLayout = await require_init_frameworkSetup_nextAppRouter_detect.findAppFile(rootDir, localeDir, "layout");
|
|
93
|
+
if (existingLayout) await transformExistingFile(rootDir, existingLayout, require_init_frameworkSetup_nextAppRouter_transforms.wrapLayoutWithProvider);
|
|
94
|
+
else await createIfMissing(rootDir, (0, node_path.join)(localeDir, `layout.${scriptExtension}`), useTypeScript ? require_init_frameworkSetup_nextAppRouter_templates.LOCALE_LAYOUT_TEMPLATE_TS : require_init_frameworkSetup_nextAppRouter_templates.LOCALE_LAYOUT_TEMPLATE_JS, "locale layout");
|
|
95
|
+
const existingPage = await require_init_frameworkSetup_nextAppRouter_detect.findAppFile(rootDir, localeDir, "page");
|
|
96
|
+
if (existingPage) await transformExistingFile(rootDir, existingPage, require_init_frameworkSetup_nextAppRouter_transforms.wrapPageWithProvider);
|
|
97
|
+
else await createIfMissing(rootDir, (0, node_path.join)(localeDir, `page.${scriptExtension}`), useTypeScript ? require_init_frameworkSetup_nextAppRouter_templates.LOCALE_PAGE_TEMPLATE_TS : require_init_frameworkSetup_nextAppRouter_templates.LOCALE_PAGE_TEMPLATE_JS, "locale page");
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
exports.nextAppRouterAdapter = nextAppRouterAdapter;
|
|
103
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["exists","v","PROXY_TEMPLATE","MIDDLEWARE_TEMPLATE","ensureDirectory","writeFileToRoot","x","readFileFromRoot","detectNextAppDir","isVersionAtLeast","ANSIColors","restructureAppIntoLocale","ROOT_LAYOUT_TEMPLATE_TS","ROOT_LAYOUT_TEMPLATE_JS","findAppFile","wrapLayoutWithProvider","LOCALE_LAYOUT_TEMPLATE_TS","LOCALE_LAYOUT_TEMPLATE_JS","wrapPageWithProvider","LOCALE_PAGE_TEMPLATE_TS","LOCALE_PAGE_TEMPLATE_JS"],"sources":["../../../../../src/init/frameworkSetup/nextAppRouter/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, colorizePath, logger, v, x } from '@intlayer/config/logger';\nimport {\n ensureDirectory,\n exists,\n readFileFromRoot,\n writeFileToRoot,\n} from '../../utils/fileSystem';\nimport type { FrameworkAdapter, FrameworkSetupContext } from '../types';\nimport { detectNextAppDir, findAppFile, isVersionAtLeast } from './detect';\nimport { restructureAppIntoLocale } from './restructure';\nimport {\n LOCALE_LAYOUT_TEMPLATE_JS,\n LOCALE_LAYOUT_TEMPLATE_TS,\n LOCALE_PAGE_TEMPLATE_JS,\n LOCALE_PAGE_TEMPLATE_TS,\n MIDDLEWARE_TEMPLATE,\n PROXY_TEMPLATE,\n ROOT_LAYOUT_TEMPLATE_JS,\n ROOT_LAYOUT_TEMPLATE_TS,\n} from './templates';\nimport {\n type TransformResult,\n wrapLayoutWithProvider,\n wrapPageWithProvider,\n} from './transforms';\n\n/**\n * Creates the locale-detection proxy (Next >= 16) or middleware (Next < 16),\n * but only when neither already exists, so a user's custom file is never\n * touched. Placed next to the app directory's parent (`src/` when present).\n */\nconst ensureProxyOrMiddleware = async (\n rootDir: string,\n srcDir: string,\n isNext16: boolean\n): Promise<void> => {\n const baseDir = srcDir || '.';\n const proxyCandidates = [\n 'proxy.ts',\n 'proxy.js',\n 'middleware.ts',\n 'middleware.js',\n ];\n\n for (const candidate of proxyCandidates) {\n if (await exists(rootDir, join(baseDir, candidate))) {\n logger(\n `${v} ${colorizePath(join(baseDir, candidate))} already exists, leaving it untouched`\n );\n return;\n }\n }\n\n const fileName = isNext16 ? 'proxy.ts' : 'middleware.ts';\n const content = isNext16 ? PROXY_TEMPLATE : MIDDLEWARE_TEMPLATE;\n const targetPath = join(baseDir, fileName);\n\n if (srcDir) await ensureDirectory(rootDir, srcDir);\n await writeFileToRoot(rootDir, targetPath, content);\n logger(`${v} Created ${colorizePath(targetPath)} for locale detection`);\n};\n\n/** Logs the outcome of a layout/page provider-wrap transform. */\nconst logTransformOutcome = (\n filePath: string,\n result: TransformResult\n): void => {\n switch (result.status) {\n case 'wrapped':\n logger(`${v} Added Intlayer provider to ${colorizePath(filePath)}`);\n break;\n case 'already':\n logger(\n `${v} ${colorizePath(filePath)} already wraps the Intlayer provider`\n );\n break;\n case 'skipped-client':\n logger(\n `${x} ${colorizePath(filePath)} is a client component — add the Intlayer provider manually.`,\n { level: 'warn' }\n );\n break;\n case 'skipped':\n logger(\n `${x} Could not safely add the Intlayer provider to ${colorizePath(filePath)} — please wire it manually.`,\n { level: 'warn' }\n );\n break;\n }\n};\n\n/** Transforms an existing file in place, writing it back only when changed. */\nconst transformExistingFile = async (\n rootDir: string,\n filePath: string,\n transform: (code: string) => TransformResult\n): Promise<void> => {\n const code = await readFileFromRoot(rootDir, filePath);\n const result = transform(code);\n if (result.status === 'wrapped') {\n await writeFileToRoot(rootDir, filePath, result.code);\n }\n logTransformOutcome(filePath, result);\n};\n\n/** Creates a file from a template only when it does not already exist. */\nconst createIfMissing = async (\n rootDir: string,\n filePath: string,\n content: string,\n description: string\n): Promise<boolean> => {\n if (await exists(rootDir, filePath)) return false;\n await writeFileToRoot(rootDir, filePath, content);\n logger(`${v} Created ${description} ${colorizePath(filePath)}`);\n return true;\n};\n\n/**\n * Next.js App Router adapter. Scaffolds the locale proxy/middleware, restructures\n * the app into a `[locale]` segment, and wraps the layout/page with the Intlayer\n * providers — all idempotently and without overwriting recognizable user code.\n */\nexport const nextAppRouterAdapter: FrameworkAdapter = {\n name: 'Next.js App Router',\n\n detect: async ({ rootDir, allDeps }) => {\n if (!allDeps.next) return false;\n return (await detectNextAppDir(rootDir)) !== null;\n },\n\n setup: async ({ rootDir, allDeps, useTypeScript }: FrameworkSetupContext) => {\n const appDirInfo = await detectNextAppDir(rootDir);\n if (!appDirInfo) return;\n\n const { appDir, srcDir } = appDirInfo;\n const isNext16 = isVersionAtLeast(allDeps.next, 16);\n const scriptExtension = useTypeScript ? 'tsx' : 'jsx';\n\n logger(\n colorize('Setting up Next.js App Router integration...', ANSIColors.CYAN)\n );\n\n // 1. Locale detection proxy / middleware (create only when absent).\n await ensureProxyOrMiddleware(rootDir, srcDir, isNext16);\n\n // 2. Move routable files under a `[locale]` segment (idempotent).\n const restructureResult = await restructureAppIntoLocale(rootDir, appDir);\n if (restructureResult.status === 'moved') {\n logger(\n `${v} Restructured app routes under ${colorizePath(join(appDir, '[locale]'))}: ${restructureResult.movedEntries\n .map((entry) => colorize(entry, ANSIColors.MAGENTA))\n .join(', ')}`\n );\n } else if (restructureResult.status === 'already-structured') {\n logger(\n `${v} ${colorizePath(join(appDir, '[locale]'))} already exists, skipping restructure`\n );\n }\n\n const localeDir = join(appDir, '[locale]');\n await ensureDirectory(rootDir, localeDir);\n\n // 3. Minimal pass-through root layout (the `[locale]` layout owns `<html>`).\n await createIfMissing(\n rootDir,\n join(appDir, `layout.${scriptExtension}`),\n useTypeScript ? ROOT_LAYOUT_TEMPLATE_TS : ROOT_LAYOUT_TEMPLATE_JS,\n 'root layout'\n );\n\n // 4. Locale layout — transform an existing one, else scaffold from template.\n const existingLayout = await findAppFile(rootDir, localeDir, 'layout');\n if (existingLayout) {\n await transformExistingFile(\n rootDir,\n existingLayout,\n wrapLayoutWithProvider\n );\n } else {\n await createIfMissing(\n rootDir,\n join(localeDir, `layout.${scriptExtension}`),\n useTypeScript ? LOCALE_LAYOUT_TEMPLATE_TS : LOCALE_LAYOUT_TEMPLATE_JS,\n 'locale layout'\n );\n }\n\n // 5. Locale page — transform an existing one, else scaffold from template.\n const existingPage = await findAppFile(rootDir, localeDir, 'page');\n if (existingPage) {\n await transformExistingFile(rootDir, existingPage, wrapPageWithProvider);\n } else {\n await createIfMissing(\n rootDir,\n join(localeDir, `page.${scriptExtension}`),\n useTypeScript ? LOCALE_PAGE_TEMPLATE_TS : LOCALE_PAGE_TEMPLATE_JS,\n 'locale page'\n );\n }\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,MAAM,0BAA0B,OAC9B,SACA,QACA,aACkB;CAClB,MAAM,UAAU,UAAU;AAQ1B,MAAK,MAAM,aAAa;EANtB;EACA;EACA;EACA;EAGqC,CACrC,KAAI,MAAMA,qCAAO,6BAAc,SAAS,UAAU,CAAC,EAAE;AACnD,sCACE,GAAGC,0BAAE,iEAAqB,SAAS,UAAU,CAAC,CAAC,uCAChD;AACD;;CAIJ,MAAM,WAAW,WAAW,aAAa;CACzC,MAAM,UAAU,WAAWC,qEAAiBC;CAC5C,MAAM,iCAAkB,SAAS,SAAS;AAE1C,KAAI,OAAQ,OAAMC,8CAAgB,SAAS,OAAO;AAClD,OAAMC,8CAAgB,SAAS,YAAY,QAAQ;AACnD,qCAAO,GAAGJ,0BAAE,qDAAwB,WAAW,CAAC,uBAAuB;;;AAIzE,MAAM,uBACJ,UACA,WACS;AACT,SAAQ,OAAO,QAAf;EACE,KAAK;AACH,uCAAO,GAAGA,0BAAE,wEAA2C,SAAS,GAAG;AACnE;EACF,KAAK;AACH,uCACE,GAAGA,0BAAE,6CAAgB,SAAS,CAAC,sCAChC;AACD;EACF,KAAK;AACH,uCACE,GAAGK,0BAAE,6CAAgB,SAAS,CAAC,+DAC/B,EAAE,OAAO,QAAQ,CAClB;AACD;EACF,KAAK;AACH,uCACE,GAAGA,0BAAE,2FAA8D,SAAS,CAAC,8BAC7E,EAAE,OAAO,QAAQ,CAClB;AACD;;;;AAKN,MAAM,wBAAwB,OAC5B,SACA,UACA,cACkB;CAElB,MAAM,SAAS,UAAU,MADNC,+CAAiB,SAAS,SAAS,CACxB;AAC9B,KAAI,OAAO,WAAW,UACpB,OAAMF,8CAAgB,SAAS,UAAU,OAAO,KAAK;AAEvD,qBAAoB,UAAU,OAAO;;;AAIvC,MAAM,kBAAkB,OACtB,SACA,UACA,SACA,gBACqB;AACrB,KAAI,MAAML,qCAAO,SAAS,SAAS,CAAE,QAAO;AAC5C,OAAMK,8CAAgB,SAAS,UAAU,QAAQ;AACjD,qCAAO,GAAGJ,0BAAE,WAAW,YAAY,6CAAgB,SAAS,GAAG;AAC/D,QAAO;;;;;;;AAQT,MAAa,uBAAyC;CACpD,MAAM;CAEN,QAAQ,OAAO,EAAE,SAAS,cAAc;AACtC,MAAI,CAAC,QAAQ,KAAM,QAAO;AAC1B,SAAQ,MAAMO,kEAAiB,QAAQ,KAAM;;CAG/C,OAAO,OAAO,EAAE,SAAS,SAAS,oBAA2C;EAC3E,MAAM,aAAa,MAAMA,kEAAiB,QAAQ;AAClD,MAAI,CAAC,WAAY;EAEjB,MAAM,EAAE,QAAQ,WAAW;EAC3B,MAAM,WAAWC,kEAAiB,QAAQ,MAAM,GAAG;EACnD,MAAM,kBAAkB,gBAAgB,QAAQ;AAEhD,4EACW,gDAAgDC,wBAAW,KAAK,CAC1E;AAGD,QAAM,wBAAwB,SAAS,QAAQ,SAAS;EAGxD,MAAM,oBAAoB,MAAMC,+EAAyB,SAAS,OAAO;AACzE,MAAI,kBAAkB,WAAW,QAC/B,qCACE,GAAGV,0BAAE,+FAAmD,QAAQ,WAAW,CAAC,CAAC,IAAI,kBAAkB,aAChG,KAAK,gDAAmB,OAAOS,wBAAW,QAAQ,CAAC,CACnD,KAAK,KAAK,GACd;WACQ,kBAAkB,WAAW,qBACtC,qCACE,GAAGT,0BAAE,iEAAqB,QAAQ,WAAW,CAAC,CAAC,uCAChD;EAGH,MAAM,gCAAiB,QAAQ,WAAW;AAC1C,QAAMG,8CAAgB,SAAS,UAAU;AAGzC,QAAM,gBACJ,6BACK,QAAQ,UAAU,kBAAkB,EACzC,gBAAgBQ,8EAA0BC,6EAC1C,cACD;EAGD,MAAM,iBAAiB,MAAMC,6DAAY,SAAS,WAAW,SAAS;AACtE,MAAI,eACF,OAAM,sBACJ,SACA,gBACAC,4EACD;MAED,OAAM,gBACJ,6BACK,WAAW,UAAU,kBAAkB,EAC5C,gBAAgBC,gFAA4BC,+EAC5C,gBACD;EAIH,MAAM,eAAe,MAAMH,6DAAY,SAAS,WAAW,OAAO;AAClE,MAAI,aACF,OAAM,sBAAsB,SAAS,cAAcI,0EAAqB;MAExE,OAAM,gBACJ,6BACK,WAAW,QAAQ,kBAAkB,EAC1C,gBAAgBC,8EAA0BC,6EAC1C,cACD;;CAGN"}
|