chore(cli): update eslint config and prettier codes
This commit is contained in:
@@ -23,7 +23,7 @@ import {
|
||||
isDemoDir,
|
||||
isTestDir,
|
||||
setNodeEnv,
|
||||
setModuleEnv
|
||||
setModuleEnv,
|
||||
} from '../common';
|
||||
|
||||
async function compileFile(filePath: string) {
|
||||
@@ -62,7 +62,6 @@ async function compileDir(dir: string) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
async function buildEs() {
|
||||
setModuleEnv('esmodule');
|
||||
await copy(SRC_DIR, ES_DIR);
|
||||
@@ -87,7 +86,7 @@ async function buildPacakgeEntry() {
|
||||
|
||||
genPackageEntry({
|
||||
outputPath: esEntryFile,
|
||||
pathResolver: (path: string) => `./${relative(SRC_DIR, path)}`
|
||||
pathResolver: (path: string) => `./${relative(SRC_DIR, path)}`,
|
||||
});
|
||||
|
||||
setModuleEnv('esmodule');
|
||||
@@ -95,7 +94,7 @@ async function buildPacakgeEntry() {
|
||||
|
||||
genPacakgeStyle({
|
||||
outputPath: styleEntryFile,
|
||||
pathResolver: (path: string) => path.replace(SRC_DIR, '.')
|
||||
pathResolver: (path: string) => path.replace(SRC_DIR, '.'),
|
||||
});
|
||||
|
||||
setModuleEnv('commonjs');
|
||||
@@ -114,24 +113,24 @@ async function buildPackages() {
|
||||
const tasks = [
|
||||
{
|
||||
text: 'Build ESModule Outputs',
|
||||
task: buildEs
|
||||
task: buildEs,
|
||||
},
|
||||
{
|
||||
text: 'Build Commonjs Outputs',
|
||||
task: buildLib
|
||||
task: buildLib,
|
||||
},
|
||||
{
|
||||
text: 'Build Style Entry',
|
||||
task: buildStyleEntry
|
||||
task: buildStyleEntry,
|
||||
},
|
||||
{
|
||||
text: 'Build Package Entry',
|
||||
task: buildPacakgeEntry
|
||||
task: buildPacakgeEntry,
|
||||
},
|
||||
{
|
||||
text: 'Build Packed Outputs',
|
||||
task: buildPackages
|
||||
}
|
||||
task: buildPackages,
|
||||
},
|
||||
];
|
||||
|
||||
async function runBuildTasks() {
|
||||
|
||||
@@ -19,7 +19,7 @@ function formatType(type: string) {
|
||||
fix: 'Bug Fixes',
|
||||
feat: 'Feature',
|
||||
docs: 'Document',
|
||||
types: 'Types'
|
||||
types: 'Types',
|
||||
};
|
||||
|
||||
return MAP[type] || type;
|
||||
@@ -52,7 +52,7 @@ export async function changelog() {
|
||||
return new Promise(resolve => {
|
||||
conventionalChangelog(
|
||||
{
|
||||
preset: 'angular'
|
||||
preset: 'angular',
|
||||
},
|
||||
null,
|
||||
null,
|
||||
@@ -61,7 +61,7 @@ export async function changelog() {
|
||||
mainTemplate,
|
||||
headerPartial,
|
||||
commitPartial,
|
||||
transform
|
||||
transform,
|
||||
}
|
||||
)
|
||||
.pipe(createWriteStream(DIST_FILE))
|
||||
|
||||
@@ -6,6 +6,6 @@ export async function clean() {
|
||||
emptyDir(ES_DIR),
|
||||
emptyDir(LIB_DIR),
|
||||
emptyDir(DIST_DIR),
|
||||
emptyDir(SITE_DIST_DIR)
|
||||
emptyDir(SITE_DIST_DIR),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ export function test(command: any) {
|
||||
setNodeEnv('test');
|
||||
|
||||
genPackageEntry({
|
||||
outputPath: PACKAGE_ENTRY_FILE
|
||||
outputPath: PACKAGE_ENTRY_FILE,
|
||||
});
|
||||
|
||||
const config = {
|
||||
rootDir: ROOT,
|
||||
watch: command.watch,
|
||||
config: JEST_CONFIG_FILE,
|
||||
clearCache: command.clearCache
|
||||
clearCache: command.clearCache,
|
||||
} as any;
|
||||
|
||||
runCLI(config, [ROOT])
|
||||
|
||||
@@ -18,7 +18,7 @@ function runCommand(
|
||||
|
||||
return new Promise(resolve => {
|
||||
execa(cmd, options, {
|
||||
env: { FORCE_COLOR: true }
|
||||
env: { FORCE_COLOR: true },
|
||||
})
|
||||
.then(() => {
|
||||
spinner.succeed(messages.succeed);
|
||||
@@ -39,7 +39,7 @@ function eslint() {
|
||||
{
|
||||
start: 'Running eslint...',
|
||||
succeed: 'ESLint Passed.',
|
||||
failed: 'ESLint failed!'
|
||||
failed: 'ESLint failed!',
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -51,7 +51,7 @@ function stylelint() {
|
||||
{
|
||||
start: 'Running stylelint...',
|
||||
succeed: 'Stylelint Passed.',
|
||||
failed: 'Stylelint failed!'
|
||||
failed: 'Stylelint failed!',
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@ const PLUGIN_PATH = join(__dirname, '../compiler/vant-cli-release-plugin.js');
|
||||
export async function release() {
|
||||
await releaseIt({
|
||||
plugins: {
|
||||
[PLUGIN_PATH]: {}
|
||||
[PLUGIN_PATH]: {},
|
||||
},
|
||||
git: {
|
||||
tagName: 'v${version}',
|
||||
commitMessage: 'chore: release ${version}'
|
||||
}
|
||||
commitMessage: 'chore: release ${version}',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user