@cluerise/tools 4.0.0 → 4.0.2
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/README.md
CHANGED
|
@@ -75,7 +75,7 @@ export default defineConfig([
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
name: 'cluerise: typescript-eslint/rules',
|
|
78
|
-
files: ['**/*.tsx
|
|
78
|
+
files: ['**/*.{ts,tsx}'],
|
|
79
79
|
rules: {
|
|
80
80
|
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }]
|
|
81
81
|
}
|
|
@@ -135,7 +135,7 @@ export default defineConfig([
|
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
name: 'cluerise: eslint/import/ts',
|
|
138
|
-
files: ['**/*.tsx
|
|
138
|
+
files: ['**/*.{ts,tsx}'],
|
|
139
139
|
extends: [eslintPluginImport.flatConfigs.recommended, eslintPluginImport.flatConfigs.typescript],
|
|
140
140
|
rules: {
|
|
141
141
|
'import/first': 'error',
|
|
@@ -160,7 +160,7 @@ export default defineConfig([
|
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
name: 'cluerise: eslint/import/rules/config.js,ts',
|
|
163
|
-
files: ['*.config.js
|
|
163
|
+
files: ['*.config.{js,ts}'],
|
|
164
164
|
rules: {
|
|
165
165
|
'import/no-default-export': 'off'
|
|
166
166
|
}
|
|
@@ -254,11 +254,14 @@ class FileUtils {
|
|
|
254
254
|
await FileSystem.mkdir(Path.dirname(absolutePath), { recursive: true });
|
|
255
255
|
return FileSystem.writeFile(absolutePath, fileContent);
|
|
256
256
|
}
|
|
257
|
-
static async copyFile(sourceDirectory, filePath, destinationFilePath) {
|
|
257
|
+
static async copyFile(sourceDirectory, filePath, destinationFilePath, mode) {
|
|
258
258
|
const sourcePath = Path.resolve(sourceDirectory, filePath);
|
|
259
259
|
const destinationPath = Path.resolve(Process.cwd(), destinationFilePath ?? filePath);
|
|
260
260
|
await FileSystem.mkdir(Path.dirname(destinationPath), { recursive: true });
|
|
261
|
-
|
|
261
|
+
await FileSystem.copyFile(sourcePath, destinationPath);
|
|
262
|
+
if (mode !== void 0) {
|
|
263
|
+
await FileSystem.chmod(destinationPath, mode);
|
|
264
|
+
}
|
|
262
265
|
}
|
|
263
266
|
}
|
|
264
267
|
class JsonUtils {
|
|
@@ -352,13 +355,11 @@ initEditorConfig_fn = async function() {
|
|
|
352
355
|
await FileUtils.copyFile(__privateGet(this, _configDirectory), ".editorconfig");
|
|
353
356
|
};
|
|
354
357
|
initESLint_fn = async function() {
|
|
355
|
-
const
|
|
356
|
-
const
|
|
357
|
-
const
|
|
358
|
-
const markdownConfigPath = `${markdownConfigName}.js`;
|
|
359
|
-
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configName}';
|
|
358
|
+
const configPath = "eslint.config.js";
|
|
359
|
+
const markdownConfigPath = "eslint-markdown.config.js";
|
|
360
|
+
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configPath}';
|
|
360
361
|
`;
|
|
361
|
-
const markdownConfigContent = `export { default } from '${__privateGet(this, _configPackage)}/${
|
|
362
|
+
const markdownConfigContent = `export { default } from '${__privateGet(this, _configPackage)}/${markdownConfigPath}';
|
|
362
363
|
`;
|
|
363
364
|
await FileUtils.createFile(configPath, configContent);
|
|
364
365
|
await FileUtils.createFile(markdownConfigPath, markdownConfigContent);
|
|
@@ -374,12 +375,13 @@ initGit_fn = async function() {
|
|
|
374
375
|
Path.join(gitHookDirectory, "pre-commit"),
|
|
375
376
|
Path.join(gitHookDirectory, "prepare-commit-msg")
|
|
376
377
|
];
|
|
377
|
-
await Promise.all(
|
|
378
|
+
await Promise.all(
|
|
379
|
+
gitHookPaths.map((gitHookPath) => FileUtils.copyFile(__privateGet(this, _configDirectory), gitHookPath, void 0, 493))
|
|
380
|
+
);
|
|
378
381
|
};
|
|
379
382
|
initLintStaged_fn = async function() {
|
|
380
|
-
const
|
|
381
|
-
const
|
|
382
|
-
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configName}';
|
|
383
|
+
const configPath = "lint-staged.config.js";
|
|
384
|
+
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configPath}';
|
|
383
385
|
`;
|
|
384
386
|
await FileUtils.createFile(configPath, configContent);
|
|
385
387
|
};
|
|
@@ -388,14 +390,12 @@ initNvm_fn = async function() {
|
|
|
388
390
|
};
|
|
389
391
|
initPnpm_fn = async function() {
|
|
390
392
|
const workspacePath = "pnpm-workspace.yaml";
|
|
391
|
-
const workspaceContent =
|
|
392
|
-
`;
|
|
393
|
+
const workspaceContent = "engineStrict: true\n\npublicHoistPattern:\n - '@commitlint/cli'\n - eslint\n - lint-staged\n - prettier\n";
|
|
393
394
|
await FileUtils.createFile(workspacePath, workspaceContent);
|
|
394
395
|
};
|
|
395
396
|
initPrettier_fn = async function() {
|
|
396
|
-
const
|
|
397
|
-
const
|
|
398
|
-
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configName}';
|
|
397
|
+
const configPath = "prettier.config.js";
|
|
398
|
+
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configPath}';
|
|
399
399
|
`;
|
|
400
400
|
await FileUtils.createFile(configPath, configContent);
|
|
401
401
|
};
|
|
@@ -422,10 +422,9 @@ getReleaseConfigParams_fn = async function() {
|
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
424
|
initRelease_fn = async function() {
|
|
425
|
-
const
|
|
426
|
-
const configPath = `${configName}.js`;
|
|
425
|
+
const configPath = "release.config.js";
|
|
427
426
|
const configParams = await __privateMethod(this, _ToolInitializer_instances, getReleaseConfigParams_fn).call(this);
|
|
428
|
-
const configContent = `import { createReleaseConfig } from '${__privateGet(this, _configPackage)}/${
|
|
427
|
+
const configContent = `import { createReleaseConfig } from '${__privateGet(this, _configPackage)}/${configPath}';
|
|
429
428
|
|
|
430
429
|
export default createReleaseConfig(${JsonUtils.prettify(configParams)});
|
|
431
430
|
`;
|
|
@@ -434,10 +433,7 @@ export default createReleaseConfig(${JsonUtils.prettify(configParams)});
|
|
|
434
433
|
initTypeScript_fn = async function() {
|
|
435
434
|
const configPath = "tsconfig.json";
|
|
436
435
|
const configContent = `{
|
|
437
|
-
"extends": "${__privateGet(this, _configDirectory)}/${configPath}"
|
|
438
|
-
"compilerOptions": {
|
|
439
|
-
"baseUrl": "./"
|
|
440
|
-
}
|
|
436
|
+
"extends": "${__privateGet(this, _configDirectory)}/${configPath}"
|
|
441
437
|
}
|
|
442
438
|
`;
|
|
443
439
|
await FileUtils.createFile(configPath, configContent);
|