@farris/cli 2.1.2 → 2.1.4
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/lib/commands/build-components.js +39 -39
- package/lib/commands/build-components.js.map +1 -1
- package/lib/commands/build-css.js +38 -38
- package/lib/commands/build-css.js.map +1 -1
- package/lib/commands/build-lib.js +25 -25
- package/lib/commands/build.js +14 -14
- package/lib/commands/build.js.map +1 -1
- package/lib/commands/create-app.js +54 -54
- package/lib/commands/dev-serve.js +18 -18
- package/lib/commands/extract-i18n.js +74 -74
- package/lib/commands/extract-i18n.js.map +1 -1
- package/lib/commands/generate/api.js +186 -186
- package/lib/commands/generate/api.js.map +1 -1
- package/lib/commands/generate/common.js +100 -100
- package/lib/commands/generate/common.js.map +1 -1
- package/lib/commands/generate/component.js +163 -163
- package/lib/commands/generate/component.js.map +1 -1
- package/lib/commands/generate/view.js +193 -193
- package/lib/commands/generate/view.js.map +1 -1
- package/lib/commands/preview-serve.js +16 -16
- package/lib/commands/workspace/add-app.js +180 -180
- package/lib/commands/workspace/add-app.js.map +1 -1
- package/lib/commands/workspace/create.js +379 -379
- package/lib/commands/workspace/create.js.map +1 -1
- package/lib/commands/workspace/inspect.js +30 -30
- package/lib/commands/workspace/inspect.js.map +1 -1
- package/lib/commands/workspace/verify.js +38 -38
- package/lib/commands/workspace/verify.js.map +1 -1
- package/lib/common/constant.js +64 -63
- package/lib/common/constant.js.map +1 -1
- package/lib/common/generate-app.js +44 -44
- package/lib/common/get-dependencies.js +9 -9
- package/lib/common/get-farris-config.js +11 -11
- package/lib/common/get-farris-config.js.map +1 -1
- package/lib/common/get-version.js +6 -6
- package/lib/common/get-vite-config.js +105 -105
- package/lib/common/get-vite-config.js.map +1 -1
- package/lib/common/output.js +94 -94
- package/lib/common/output.js.map +1 -1
- package/lib/common/safety.js +171 -171
- package/lib/common/safety.js.map +1 -1
- package/lib/common/template-renderer.js +114 -114
- package/lib/common/template-renderer.js.map +1 -1
- package/lib/common/transaction.js +83 -83
- package/lib/common/transaction.js.map +1 -1
- package/lib/common/verifier.js +146 -146
- package/lib/common/verifier.js.map +1 -1
- package/lib/config/vite-app.js +13 -13
- package/lib/config/vite-common.js +20 -20
- package/lib/config/vite-common.js.map +1 -1
- package/lib/config/vite-component.js +30 -30
- package/lib/config/vite-component.js.map +1 -1
- package/lib/config/vite-lib.js +26 -26
- package/lib/index.js +175 -175
- package/lib/plugins/create-component-style.js +44 -44
- package/lib/plugins/create-package-json.js +33 -33
- package/lib/plugins/create-package-json.js.map +1 -1
- package/lib/plugins/dts.js +8 -8
- package/lib/plugins/html-system.js +9 -9
- package/lib/plugins/replace.js +17 -17
- package/lib/plugins/systemjs-bundle.js +15 -15
- package/lib/plugins/systemjs-bundle.js.map +1 -1
- package/package.json +1 -1
- package/templates/workspace/app/farris.config.mjs +13 -13
- package/templates/workspace/app/index.html +12 -12
- package/templates/workspace/app/package.json +22 -22
- package/templates/workspace/app/src/App.tsx +11 -11
- package/templates/workspace/app/src/main.ts +11 -11
- package/templates/workspace/app/src/router/index.ts +16 -16
- package/templates/workspace/app/src/views/home/composables/use-home.ts +7 -7
- package/templates/workspace/app/src/views/home/home.component.tsx +15 -15
- package/templates/workspace/app/src/views/home/index.ts +4 -4
- package/templates/workspace/app/tsconfig.json +21 -21
- package/templates/workspace/root/README.md +28 -28
- package/templates/workspace/root/package.json +13 -13
- package/templates/workspace/root/pnpm-workspace.yaml +12 -12
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { resolve, join } from 'node:path';
|
|
3
|
-
import { findAppContext, normalizeGeneratorName, toPascalCase, toCamelCase } from './common.js';
|
|
4
|
-
import { Transaction } from '../../common/transaction.js';
|
|
5
|
-
import { sendJson, logInfo, fail, setJsonMode, createSpinner } from '../../common/output.js';
|
|
6
|
-
import { ExitCode } from '../../common/constant.js';
|
|
7
|
-
export async function generateComponent(rawName, options = {}) {
|
|
8
|
-
const isJson = !!options.json;
|
|
9
|
-
setJsonMode(isJson);
|
|
10
|
-
if (!rawName) {
|
|
11
|
-
fail({
|
|
12
|
-
command: 'generate.component',
|
|
13
|
-
error: '必须指定组件名称: farris-cli generate component <name>',
|
|
14
|
-
exitCode: ExitCode.GENERAL_ERROR
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
const normalizedName = normalizeGeneratorName(rawName);
|
|
18
|
-
if (!normalizedName.valid) {
|
|
19
|
-
fail({
|
|
20
|
-
command: 'generate.component',
|
|
21
|
-
error: `非法的组件名称: ${normalizedName.error}`,
|
|
22
|
-
exitCode: ExitCode.GENERAL_ERROR
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
const name = normalizedName.name;
|
|
26
|
-
const pascalName = toPascalCase(name);
|
|
27
|
-
const camelName = toCamelCase(name);
|
|
28
|
-
const withProps = !!options.withProps;
|
|
29
|
-
const style = options.style || 'none';
|
|
30
|
-
const appContext = findAppContext(options.cwd || process.cwd());
|
|
31
|
-
const compDir = join(appContext.srcDir, 'components', name);
|
|
32
|
-
const filesPlanned = [
|
|
33
|
-
join(compDir, 'index.ts'),
|
|
34
|
-
join(compDir, `${name}.component.tsx`)
|
|
35
|
-
];
|
|
36
|
-
if (withProps) {
|
|
37
|
-
filesPlanned.push(join(compDir, `${name}.props.ts`));
|
|
38
|
-
}
|
|
39
|
-
if (style === 'css') {
|
|
40
|
-
filesPlanned.push(join(compDir, `${name}.css`));
|
|
41
|
-
}
|
|
42
|
-
else if (style === 'scss') {
|
|
43
|
-
filesPlanned.push(join(compDir, `${name}.scss`));
|
|
44
|
-
}
|
|
45
|
-
const conflicts = filesPlanned.filter((f) => existsSync(f));
|
|
46
|
-
if (conflicts.length > 0) {
|
|
47
|
-
fail({
|
|
48
|
-
command: 'generate.component',
|
|
49
|
-
error: `组件文件已存在,为保护已有代码已阻断生成: ${conflicts.map((c) => resolve(c)).join(', ')}`,
|
|
50
|
-
exitCode: ExitCode.TARGET_CONFLICT,
|
|
51
|
-
extra: { conflicts }
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
const transaction = new Transaction();
|
|
55
|
-
const spinner = createSpinner(`正在生成组件: ${name}...`);
|
|
56
|
-
spinner.start();
|
|
57
|
-
try {
|
|
58
|
-
mkdirSync(compDir, { recursive: true });
|
|
59
|
-
transaction.recordCreatedDir(compDir);
|
|
60
|
-
const filesCreated = [];
|
|
61
|
-
const filesModified = [];
|
|
62
|
-
// 1. 生成样式文件(若启用)
|
|
63
|
-
let styleImport = '';
|
|
64
|
-
if (style === 'css') {
|
|
65
|
-
const cssPath = join(compDir, `${name}.css`);
|
|
66
|
-
transaction.prepareWrite(cssPath);
|
|
67
|
-
writeFileSync(cssPath, `.f-${name} {\n /* 组件自定义样式 */\n}\n`, 'utf-8');
|
|
68
|
-
filesCreated.push(cssPath);
|
|
69
|
-
styleImport = `import './${name}.css';\n`;
|
|
70
|
-
}
|
|
71
|
-
else if (style === 'scss') {
|
|
72
|
-
const scssPath = join(compDir, `${name}.scss`);
|
|
73
|
-
transaction.prepareWrite(scssPath);
|
|
74
|
-
writeFileSync(scssPath, `.f-${name} {\n /* 组件自定义 SCSS 样式 */\n}\n`, 'utf-8');
|
|
75
|
-
filesCreated.push(scssPath);
|
|
76
|
-
styleImport = `import './${name}.scss';\n`;
|
|
77
|
-
// 幂等确保应用 package.json devDependencies 包含 sass catalog
|
|
78
|
-
const pkgPath = appContext.pkgJsonPath;
|
|
79
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
80
|
-
if (!pkg.devDependencies) {
|
|
81
|
-
pkg.devDependencies = {};
|
|
82
|
-
}
|
|
83
|
-
if (!pkg.devDependencies.sass) {
|
|
84
|
-
transaction.prepareWrite(pkgPath);
|
|
85
|
-
pkg.devDependencies.sass = 'catalog:';
|
|
86
|
-
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n', 'utf-8');
|
|
87
|
-
filesModified.push(pkgPath);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
// 2. 生成 props 文件(若启用)
|
|
91
|
-
if (withProps) {
|
|
92
|
-
const propsPath = join(compDir, `${name}.props.ts`);
|
|
93
|
-
transaction.prepareWrite(propsPath);
|
|
94
|
-
const propsContent = `import type { ExtractPropTypes } from 'vue';
|
|
95
|
-
|
|
96
|
-
export const ${camelName}Props = {
|
|
97
|
-
// 定义组件 Props
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export type ${pascalName}Props = ExtractPropTypes<typeof ${camelName}Props>;
|
|
101
|
-
`;
|
|
102
|
-
writeFileSync(propsPath, propsContent, 'utf-8');
|
|
103
|
-
filesCreated.push(propsPath);
|
|
104
|
-
}
|
|
105
|
-
// 3. 生成 component.tsx
|
|
106
|
-
const componentPath = join(compDir, `${name}.component.tsx`);
|
|
107
|
-
transaction.prepareWrite(componentPath);
|
|
108
|
-
let componentContent = `import { defineComponent } from 'vue';\n`;
|
|
109
|
-
if (withProps) {
|
|
110
|
-
componentContent += `import { ${camelName}Props } from './${name}.props';\n`;
|
|
111
|
-
}
|
|
112
|
-
if (styleImport) {
|
|
113
|
-
componentContent += styleImport;
|
|
114
|
-
}
|
|
115
|
-
componentContent += `\nexport default defineComponent({\n name: '${pascalName}',\n`;
|
|
116
|
-
if (withProps) {
|
|
117
|
-
componentContent += ` props: ${camelName}Props,\n`;
|
|
118
|
-
}
|
|
119
|
-
componentContent += ` setup(${withProps ? 'props, { slots }' : '_, { slots }'}) {\n return () => (\n <div class="f-${name}">\n {slots.default ? slots.default() : '${pascalName}'}\n </div>\n );\n }\n});\n`;
|
|
120
|
-
writeFileSync(componentPath, componentContent, 'utf-8');
|
|
121
|
-
filesCreated.push(componentPath);
|
|
122
|
-
// 4. 生成 index.ts
|
|
123
|
-
const indexPath = join(compDir, 'index.ts');
|
|
124
|
-
transaction.prepareWrite(indexPath);
|
|
125
|
-
let indexContent = `import ${pascalName} from './${name}.component';\n\n`;
|
|
126
|
-
if (withProps) {
|
|
127
|
-
indexContent += `export { ${camelName}Props, type ${pascalName}Props } from './${name}.props';\n`;
|
|
128
|
-
}
|
|
129
|
-
indexContent += `export { ${pascalName} };\nexport default ${pascalName};\n`;
|
|
130
|
-
writeFileSync(indexPath, indexContent, 'utf-8');
|
|
131
|
-
filesCreated.push(indexPath);
|
|
132
|
-
transaction.commit();
|
|
133
|
-
spinner.succeed(`组件 ${name} 生成成功!`);
|
|
134
|
-
if (isJson) {
|
|
135
|
-
sendJson({
|
|
136
|
-
command: 'generate.component',
|
|
137
|
-
ok: true,
|
|
138
|
-
componentName: name,
|
|
139
|
-
pascalName,
|
|
140
|
-
compDir,
|
|
141
|
-
withProps,
|
|
142
|
-
style,
|
|
143
|
-
filesCreated,
|
|
144
|
-
filesModified
|
|
145
|
-
});
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
logInfo(`\n✨ 已成功生成组件: src/components/${name}/`);
|
|
149
|
-
filesCreated.forEach((f) => logInfo(` + ${f}`));
|
|
150
|
-
if (filesModified.length > 0) {
|
|
151
|
-
filesModified.forEach((f) => logInfo(` ~ ${f} (更新依赖)`));
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
catch (err) {
|
|
155
|
-
spinner.fail('生成组件失败,正在回滚...');
|
|
156
|
-
transaction.rollback();
|
|
157
|
-
fail({
|
|
158
|
-
command: 'generate.component',
|
|
159
|
-
error: `生成组件失败: ${err.message}`,
|
|
160
|
-
exitCode: ExitCode.GENERAL_ERROR
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { resolve, join } from 'node:path';
|
|
3
|
+
import { findAppContext, normalizeGeneratorName, toPascalCase, toCamelCase } from './common.js';
|
|
4
|
+
import { Transaction } from '../../common/transaction.js';
|
|
5
|
+
import { sendJson, logInfo, fail, setJsonMode, createSpinner } from '../../common/output.js';
|
|
6
|
+
import { ExitCode } from '../../common/constant.js';
|
|
7
|
+
export async function generateComponent(rawName, options = {}) {
|
|
8
|
+
const isJson = !!options.json;
|
|
9
|
+
setJsonMode(isJson);
|
|
10
|
+
if (!rawName) {
|
|
11
|
+
fail({
|
|
12
|
+
command: 'generate.component',
|
|
13
|
+
error: '必须指定组件名称: farris-cli generate component <name>',
|
|
14
|
+
exitCode: ExitCode.GENERAL_ERROR
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const normalizedName = normalizeGeneratorName(rawName);
|
|
18
|
+
if (!normalizedName.valid) {
|
|
19
|
+
fail({
|
|
20
|
+
command: 'generate.component',
|
|
21
|
+
error: `非法的组件名称: ${normalizedName.error}`,
|
|
22
|
+
exitCode: ExitCode.GENERAL_ERROR
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const name = normalizedName.name;
|
|
26
|
+
const pascalName = toPascalCase(name);
|
|
27
|
+
const camelName = toCamelCase(name);
|
|
28
|
+
const withProps = !!options.withProps;
|
|
29
|
+
const style = options.style || 'none';
|
|
30
|
+
const appContext = findAppContext(options.cwd || process.cwd());
|
|
31
|
+
const compDir = join(appContext.srcDir, 'components', name);
|
|
32
|
+
const filesPlanned = [
|
|
33
|
+
join(compDir, 'index.ts'),
|
|
34
|
+
join(compDir, `${name}.component.tsx`)
|
|
35
|
+
];
|
|
36
|
+
if (withProps) {
|
|
37
|
+
filesPlanned.push(join(compDir, `${name}.props.ts`));
|
|
38
|
+
}
|
|
39
|
+
if (style === 'css') {
|
|
40
|
+
filesPlanned.push(join(compDir, `${name}.css`));
|
|
41
|
+
}
|
|
42
|
+
else if (style === 'scss') {
|
|
43
|
+
filesPlanned.push(join(compDir, `${name}.scss`));
|
|
44
|
+
}
|
|
45
|
+
const conflicts = filesPlanned.filter((f) => existsSync(f));
|
|
46
|
+
if (conflicts.length > 0) {
|
|
47
|
+
fail({
|
|
48
|
+
command: 'generate.component',
|
|
49
|
+
error: `组件文件已存在,为保护已有代码已阻断生成: ${conflicts.map((c) => resolve(c)).join(', ')}`,
|
|
50
|
+
exitCode: ExitCode.TARGET_CONFLICT,
|
|
51
|
+
extra: { conflicts }
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const transaction = new Transaction();
|
|
55
|
+
const spinner = createSpinner(`正在生成组件: ${name}...`);
|
|
56
|
+
spinner.start();
|
|
57
|
+
try {
|
|
58
|
+
mkdirSync(compDir, { recursive: true });
|
|
59
|
+
transaction.recordCreatedDir(compDir);
|
|
60
|
+
const filesCreated = [];
|
|
61
|
+
const filesModified = [];
|
|
62
|
+
// 1. 生成样式文件(若启用)
|
|
63
|
+
let styleImport = '';
|
|
64
|
+
if (style === 'css') {
|
|
65
|
+
const cssPath = join(compDir, `${name}.css`);
|
|
66
|
+
transaction.prepareWrite(cssPath);
|
|
67
|
+
writeFileSync(cssPath, `.f-${name} {\n /* 组件自定义样式 */\n}\n`, 'utf-8');
|
|
68
|
+
filesCreated.push(cssPath);
|
|
69
|
+
styleImport = `import './${name}.css';\n`;
|
|
70
|
+
}
|
|
71
|
+
else if (style === 'scss') {
|
|
72
|
+
const scssPath = join(compDir, `${name}.scss`);
|
|
73
|
+
transaction.prepareWrite(scssPath);
|
|
74
|
+
writeFileSync(scssPath, `.f-${name} {\n /* 组件自定义 SCSS 样式 */\n}\n`, 'utf-8');
|
|
75
|
+
filesCreated.push(scssPath);
|
|
76
|
+
styleImport = `import './${name}.scss';\n`;
|
|
77
|
+
// 幂等确保应用 package.json devDependencies 包含 sass catalog
|
|
78
|
+
const pkgPath = appContext.pkgJsonPath;
|
|
79
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
80
|
+
if (!pkg.devDependencies) {
|
|
81
|
+
pkg.devDependencies = {};
|
|
82
|
+
}
|
|
83
|
+
if (!pkg.devDependencies.sass) {
|
|
84
|
+
transaction.prepareWrite(pkgPath);
|
|
85
|
+
pkg.devDependencies.sass = 'catalog:';
|
|
86
|
+
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n', 'utf-8');
|
|
87
|
+
filesModified.push(pkgPath);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// 2. 生成 props 文件(若启用)
|
|
91
|
+
if (withProps) {
|
|
92
|
+
const propsPath = join(compDir, `${name}.props.ts`);
|
|
93
|
+
transaction.prepareWrite(propsPath);
|
|
94
|
+
const propsContent = `import type { ExtractPropTypes } from 'vue';
|
|
95
|
+
|
|
96
|
+
export const ${camelName}Props = {
|
|
97
|
+
// 定义组件 Props
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type ${pascalName}Props = ExtractPropTypes<typeof ${camelName}Props>;
|
|
101
|
+
`;
|
|
102
|
+
writeFileSync(propsPath, propsContent, 'utf-8');
|
|
103
|
+
filesCreated.push(propsPath);
|
|
104
|
+
}
|
|
105
|
+
// 3. 生成 component.tsx
|
|
106
|
+
const componentPath = join(compDir, `${name}.component.tsx`);
|
|
107
|
+
transaction.prepareWrite(componentPath);
|
|
108
|
+
let componentContent = `import { defineComponent } from 'vue';\n`;
|
|
109
|
+
if (withProps) {
|
|
110
|
+
componentContent += `import { ${camelName}Props } from './${name}.props';\n`;
|
|
111
|
+
}
|
|
112
|
+
if (styleImport) {
|
|
113
|
+
componentContent += styleImport;
|
|
114
|
+
}
|
|
115
|
+
componentContent += `\nexport default defineComponent({\n name: '${pascalName}',\n`;
|
|
116
|
+
if (withProps) {
|
|
117
|
+
componentContent += ` props: ${camelName}Props,\n`;
|
|
118
|
+
}
|
|
119
|
+
componentContent += ` setup(${withProps ? 'props, { slots }' : '_, { slots }'}) {\n return () => (\n <div class="f-${name}">\n {slots.default ? slots.default() : '${pascalName}'}\n </div>\n );\n }\n});\n`;
|
|
120
|
+
writeFileSync(componentPath, componentContent, 'utf-8');
|
|
121
|
+
filesCreated.push(componentPath);
|
|
122
|
+
// 4. 生成 index.ts
|
|
123
|
+
const indexPath = join(compDir, 'index.ts');
|
|
124
|
+
transaction.prepareWrite(indexPath);
|
|
125
|
+
let indexContent = `import ${pascalName} from './${name}.component';\n\n`;
|
|
126
|
+
if (withProps) {
|
|
127
|
+
indexContent += `export { ${camelName}Props, type ${pascalName}Props } from './${name}.props';\n`;
|
|
128
|
+
}
|
|
129
|
+
indexContent += `export { ${pascalName} };\nexport default ${pascalName};\n`;
|
|
130
|
+
writeFileSync(indexPath, indexContent, 'utf-8');
|
|
131
|
+
filesCreated.push(indexPath);
|
|
132
|
+
transaction.commit();
|
|
133
|
+
spinner.succeed(`组件 ${name} 生成成功!`);
|
|
134
|
+
if (isJson) {
|
|
135
|
+
sendJson({
|
|
136
|
+
command: 'generate.component',
|
|
137
|
+
ok: true,
|
|
138
|
+
componentName: name,
|
|
139
|
+
pascalName,
|
|
140
|
+
compDir,
|
|
141
|
+
withProps,
|
|
142
|
+
style,
|
|
143
|
+
filesCreated,
|
|
144
|
+
filesModified
|
|
145
|
+
});
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
logInfo(`\n✨ 已成功生成组件: src/components/${name}/`);
|
|
149
|
+
filesCreated.forEach((f) => logInfo(` + ${f}`));
|
|
150
|
+
if (filesModified.length > 0) {
|
|
151
|
+
filesModified.forEach((f) => logInfo(` ~ ${f} (更新依赖)`));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
spinner.fail('生成组件失败,正在回滚...');
|
|
156
|
+
transaction.rollback();
|
|
157
|
+
fail({
|
|
158
|
+
command: 'generate.component',
|
|
159
|
+
error: `生成组件失败: ${err.message}`,
|
|
160
|
+
exitCode: ExitCode.GENERAL_ERROR
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
164
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/commands/generate/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE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