@cluerise/tools 4.0.0 → 4.0.1
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 +1 -1
- package/dist/scripts/init/main.js +14 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -257,8 +257,9 @@ class FileUtils {
|
|
|
257
257
|
static async copyFile(sourceDirectory, filePath, destinationFilePath) {
|
|
258
258
|
const sourcePath = Path.resolve(sourceDirectory, filePath);
|
|
259
259
|
const destinationPath = Path.resolve(Process.cwd(), destinationFilePath ?? filePath);
|
|
260
|
+
const sourceStat = await FileSystem.stat(sourcePath);
|
|
260
261
|
await FileSystem.mkdir(Path.dirname(destinationPath), { recursive: true });
|
|
261
|
-
return FileSystem.copyFile(sourcePath, destinationPath);
|
|
262
|
+
return FileSystem.copyFile(sourcePath, destinationPath, sourceStat.mode);
|
|
262
263
|
}
|
|
263
264
|
}
|
|
264
265
|
class JsonUtils {
|
|
@@ -352,13 +353,11 @@ initEditorConfig_fn = async function() {
|
|
|
352
353
|
await FileUtils.copyFile(__privateGet(this, _configDirectory), ".editorconfig");
|
|
353
354
|
};
|
|
354
355
|
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}';
|
|
356
|
+
const configPath = "eslint.config.js";
|
|
357
|
+
const markdownConfigPath = "eslint-markdown.config.js";
|
|
358
|
+
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configPath}';
|
|
360
359
|
`;
|
|
361
|
-
const markdownConfigContent = `export { default } from '${__privateGet(this, _configPackage)}/${
|
|
360
|
+
const markdownConfigContent = `export { default } from '${__privateGet(this, _configPackage)}/${markdownConfigPath}';
|
|
362
361
|
`;
|
|
363
362
|
await FileUtils.createFile(configPath, configContent);
|
|
364
363
|
await FileUtils.createFile(markdownConfigPath, markdownConfigContent);
|
|
@@ -377,9 +376,8 @@ initGit_fn = async function() {
|
|
|
377
376
|
await Promise.all(gitHookPaths.map((gitHookPath) => FileUtils.copyFile(__privateGet(this, _configDirectory), gitHookPath)));
|
|
378
377
|
};
|
|
379
378
|
initLintStaged_fn = async function() {
|
|
380
|
-
const
|
|
381
|
-
const
|
|
382
|
-
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configName}';
|
|
379
|
+
const configPath = "lint-staged.config.js";
|
|
380
|
+
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configPath}';
|
|
383
381
|
`;
|
|
384
382
|
await FileUtils.createFile(configPath, configContent);
|
|
385
383
|
};
|
|
@@ -388,14 +386,12 @@ initNvm_fn = async function() {
|
|
|
388
386
|
};
|
|
389
387
|
initPnpm_fn = async function() {
|
|
390
388
|
const workspacePath = "pnpm-workspace.yaml";
|
|
391
|
-
const workspaceContent =
|
|
392
|
-
`;
|
|
389
|
+
const workspaceContent = "engineStrict: true\n\npublicHoistPattern:\n - '@commitlint/cli'\n - eslint\n - lint-staged\n - prettier\n";
|
|
393
390
|
await FileUtils.createFile(workspacePath, workspaceContent);
|
|
394
391
|
};
|
|
395
392
|
initPrettier_fn = async function() {
|
|
396
|
-
const
|
|
397
|
-
const
|
|
398
|
-
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configName}';
|
|
393
|
+
const configPath = "prettier.config.js";
|
|
394
|
+
const configContent = `export { default } from '${__privateGet(this, _configPackage)}/${configPath}';
|
|
399
395
|
`;
|
|
400
396
|
await FileUtils.createFile(configPath, configContent);
|
|
401
397
|
};
|
|
@@ -422,10 +418,9 @@ getReleaseConfigParams_fn = async function() {
|
|
|
422
418
|
}
|
|
423
419
|
};
|
|
424
420
|
initRelease_fn = async function() {
|
|
425
|
-
const
|
|
426
|
-
const configPath = `${configName}.js`;
|
|
421
|
+
const configPath = "release.config.js";
|
|
427
422
|
const configParams = await __privateMethod(this, _ToolInitializer_instances, getReleaseConfigParams_fn).call(this);
|
|
428
|
-
const configContent = `import { createReleaseConfig } from '${__privateGet(this, _configPackage)}/${
|
|
423
|
+
const configContent = `import { createReleaseConfig } from '${__privateGet(this, _configPackage)}/${configPath}';
|
|
429
424
|
|
|
430
425
|
export default createReleaseConfig(${JsonUtils.prettify(configParams)});
|
|
431
426
|
`;
|
|
@@ -434,10 +429,7 @@ export default createReleaseConfig(${JsonUtils.prettify(configParams)});
|
|
|
434
429
|
initTypeScript_fn = async function() {
|
|
435
430
|
const configPath = "tsconfig.json";
|
|
436
431
|
const configContent = `{
|
|
437
|
-
"extends": "${__privateGet(this, _configDirectory)}/${configPath}"
|
|
438
|
-
"compilerOptions": {
|
|
439
|
-
"baseUrl": "./"
|
|
440
|
-
}
|
|
432
|
+
"extends": "${__privateGet(this, _configDirectory)}/${configPath}"
|
|
441
433
|
}
|
|
442
434
|
`;
|
|
443
435
|
await FileUtils.createFile(configPath, configContent);
|