@xylabs/ts-scripts-yarn3 7.4.21 → 7.4.23

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.
Files changed (119) hide show
  1. package/dist/actions/claude-clean.mjs +71 -0
  2. package/dist/actions/claude-clean.mjs.map +1 -0
  3. package/dist/actions/claude-commands.mjs +11 -2
  4. package/dist/actions/claude-commands.mjs.map +1 -1
  5. package/dist/actions/claude-rules.mjs +27 -7
  6. package/dist/actions/claude-rules.mjs.map +1 -1
  7. package/dist/actions/claude-settings.mjs +2 -2
  8. package/dist/actions/claude-settings.mjs.map +1 -1
  9. package/dist/actions/claude-skills.mjs.map +1 -1
  10. package/dist/actions/dupdeps.mjs +3 -2
  11. package/dist/actions/dupdeps.mjs.map +1 -1
  12. package/dist/actions/gitignore.mjs +152 -0
  13. package/dist/actions/gitignore.mjs.map +1 -0
  14. package/dist/actions/index.mjs +550 -208
  15. package/dist/actions/index.mjs.map +1 -1
  16. package/dist/actions/package-lint.mjs +178 -0
  17. package/dist/actions/package-lint.mjs.map +1 -0
  18. package/dist/bin/xy.mjs +607 -229
  19. package/dist/bin/xy.mjs.map +1 -1
  20. package/dist/index.d.ts +13 -3
  21. package/dist/index.mjs +671 -285
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/lib/claudeMdTemplate.mjs +5 -1
  24. package/dist/lib/claudeMdTemplate.mjs.map +1 -1
  25. package/dist/lib/gitignoreTemplate.mjs +12 -0
  26. package/dist/lib/gitignoreTemplate.mjs.map +1 -0
  27. package/dist/lib/index.mjs +17 -3
  28. package/dist/lib/index.mjs.map +1 -1
  29. package/dist/xy/build/buildCommand.mjs +161 -0
  30. package/dist/xy/build/buildCommand.mjs.map +1 -0
  31. package/dist/xy/build/compileCommand.mjs +174 -0
  32. package/dist/xy/build/compileCommand.mjs.map +1 -0
  33. package/dist/xy/build/compileOnlyCommand.mjs +175 -0
  34. package/dist/xy/build/compileOnlyCommand.mjs.map +1 -0
  35. package/dist/xy/build/copyAssetsCommand.mjs +84 -0
  36. package/dist/xy/build/copyAssetsCommand.mjs.map +1 -0
  37. package/dist/xy/{build-commands → build}/index.mjs +45 -40
  38. package/dist/xy/build/index.mjs.map +1 -0
  39. package/dist/xy/build/rebuildCommand.mjs +114 -0
  40. package/dist/xy/build/rebuildCommand.mjs.map +1 -0
  41. package/dist/xy/build/recompileCommand.mjs +204 -0
  42. package/dist/xy/build/recompileCommand.mjs.map +1 -0
  43. package/dist/xy/common/claude/cleanCommand.mjs +79 -0
  44. package/dist/xy/common/claude/cleanCommand.mjs.map +1 -0
  45. package/dist/xy/common/claude/commandsCommand.mjs +11 -2
  46. package/dist/xy/common/claude/commandsCommand.mjs.map +1 -1
  47. package/dist/xy/common/claude/index.mjs +173 -71
  48. package/dist/xy/common/claude/index.mjs.map +1 -1
  49. package/dist/xy/common/claude/initCommand.mjs +40 -117
  50. package/dist/xy/common/claude/initCommand.mjs.map +1 -1
  51. package/dist/xy/common/claude/rulesCommand.mjs +27 -7
  52. package/dist/xy/common/claude/rulesCommand.mjs.map +1 -1
  53. package/dist/xy/common/claude/settingsCommand.mjs +2 -2
  54. package/dist/xy/common/claude/settingsCommand.mjs.map +1 -1
  55. package/dist/xy/common/claude/skillsCommand.mjs.map +1 -1
  56. package/dist/xy/common/gitignoreCommand.mjs +158 -0
  57. package/dist/xy/common/gitignoreCommand.mjs.map +1 -0
  58. package/dist/xy/common/index.mjs +306 -111
  59. package/dist/xy/common/index.mjs.map +1 -1
  60. package/dist/xy/index.mjs +607 -229
  61. package/dist/xy/index.mjs.map +1 -1
  62. package/dist/xy/install/dupdepsCommand.mjs +3 -2
  63. package/dist/xy/install/dupdepsCommand.mjs.map +1 -1
  64. package/dist/xy/install/index.mjs +3 -2
  65. package/dist/xy/install/index.mjs.map +1 -1
  66. package/dist/xy/lint/index.mjs +200 -22
  67. package/dist/xy/lint/index.mjs.map +1 -1
  68. package/dist/xy/lint/packageLintCommand.mjs +193 -0
  69. package/dist/xy/lint/packageLintCommand.mjs.map +1 -0
  70. package/dist/xy/xy.mjs +607 -229
  71. package/dist/xy/xy.mjs.map +1 -1
  72. package/package.json +2 -2
  73. package/templates/claude/CLAUDE-local.md +4 -0
  74. package/templates/claude/commands/xy-dead.md +5 -0
  75. package/templates/claude/{rules/xylabs-dependencies.md → commands/xy-deps.md} +7 -7
  76. package/templates/claude/commands/xy-dupdeps.md +5 -0
  77. package/templates/claude/commands/xy-gen-docs.md +5 -0
  78. package/templates/claude/commands/xy-gitignore.md +5 -0
  79. package/templates/claude/commands/xy-gitlint.md +5 -0
  80. package/templates/claude/commands/xy-license.md +5 -0
  81. package/templates/claude/commands/xy-lint-rules.md +44 -0
  82. package/templates/claude/commands/xy-recompile.md +5 -0
  83. package/templates/claude/commands/xy-reinstall.md +5 -0
  84. package/templates/claude/commands/xy-relint.md +5 -0
  85. package/templates/claude/commands/xy-retest.md +5 -0
  86. package/templates/claude/commands/xy-sonar.md +5 -0
  87. package/templates/claude/commands/xy-up.md +7 -0
  88. package/templates/claude/rules/xylabs-architecture.md +4 -7
  89. package/templates/claude/rules/xylabs-build.md +6 -11
  90. package/templates/claude/rules/xylabs-git-workflow.md +3 -5
  91. package/templates/claude/rules/xylabs-naming.md +4 -7
  92. package/templates/claude/rules/xylabs-style.md +14 -19
  93. package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +17 -4
  94. package/templates/gitignore/template.gitignore +40 -0
  95. package/dist/actions/gitignore-gen.mjs +0 -88
  96. package/dist/actions/gitignore-gen.mjs.map +0 -1
  97. package/dist/xy/build-commands/build.mjs +0 -502
  98. package/dist/xy/build-commands/build.mjs.map +0 -1
  99. package/dist/xy/build-commands/index.mjs.map +0 -1
  100. package/dist/xy/common/gitignoreGenCommand.mjs +0 -98
  101. package/dist/xy/common/gitignoreGenCommand.mjs.map +0 -1
  102. package/templates/claude/commands/xylabs-deploy-major.md +0 -7
  103. package/templates/claude/commands/xylabs-deploy-minor.md +0 -7
  104. package/templates/claude/commands/xylabs-deploy.md +0 -7
  105. package/templates/claude/rules/xylabs-error-handling.md +0 -7
  106. package/templates/claude/rules/xylabs-frameworks.md +0 -8
  107. package/templates/claude/rules/xylabs-linting.md +0 -55
  108. package/templates/claude/rules/xylabs-typescript.md +0 -11
  109. /package/templates/claude/commands/{xylabs-build.md → xy-build.md} +0 -0
  110. /package/templates/claude/commands/{xylabs-clean.md → xy-clean.md} +0 -0
  111. /package/templates/claude/commands/{xylabs-compile.md → xy-compile.md} +0 -0
  112. /package/templates/claude/commands/{xylabs-cycle.md → xy-cycle.md} +0 -0
  113. /package/templates/claude/commands/{xylabs-deplint.md → xy-deplint.md} +0 -0
  114. /package/templates/claude/commands/{xylabs-fix.md → xy-fix.md} +0 -0
  115. /package/templates/claude/commands/{xylabs-knip.md → xy-knip.md} +0 -0
  116. /package/templates/claude/commands/{xylabs-lint.md → xy-lint.md} +0 -0
  117. /package/templates/claude/commands/{xylabs-publint.md → xy-publint.md} +0 -0
  118. /package/templates/claude/commands/{xylabs-rebuild.md → xy-rebuild.md} +0 -0
  119. /package/templates/claude/commands/{xylabs-test.md → xy-test.md} +0 -0
