Skip to content

Commit 6a4ea40

Browse files
committed
fix: try to fix error
1 parent ba5870d commit 6a4ea40

File tree

3 files changed

+187
-52
lines changed

3 files changed

+187
-52
lines changed

packages/vue-quill/src/assets/snow.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ backgroundColor = #fff
55
inactiveColor = #4B5563
66
shadowColor = #D1D5DB
77
textColor = #4B5563
8-
// Additional colors
8+
// Additional color
99
backgroundHoverColor = #F3F4F6
1010
backgroundActiveColor = #DBEAFE
1111

scripts/preRelease.ts

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
(async () => {
2+
// const chalk = require('chalk')
3+
// const execa = require('execa')
4+
const path = require('path')
5+
const semanticRelease = require('semantic-release')
6+
// const { WritableStreamBuffer } = require('stream-buffers');
7+
// const stdoutBuffer = WritableStreamBuffer();
8+
// const stderrBuffer = WritableStreamBuffer();
9+
10+
const args = require('minimist')(process.argv.slice(2))
11+
const target = args._[0]
12+
const pkg = require(path.resolve(__dirname, `../packages/${target}`, 'package.json'))
13+
const releaserc = {
14+
branches: [
15+
'master',
16+
'next',
17+
'next-major',
18+
{ name: 'beta', prerelease: true },
19+
{ name: 'alpha', prerelease: true }
20+
],
21+
plugins: [
22+
'@semantic-release/commit-analyzer',
23+
'@semantic-release/release-notes-generator',
24+
[
25+
"@semantic-release/exec",
26+
{
27+
prepareCmd: "npx ts-node ../../scripts/build.ts --nextVersion ${nextRelease.version}"
28+
}
29+
],
30+
'@semantic-release/npm',
31+
[
32+
'@semantic-release/github',
33+
{
34+
assets: [
35+
{
36+
path: `${target}-dist.zip`,
37+
name: `${target}-dist-\$\{nextRelease.gitTag\}.zip`,
38+
label: 'Distribution code (zip)'
39+
}
40+
]
41+
}
42+
]
43+
]
44+
}
45+
46+
await run()
47+
48+
async function run() {
49+
// const nextVersion = await getNextVersion()
50+
// console.log(nextVersion)
51+
// await prepare(target)
52+
await release()
53+
}
54+
55+
// async function prepare(target: string/*, nextVersion: string*/) {
56+
// try {
57+
// // const buildScript = path.resolve(__dirname, 'build.ts')
58+
// // console.log(chalk.bgCyan("Build package"))
59+
// // execa.sync('npx', ['ts-node', buildScript, '--nextVersion', nextVersion])
60+
// console.log(chalk.bgCyan("Zipping distribution file"))
61+
// execa.sync('zip', ['-r', `${target}-dist.zip`, '.', '-i', 'dist'])
62+
// } catch (err) {
63+
// console.log(`>>>>>>>>>>>>> ${err}`)
64+
// }
65+
// }
66+
67+
async function release() {
68+
const rootDir = path.resolve(__dirname, '..')
69+
try {
70+
console.log(`>>>>>>>>>>>>> Semantic release`)
71+
const result = await semanticRelease({
72+
// Core options
73+
branches: releaserc.branches,
74+
repositoryUrl: pkg.repository.url,
75+
plugins: releaserc.plugins
76+
}, {
77+
// Run semantic-release from `/path/to/git/repo/root` without having to change local process `cwd` with `process.chdir()`
78+
cwd: rootDir,
79+
// Pass the variable `MY_ENV_VAR` to semantic-release without having to modify the local `process.env`
80+
env: { ...process.env },
81+
// Store stdout and stderr to use later instead of writing to `process.stdout` and `process.stderr`
82+
// stdout: stdoutBuffer,
83+
// stderr: stderrBuffer
84+
});
85+
86+
if (result) {
87+
console.log(`>>>>>>>>>>>>> Result`)
88+
const { lastRelease, commits, nextRelease, releases } = result;
89+
90+
console.log(`Published ${nextRelease.type} release version ${nextRelease.version} containing ${commits.length} commits.`);
91+
92+
if (lastRelease.version) {
93+
console.log(`The last release was "${lastRelease.version}".`);
94+
}
95+
96+
for (const release of releases) {
97+
console.log(`The release was published with plugin "${release.pluginName}".`);
98+
}
99+
} else {
100+
console.log('No release published.');
101+
}
102+
103+
// Get stdout and stderr content
104+
// const logs = stdoutBuffer.getContentsAsString('utf8');
105+
// const errors = stderrBuffer.getContentsAsString('utf8');
106+
// console.log(logs, errors);
107+
108+
} catch (err) {
109+
console.error('The automated release failed with %O', err)
110+
}
111+
}
112+
113+
// async function getNextVersion(): Promise<string> {
114+
// try {
115+
// const { nextRelease } = await semanticRelease({
116+
// branches: releaserc.branches,
117+
// repositoryUrl: pkg.repository.url,
118+
// dryRun: true,
119+
// ci: false,
120+
// plugins: [
121+
// '@semantic-release/commit-analyzer',
122+
// [
123+
// "@semantic-release/exec",
124+
// {
125+
// prepareCmd: "npx ts-node ../../scripts/build.ts --nextVersion ${nextRelease.version}"
126+
// }
127+
// ]
128+
// ]
129+
// }, {
130+
// cwd: '../../',
131+
// env: { ...process.env }
132+
// })
133+
// if (nextRelease) return nextRelease.version
134+
// else console.log('No release will bepublished')
135+
// } catch (err) {
136+
// console.error('Failed to retrieve next version with %O', err)
137+
// }
138+
// return pkg.version
139+
// }
140+
})()

scripts/release.ts

Lines changed: 46 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(async () => {
2-
// const chalk = require('chalk')
3-
// const execa = require('execa')
2+
const chalk = require('chalk')
3+
const execa = require('execa')
44
const path = require('path')
55
const semanticRelease = require('semantic-release')
66
// const { WritableStreamBuffer } = require('stream-buffers');
@@ -21,12 +21,6 @@
2121
plugins: [
2222
'@semantic-release/commit-analyzer',
2323
'@semantic-release/release-notes-generator',
24-
[
25-
"@semantic-release/exec",
26-
{
27-
prepareCmd: "npx ts-node ../../scripts/build.ts --nextVersion ${nextRelease.version}"
28-
}
29-
],
3024
'@semantic-release/npm',
3125
[
3226
'@semantic-release/github',
@@ -46,26 +40,26 @@
4640
await run()
4741

4842
async function run() {
49-
// const nextVersion = await getNextVersion()
50-
// console.log(nextVersion)
51-
// await prepare(target)
43+
const nextVersion = await getNextVersion()
44+
console.log(nextVersion)
45+
await prepare(target)
5246
await release()
5347
}
5448

55-
// async function prepare(target: string/*, nextVersion: string*/) {
56-
// try {
57-
// // const buildScript = path.resolve(__dirname, 'build.ts')
58-
// // console.log(chalk.bgCyan("Build package"))
59-
// // execa.sync('npx', ['ts-node', buildScript, '--nextVersion', nextVersion])
60-
// console.log(chalk.bgCyan("Zipping distribution file"))
61-
// execa.sync('zip', ['-r', `${target}-dist.zip`, '.', '-i', 'dist'])
62-
// } catch (err) {
63-
// console.log(`>>>>>>>>>>>>> ${err}`)
64-
// }
65-
// }
49+
async function prepare(target: string/*, nextVersion: string*/) {
50+
try {
51+
// const buildScript = path.resolve(__dirname, 'build.ts')
52+
// console.log(chalk.bgCyan("Build package"))
53+
// execa.sync('npx', ['ts-node', buildScript, '--nextVersion', nextVersion])
54+
console.log(chalk.bgCyan("Zipping distribution file"))
55+
execa.sync('zip', ['-r', `${target}-dist.zip`, '.', '-i', 'dist'])
56+
} catch (err) {
57+
console.log(`>>>>>>>>>>>>> ${err}`)
58+
}
59+
}
6660

6761
async function release() {
68-
const rootDir = path.resolve(__dirname, '..')
62+
// const rootDir = path.resolve(__dirname, '..')
6963
try {
7064
console.log(`>>>>>>>>>>>>> Semantic release`)
7165
const result = await semanticRelease({
@@ -75,7 +69,7 @@
7569
plugins: releaserc.plugins
7670
}, {
7771
// Run semantic-release from `/path/to/git/repo/root` without having to change local process `cwd` with `process.chdir()`
78-
cwd: rootDir,
72+
// cwd: rootDir,
7973
// Pass the variable `MY_ENV_VAR` to semantic-release without having to modify the local `process.env`
8074
env: { ...process.env },
8175
// Store stdout and stderr to use later instead of writing to `process.stdout` and `process.stderr`
@@ -110,31 +104,32 @@
110104
}
111105
}
112106

113-
// async function getNextVersion(): Promise<string> {
114-
// try {
115-
// const { nextRelease } = await semanticRelease({
116-
// branches: releaserc.branches,
117-
// repositoryUrl: pkg.repository.url,
118-
// dryRun: true,
119-
// ci: false,
120-
// plugins: [
121-
// '@semantic-release/commit-analyzer',
122-
// [
123-
// "@semantic-release/exec",
124-
// {
125-
// prepareCmd: "npx ts-node ../../scripts/build.ts --nextVersion ${nextRelease.version}"
126-
// }
127-
// ]
128-
// ]
129-
// }, {
130-
// cwd: '../../',
131-
// env: { ...process.env }
132-
// })
133-
// if (nextRelease) return nextRelease.version
134-
// else console.log('No release will bepublished')
135-
// } catch (err) {
136-
// console.error('Failed to retrieve next version with %O', err)
137-
// }
138-
// return pkg.version
139-
// }
107+
async function getNextVersion(): Promise<string> {
108+
const rootDir = path.resolve(__dirname, '..')
109+
try {
110+
const { nextRelease } = await semanticRelease({
111+
branches: releaserc.branches,
112+
repositoryUrl: pkg.repository.url,
113+
// dryRun: true,
114+
ci: false,
115+
plugins: [
116+
'@semantic-release/commit-analyzer',
117+
[
118+
"@semantic-release/exec",
119+
{
120+
prepareCmd: "npx ts-node scripts/build.ts --nextVersion ${nextRelease.version}"
121+
}
122+
]
123+
]
124+
}, {
125+
cwd: rootDir,
126+
env: { ...process.env }
127+
})
128+
if (nextRelease) return nextRelease.version
129+
else console.log('No release will bepublished')
130+
} catch (err) {
131+
console.error('Failed to retrieve next version with %O', err)
132+
}
133+
return pkg.version
134+
}
140135
})()

0 commit comments

Comments
 (0)