Skip to content

Commit

Permalink
fix: cleanup the codes
Browse files Browse the repository at this point in the history
  • Loading branch information
luthfimasruri committed Mar 29, 2021
1 parent 7929e69 commit 9895952
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 155 deletions.
2 changes: 1 addition & 1 deletion packages/vue-quill/src/assets/snow.styl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ backgroundColor = #fff
inactiveColor = #4B5563
shadowColor = #D1D5DB
textColor = #4B5563
// Additional color
// Additional colors
backgroundHoverColor = #F3F4F6
backgroundActiveColor = #DBEAFE

Expand Down
17 changes: 13 additions & 4 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ npm run build -- vue-quill
npm run build -- vue-quill --formats cjs
```
*/
(() => {
(async () => {
const fs = require('fs-extra')
const path = require('path')
const execa = require('execa')
Expand Down Expand Up @@ -41,7 +41,7 @@ npm run build -- vue-quill --formats cjs
const commit =
args.commit || execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)

run()
await run()

async function run() {
if (isRelease) {
Expand Down Expand Up @@ -102,8 +102,17 @@ npm run build -- vue-quill --formats cjs

if (hasTypes && pkg.types) await generateTypes(target)
if (buildAssets && assets.css) {
const buildAssetsRunner = path.resolve(__dirname, 'buildAssets.ts')
await execa('npx', ['ts-node', buildAssetsRunner, target])
const buildAssetsTs = await path.resolve(__dirname, 'buildAssets.ts')
await execa(
'npx',
[
'ts-node',
buildAssetsTs,
target,
isRelease ? '--release' : ''
],
{ stdio: 'inherit' }
)
}
}

Expand Down
6 changes: 2 additions & 4 deletions scripts/buildAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To specify the package assets to build, simply pass its name
npm run assets:build -- vue-quill
```
*/
(() => {
(async () => {
const fs = require('fs-extra')
const path = require('path')
const chalk = require('chalk')
Expand All @@ -29,10 +29,8 @@ npm run assets:build -- vue-quill
// const nextVersion: string =
// args.nextVersion ||
// require(path.resolve(__dirname, '..', 'package.json')).version
// const commit: string =
// args.commit || execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)

run()
await run()

async function run() {
if (isRelease) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm run dev -- vue-quill --formats cjs
__DEV__=false npm run dev
```
*/
(() => {
(async () => {
const execa = require('execa')
const { fuzzyMatchTarget } = require('./utils')

Expand All @@ -26,7 +26,7 @@ __DEV__=false npm run dev
const sourceMap: boolean = args.sourcemap || args.s
const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)

execa(
await execa(
'rollup',
[
'-wc',
Expand Down
4 changes: 2 additions & 2 deletions scripts/devAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To specify the package to build, simply pass its name
npm run assets:build -- vue-quill
```
*/
(() => {
(async () => {
const fs = require('fs-extra')
const path = require('path')
const chalk = require('chalk')
Expand All @@ -24,7 +24,7 @@ npm run assets:build -- vue-quill
const isRelease: boolean = args.release
const buildAllMatching: string[] = args.all || args.a

run()
await run()

async function run() {
if (isRelease) {
Expand Down
140 changes: 0 additions & 140 deletions scripts/preRelease.ts

This file was deleted.

6 changes: 4 additions & 2 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
[
'@semantic-release/exec',
{
prepareCmd: `npx ts-node ../../scripts/build.ts --nextVersion \$\{nextRelease.version\} && zip ${target}-dist.zip -r dist`,
prepareCmd:
'npx ts-node ../../scripts/build.ts --nextVersion \$\{nextRelease.version\} && ' +
`zip ${target}-dist.zip -r dist`
}
],
'@semantic-release/npm',
Expand All @@ -38,7 +40,7 @@
]
}

run()
await run()

async function run() {
const pkgDir = path.resolve(__dirname, `../packages/${target}`)
Expand Down

0 comments on commit 9895952

Please sign in to comment.