@@ -0,0 +1,158 @@
1
+ // src/lib/file/constants.ts
2
+ var WINDOWS_NEWLINE_REGEX = /\r\n/g;
3
+ var CROSS_PLATFORM_NEWLINE = "\n";
4
+
5
+ // src/lib/file/fileLines.ts
6
+ import {
7
+ existsSync,
8
+ readFileSync,
9
+ writeFileSync
10
+ } from "fs";
11
+
12
+ // src/lib/string/empty.ts
13
+ var empty = (value) => value?.trim().length === 0;
14
+ var notEmpty = (value) => !empty(value);
15
+
16
+ // src/lib/string/union.ts
17
+ var union = (a, b) => /* @__PURE__ */ new Set([...new Set(a), ...new Set(b)]);
18
+
19
+ // src/lib/file/ReadFileSyncOptions.ts
20
+ var defaultReadFileSyncOptions = { encoding: "utf8" };
21
+
22
+ // src/lib/file/fileLines.ts
23
+ var readLines = (uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [];
24
+ var readNonEmptyLines = (uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty);
25
+ var writeLines = (uri, lines, options = defaultReadFileSyncOptions) => {
26
+ const existing = existsSync(uri) ? readFileSync(uri, options) : void 0;
27
+ const desired = lines.join(CROSS_PLATFORM_NEWLINE);
28
+ if (existing !== desired) writeFileSync(uri, desired, options);
29
+ };
30
+
31
+ // src/lib/yarn/workspace/yarnWorkspaces.ts
32
+ import { spawnSync } from "child_process";
33
+ var yarnWorkspaces = () => {
34
+ const result = spawnSync("yarn", ["workspaces", "list", "--json", "--recursive"], { encoding: "utf8", shell: true });
35
+ if (result.error) {
36
+ throw result.error;
37
+ }
38
+ return result.stdout.toString().split("\n").slice(0, -1).map((item) => {
39
+ return JSON.parse(item);
40
+ });
41
+ };
42
+
43
+ // src/lib/yarn/yarnInitCwd.ts
44
+ var INIT_CWD = () => {
45
+ if (!process.env.INIT_CWD) console.error("Missing INIT_CWD");
46
+ return process.env.INIT_CWD;
47
+ };
48
+
49
+ // src/lib/gitignoreTemplate.ts
50
+ import { readFileSync as readFileSync2 } from "fs";
51
+ import { createRequire } from "module";
52
+ import PATH from "path";
53
+ var require2 = createRequire(import.meta.url);
54
+ var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
55
+ var templatesDir = PATH.resolve(packageRoot, "templates", "gitignore");
56
+ var gitignoreTemplate = () => readFileSync2(PATH.resolve(templatesDir, "template.gitignore"), "utf8");
57
+
58
+ // src/actions/gitignore.ts
59
+ import { unlinkSync } from "fs";
60
+ import chalk from "chalk";
61
+ var COMMENT_PREFIX = "#";
62
+ var isComment = (line) => line.startsWith(COMMENT_PREFIX);
63
+ var isNegation = (line) => line.startsWith("!");
64
+ function parseTemplateSections(lines) {
65
+ const sections = [];
66
+ let current = [];
67
+ for (const line of lines) {
68
+ if (isComment(line)) {
69
+ if (current.length > 0) {
70
+ sections.push(current);
71
+ }
72
+ current = [line];
73
+ } else {
74
+ current.push(line);
75
+ }
76
+ }
77
+ if (current.length > 0) {
78
+ sections.push(current);
79
+ }
80
+ return sections;
81
+ }
82
+ function mergeWithTemplate(existing, templateContent) {
83
+ const templateLines = templateContent.split("\n").filter((line) => line.trim().length > 0);
84
+ const sections = parseTemplateSections(templateLines);
85
+ const existingEntries = new Set(existing.filter((line) => !isComment(line)));
86
+ const templateEntries = new Set(templateLines.filter((line) => !isComment(line)));
87
+ const customEntries = [...existingEntries].filter((entry) => !templateEntries.has(entry));
88
+ const result = [];
89
+ for (const section of sections) {
90
+ for (const line of section) {
91
+ result.push(line);
92
+ }
93
+ result.push("");
94
+ }
95
+ if (customEntries.length > 0) {
96
+ result.push("# Custom");
97
+ const sorted = [...union(customEntries, [])].toSorted((a, b) => {
98
+ if (isNegation(a) && !isNegation(b)) return 1;
99
+ if (!isNegation(a) && isNegation(b)) return -1;
100
+ return a.localeCompare(b);
101
+ });
102
+ for (const entry of sorted) {
103
+ result.push(entry);
104
+ }
105
+ result.push("");
106
+ }
107
+ return result;
108
+ }
109
+ function removePackageGitignores(cwd) {
110
+ let removed = 0;
111
+ const workspaces = yarnWorkspaces();
112
+ for (const { location } of workspaces) {
113
+ if (location === ".") continue;
114
+ const filePath = `${cwd}/${location}/.gitignore`;
115
+ try {
116
+ unlinkSync(filePath);
117
+ console.log(chalk.yellow(` Removed ${location}/.gitignore`));
118
+ removed++;
119
+ } catch {
120
+ }
121
+ }
122
+ return removed;
123
+ }
124
+ function gitignore() {
125
+ console.log(chalk.green("Generate .gitignore"));
126
+ const cwd = INIT_CWD() ?? ".";
127
+ const gitignorePath = `${cwd}/.gitignore`;
128
+ try {
129
+ const templateContent = gitignoreTemplate();
130
+ const existing = readNonEmptyLines(gitignorePath);
131
+ const merged = mergeWithTemplate(existing, templateContent);
132
+ writeLines(gitignorePath, merged);
133
+ console.log(chalk.green(" Root .gitignore updated"));
134
+ const removed = removePackageGitignores(cwd);
135
+ if (removed > 0) {
136
+ console.log(chalk.green(` Removed ${removed} package .gitignore file(s)`));
137
+ }
138
+ return 0;
139
+ } catch (ex) {
140
+ const error = ex;
141
+ console.error(chalk.red(`Generate .gitignore failed: ${error.message}`));
142
+ return 1;
143
+ }
144
+ }
145
+
146
+ // src/xy/common/gitignoreCommand.ts
147
+ var gitignoreCommand = {
148
+ command: "gitignore",
149
+ describe: "GitIgnore - Generate root .gitignore and remove package .gitignore files",
150
+ handler: (argv) => {
151
+ if (argv.verbose) console.log("GitIgnore");
152
+ process.exitCode = gitignore();
153
+ }
154
+ };
155
+ export {
156
+ gitignoreCommand
157
+ };
158
+ //# sourceMappingURL=gitignoreCommand.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/file/constants.ts","../../../src/lib/file/fileLines.ts","../../../src/lib/string/empty.ts","../../../src/lib/string/union.ts","../../../src/lib/file/ReadFileSyncOptions.ts","../../../src/lib/yarn/workspace/yarnWorkspaces.ts","../../../src/lib/yarn/yarnInitCwd.ts","../../../src/lib/gitignoreTemplate.ts","../../../src/actions/gitignore.ts","../../../src/xy/common/gitignoreCommand.ts"],"sourcesContent":["export const WINDOWS_NEWLINE_REGEX = /\\r\\n/g\nexport const CROSS_PLATFORM_NEWLINE = '\\n'\n","import type { PathLike, WriteFileOptions } from 'node:fs'\nimport {\n existsSync, readFileSync,\n writeFileSync,\n} from 'node:fs'\n\nimport { notEmpty } from '../string/index.ts'\nimport { CROSS_PLATFORM_NEWLINE, WINDOWS_NEWLINE_REGEX } from './constants.ts'\nimport type { ReadFileSyncOptions } from './ReadFileSyncOptions.ts'\nimport { defaultReadFileSyncOptions } from './ReadFileSyncOptions.ts'\n\nexport const readLines = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string[] =>\n existsSync(uri)\n ? readFileSync(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE)\n : []\n\nexport const readNonEmptyLines = (uri: PathLike, options: ReadFileSyncOptions = defaultReadFileSyncOptions): string[] =>\n readLines(uri, options).filter(notEmpty)\n\nexport const writeLines = (uri: PathLike, lines: string[], options: WriteFileOptions = defaultReadFileSyncOptions) => {\n const existing = existsSync(uri) ? readFileSync(uri, options) : undefined\n const desired = lines.join(CROSS_PLATFORM_NEWLINE)\n // Check if the file is different before writing\n if (existing !== desired) writeFileSync(uri, desired, options)\n}\n","export const empty = (value?: string | undefined): boolean => value?.trim().length === 0\nexport const notEmpty = (value?: string | undefined): boolean => !empty(value)\n","export const union = (a: string[], b: string[]): Set<string> => new Set([...new Set(a), ...new Set(b)])\n","export type ReadFileSyncOptions = BufferEncoding | {\n encoding: BufferEncoding\n flags?: string\n}\n\nexport const defaultReadFileSyncOptions: ReadFileSyncOptions = { encoding: 'utf8' }\n","import { spawnSync } from 'node:child_process'\n\nimport type { Workspace } from './Workspace.ts'\n\nexport const yarnWorkspaces = (): Workspace[] => {\n const result = spawnSync('yarn', ['workspaces', 'list', '--json', '--recursive'], { encoding: 'utf8', shell: true })\n if (result.error) {\n throw result.error\n }\n return (\n result.stdout\n .toString()\n // NOTE: This probably doesn't work on Windows\n // TODO: Replace /r/n with /n first\n .split('\\n')\n .slice(0, -1)\n .map((item) => {\n return JSON.parse(item)\n })\n )\n}\n","export const INIT_CWD = () => {\n if (!process.env.INIT_CWD) console.error('Missing INIT_CWD')\n return process.env.INIT_CWD\n}\n","import { readFileSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport PATH from 'node:path'\n\nconst require = createRequire(import.meta.url)\nconst packageRoot = PATH.dirname(require.resolve('@xylabs/ts-scripts-yarn3/package.json'))\nconst templatesDir = PATH.resolve(packageRoot, 'templates', 'gitignore')\n\nexport const gitignoreTemplate = (): string =>\n readFileSync(PATH.resolve(templatesDir, 'template.gitignore'), 'utf8')\n","import { unlinkSync } from 'node:fs'\n\nimport chalk from 'chalk'\n\nimport {\n gitignoreTemplate, readNonEmptyLines, writeLines,\n} from '../lib/index.ts'\nimport { union } from '../lib/string/index.ts'\nimport { INIT_CWD, yarnWorkspaces } from '../lib/yarn/index.ts'\n\nconst COMMENT_PREFIX = '#'\n\nconst isComment = (line: string): boolean => line.startsWith(COMMENT_PREFIX)\n\nconst isNegation = (line: string): boolean => line.startsWith('!')\n\n/** Parse the template into sections (comment + entries) */\nfunction parseTemplateSections(lines: string[]): string[][] {\n const sections: string[][] = []\n let current: string[] = []\n for (const line of lines) {\n if (isComment(line)) {\n if (current.length > 0) {\n sections.push(current)\n }\n current = [line]\n } else {\n current.push(line)\n }\n }\n if (current.length > 0) {\n sections.push(current)\n }\n return sections\n}\n\n/** Merge template entries into existing entries, preserving structure */\nfunction mergeWithTemplate(existing: string[], templateContent: string): string[] {\n const templateLines = templateContent.split('\\n').filter(line => line.trim().length > 0)\n const sections = parseTemplateSections(templateLines)\n\n // Collect all existing non-comment, non-negation entries\n const existingEntries = new Set(existing.filter(line => !isComment(line)))\n\n // Find template entries that are missing from existing\n const templateEntries = new Set(templateLines.filter(line => !isComment(line)))\n\n // Find custom entries (in existing but not in template)\n const customEntries = [...existingEntries].filter(entry => !templateEntries.has(entry))\n\n // Build the output: template sections first, then custom entries\n const result: string[] = []\n for (const section of sections) {\n for (const line of section) {\n result.push(line)\n }\n result.push('')\n }\n\n if (customEntries.length > 0) {\n result.push('# Custom')\n const sorted = [...union(customEntries, [])].toSorted((a, b) => {\n // Negation patterns sort after their positive counterparts\n if (isNegation(a) && !isNegation(b)) return 1\n if (!isNegation(a) && isNegation(b)) return -1\n return a.localeCompare(b)\n })\n for (const entry of sorted) {\n result.push(entry)\n }\n result.push('')\n }\n\n return result\n}\n\nfunction removePackageGitignores(cwd: string): number {\n let removed = 0\n const workspaces = yarnWorkspaces()\n for (const { location } of workspaces) {\n // Skip root workspace\n if (location === '.') continue\n const filePath = `${cwd}/${location}/.gitignore`\n try {\n unlinkSync(filePath)\n console.log(chalk.yellow(` Removed ${location}/.gitignore`))\n removed++\n } catch {\n // File doesn't exist — nothing to do\n }\n }\n return removed\n}\n\n/** @deprecated Use gitignore instead */\nexport const gitignoreGen = gitignore\n\nexport function gitignore(): number {\n console.log(chalk.green('Generate .gitignore'))\n const cwd = INIT_CWD() ?? '.'\n const gitignorePath = `${cwd}/.gitignore`\n\n try {\n const templateContent = gitignoreTemplate()\n const existing = readNonEmptyLines(gitignorePath)\n const merged = mergeWithTemplate(existing, templateContent)\n writeLines(gitignorePath, merged)\n console.log(chalk.green(' Root .gitignore updated'))\n\n const removed = removePackageGitignores(cwd)\n if (removed > 0) {\n console.log(chalk.green(` Removed ${removed} package .gitignore file(s)`))\n }\n\n return 0\n } catch (ex) {\n const error = ex as Error\n console.error(chalk.red(`Generate .gitignore failed: ${error.message}`))\n return 1\n }\n}\n","import type { CommandModule } from 'yargs'\n\nimport { gitignore } from '../../actions/index.ts'\n\nexport const gitignoreCommand: CommandModule = {\n command: 'gitignore',\n describe: 'GitIgnore - Generate root .gitignore and remove package .gitignore files',\n handler: (argv) => {\n if (argv.verbose) console.log('GitIgnore')\n process.exitCode = gitignore()\n },\n}\n"],"mappings":";AAAO,IAAM,wBAAwB;AAC9B,IAAM,yBAAyB;;;ACAtC;AAAA,EACE;AAAA,EAAY;AAAA,EACZ;AAAA,OACK;;;ACJA,IAAM,QAAQ,CAAC,UAAwC,OAAO,KAAK,EAAE,WAAW;AAChF,IAAM,WAAW,CAAC,UAAwC,CAAC,MAAM,KAAK;;;ACDtE,IAAM,QAAQ,CAAC,GAAa,MAA6B,oBAAI,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;;;ACK/F,IAAM,6BAAkD,EAAE,UAAU,OAAO;;;AHM3E,IAAM,YAAY,CAAC,KAAe,UAA+B,+BACtE,WAAW,GAAG,IACV,aAAa,KAAK,OAAO,EAAE,QAAQ,uBAAuB,sBAAsB,EAAE,MAAM,sBAAsB,IAC9G,C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