Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
3fc24fa9
Commit
3fc24fa9
authored
Mar 06, 2019
by
Dominik Prokop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable @grafana/ui version bump based on package.json contents
parent
358f9cbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
13 deletions
+28
-13
scripts/cli/index.ts
+2
-0
scripts/cli/tasks/grafanaui.release.ts
+26
-13
No files found.
scripts/cli/index.ts
View file @
3fc24fa9
...
@@ -30,9 +30,11 @@ program
...
@@ -30,9 +30,11 @@ program
.
command
(
'gui:release'
)
.
command
(
'gui:release'
)
.
description
(
'Prepares @grafana/ui release (and publishes to npm on demand)'
)
.
description
(
'Prepares @grafana/ui release (and publishes to npm on demand)'
)
.
option
(
'-p, --publish'
,
'Publish @grafana/ui to npm registry'
)
.
option
(
'-p, --publish'
,
'Publish @grafana/ui to npm registry'
)
.
option
(
'-u, --usePackageJsonVersion'
,
'Use version specified in package.json'
)
.
action
(
async
cmd
=>
{
.
action
(
async
cmd
=>
{
await
execTask
(
releaseTask
)({
await
execTask
(
releaseTask
)({
publishToNpm
:
!!
cmd
.
publish
,
publishToNpm
:
!!
cmd
.
publish
,
usePackageJsonVersion
:
!!
cmd
.
usePackageJsonVersion
,
});
});
});
});
...
...
scripts/cli/tasks/grafanaui.release.ts
View file @
3fc24fa9
...
@@ -12,6 +12,7 @@ type VersionBumpType = 'prerelease' | 'patch' | 'minor' | 'major';
...
@@ -12,6 +12,7 @@ type VersionBumpType = 'prerelease' | 'patch' | 'minor' | 'major';
interface
ReleaseTaskOptions
{
interface
ReleaseTaskOptions
{
publishToNpm
:
boolean
;
publishToNpm
:
boolean
;
usePackageJsonVersion
:
boolean
;
}
}
const
promptBumpType
=
async
()
=>
{
const
promptBumpType
=
async
()
=>
{
...
@@ -93,7 +94,7 @@ const ensureMasterBranch = async () => {
...
@@ -93,7 +94,7 @@ const ensureMasterBranch = async () => {
}
}
};
};
const
releaseTaskRunner
:
TaskRunner
<
ReleaseTaskOptions
>
=
async
({
publishToNpm
})
=>
{
const
releaseTaskRunner
:
TaskRunner
<
ReleaseTaskOptions
>
=
async
({
publishToNpm
,
usePackageJsonVersion
})
=>
{
if
(
publishToNpm
)
{
if
(
publishToNpm
)
{
await
ensureMasterBranch
();
await
ensureMasterBranch
();
}
}
...
@@ -109,28 +110,40 @@ const releaseTaskRunner: TaskRunner<ReleaseTaskOptions> = async ({ publishToNpm
...
@@ -109,28 +110,40 @@ const releaseTaskRunner: TaskRunner<ReleaseTaskOptions> = async ({ publishToNpm
console
.
log
(
`Current version:
${
pkg
.
version
}
`
);
console
.
log
(
`Current version:
${
pkg
.
version
}
`
);
do
{
do
{
const
{
type
}
=
await
promptBumpType
();
if
(
!
usePackageJsonVersion
)
{
console
.
log
(
type
);
const
{
type
}
=
await
promptBumpType
();
if
(
type
===
'prerelease'
)
{
console
.
log
(
type
);
const
{
id
}
=
await
promptPrereleaseId
(
'What kind of prerelease?'
,
false
);
if
(
type
===
'prerelease'
)
{
nextVersion
=
semver
.
inc
(
pkg
.
version
,
type
,
id
);
const
{
id
}
=
await
promptPrereleaseId
(
'What kind of prerelease?'
,
false
);
}
else
{
nextVersion
=
semver
.
inc
(
pkg
.
version
,
type
,
id
);
const
{
id
}
=
await
promptPrereleaseId
();
if
(
id
!==
'no'
)
{
nextVersion
=
semver
.
inc
(
pkg
.
version
,
`pre
${
type
}
`
,
id
);
}
else
{
}
else
{
nextVersion
=
semver
.
inc
(
pkg
.
version
,
type
);
const
{
id
}
=
await
promptPrereleaseId
();
if
(
id
!==
'no'
)
{
nextVersion
=
semver
.
inc
(
pkg
.
version
,
`pre
${
type
}
`
,
id
);
}
else
{
nextVersion
=
semver
.
inc
(
pkg
.
version
,
type
);
}
}
}
}
else
{
nextVersion
=
pkg
.
version
;
}
}
console
.
log
(
chalk
.
yellowBright
.
bold
(
`You are going to release a new version of
${
pkg
.
name
}
`
));
console
.
log
(
chalk
.
yellowBright
.
bold
(
`You are going to release a new version of
${
pkg
.
name
}
`
));
console
.
log
(
chalk
.
green
(
`Version bump:
${
pkg
.
version
}
->`
),
chalk
.
bold
.
yellowBright
(
`
${
nextVersion
}
`
));
if
(
usePackageJsonVersion
)
{
console
.
log
(
chalk
.
green
(
`Version based on package.json: `
),
chalk
.
bold
.
yellowBright
(
`
${
nextVersion
}
`
));
}
else
{
console
.
log
(
chalk
.
green
(
`Version bump:
${
pkg
.
version
}
->`
),
chalk
.
bold
.
yellowBright
(
`
${
nextVersion
}
`
));
}
const
{
confirmed
}
=
await
promptConfirm
();
const
{
confirmed
}
=
await
promptConfirm
();
releaseConfirmed
=
confirmed
;
releaseConfirmed
=
confirmed
;
}
while
(
!
releaseConfirmed
);
}
while
(
!
releaseConfirmed
);
await
bumpVersion
(
nextVersion
);
if
(
!
usePackageJsonVersion
)
{
await
bumpVersion
(
nextVersion
);
}
if
(
publishToNpm
)
{
if
(
publishToNpm
)
{
await
publishPackage
(
pkg
.
name
,
nextVersion
);
await
publishPackage
(
pkg
.
name
,
nextVersion
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment