Skip to content

Commit

Permalink
feat($config): add config json file
Browse files Browse the repository at this point in the history
  • Loading branch information
iq9891 committed Oct 29, 2021
1 parent 9ed39ab commit eaf4be1
Show file tree
Hide file tree
Showing 29 changed files with 9,466 additions and 53 deletions.
13 changes: 11 additions & 2 deletions gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,20 @@ function createBuildTask(name: TBuildType): string {
.pipe(gulp.dest(`${cwd}/styles`));
});

gulp.task(`build-copy-${name}`, () => {
gulp.task(`build-copy-icons-${name}`, () => {
return gulp.src('source/icons.json', { cwd: root }).pipe(gulp.dest(cwd));
});

tasks.push(`build-css-${name}`, `build-less-${name}`, `build-copy-${name}`);
gulp.task(`build-copy-config-${name}`, () => {
return gulp.src('source/config.json', { cwd: root }).pipe(gulp.dest(cwd));
});

tasks.push(
`build-css-${name}`,
`build-less-${name}`,
`build-copy-icons-${name}`,
`build-copy-config-${name}`,
);
}

gulp.task(`build-${name}`, gulp.parallel(tasks));
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"id": "ts-node scripts/get-ids.ts",
"lint:fix": "eslint './**/*.{js,ts,tsx,json}' --fix && pretty-quick",
"lint": "eslint './**/*.{js,ts,tsx,json}' && pretty-quick",
"release": "ts-node ./scripts/release.ts",
"release:before": "ts-node ./scripts/release-hooks-before",
"build:code": "gulp"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler/src/generator/all-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ export class AllGenerator extends RuntimeGenerator {
"originSvg = originSvg[originSvg.length - 1] === '\"' ? originSvg.substr(0, originSvg.length - 1) : originSvg;",
);
this.writeLine(
`originSvg = originSvg.replace(/width="d{0,}"/, \`width="\${size}"\`);`,
`originSvg = originSvg.replace(/width="\\d{0,}\\w{2,3}"/, \`width="\${size}"\`);`,
);
this.writeLine(
`originSvg = originSvg.replace(/height="d{0,}"/, \`height="\${size}"\`);`,
`originSvg = originSvg.replace(/height="\\d{0,}\\w{2,3}"/, \`height="\${size}"\`);`,
);
this.writeLine();
this.writeLine("let contentHtml = svgItem ? originSvg : '';");
Expand Down
6 changes: 3 additions & 3 deletions packages/compiler/src/generator/cube-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ export class CubeGenerator extends RuntimeGenerator {
);
this.writeLine();
this.writeLine(
`originSvg = originSvg.replace(/viewBox=\"\d{0,} \d{0,} \d{0,} \d{0,}\"/, \`viewBox="\${viewBox}"\`);`,
`originSvg = originSvg.replace(/viewBox=\"\\d{0,} \\d{0,} \\d{0,} \\d{0,}\"/, \`viewBox="\${viewBox}"\`);`,
);
this.writeLine(
`originSvg = originSvg.replace(/width="\d{0,}"/, \`width="\${size}"\`);`,
`originSvg = originSvg.replace(/width="\\d{0,}\\w{2,3}"/, \`width="\${size}"\`);`,
);
this.writeLine(
`originSvg = originSvg.replace(/height="\d{0,}"/, \`height="\${size}"\`);`,
`originSvg = originSvg.replace(/height="\\d{0,}\\w{2,3}"/, \`height="\${size}"\`);`,
);
this.writeLine();
this.writeLine(`let contentHtml = svgItem ? originSvg : '';`);
Expand Down
30 changes: 30 additions & 0 deletions packages/cube-vue/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"prefix": "cube",
"spin": false,
"rtl": false,
"size": 48,
"strokeWidth": 4,
"strokeLinejoin": "round",
"strokeLinecap": "round",
"theme": "outline",
"colors": {
"outline": {
"outStrokeColor": "#333",
"outFillColor": "transparent"
},
"filled": {
"outStrokeColor": "#333",
"outFillColor": "transparent"
},
"twoTone": {
"outStrokeColor": "#333",
"outFillColor": "#2f88ff"
},
"multiColor": {
"outStrokeColor": "#333",
"outFillColor": "#2f88ff",
"innerStrokeColor": "#fff",
"innerFillColor": "#43ccf8"
}
}
}
Loading

0 comments on commit eaf4be1

Please sign in to comment.