flex-development / grease Goto Github PK
View Code? Open in Web Editor NEW๐ Release workflow tool for Node.js and CLI environments
Home Page: https://github.com/flex-development/grease
License: BSD 3-Clause "New" or "Revised" License
๐ Release workflow tool for Node.js and CLI environments
Home Page: https://github.com/flex-development/grease
License: BSD 3-Clause "New" or "Revised" License
Assuming a project's distribution tag (dist tag) is indicated in its version number (e.g 3.13.98-dev.640
where dev
is the intended dist tag), IGreaseOptions.prerelease
can be autogenerated.
Although it needs some refactoring, the logic required has actually been implemented in several Flex Development release workflows (even this one!):
prerelease: ((): string | undefined => {
const tag = $version.split('-')[1]
return !tag ? undefined : tag.includes('.') ? tag.split('.')[0] : tag
})()
This feature would remove the need for grease
users to set prerelease
if their project's dist tag is included in the project version number. To still allow for custom prerelease
settings or omitting the option altogether, this feature should be opt-in.
prereleaseAuto
to true
User goals | Usage frequency | Difficulty scale |
---|---|---|
ie. What the user wants to accomplish | ie. Daily, weekly, monthly, yearly | ie. Scale of 1 - 5 (filled out post submission) |
generate prerelease tag based on package.json#version (opt) |
daily | 1 |
All commits for a new project version are not added to its CHANGELOG
entry.
grease
with options.dryRun === true
in a project versioned after v1.0.0
changelog
lifecycle options.dryRun
outputWith respect to options.path
, all commits should be able to be found in the CHANGELOG
.
Commits that made it into the CHANGELOG
interspersed with missing build
scope commits
grease
output
v16.6.0
macOS v11.3.1
[email protected]
[email protected]
Unsure, need to search the standard-version
library for possible related issues and debug grease
.
options.path
was unsetCHANGELOG
entry for @flex-development/[email protected]
was missing all build
(:hammer: Build) scope commits. Commit entries needed to be manually addedCreateReleaseDTO#toString
does not correctly parse CreateReleaseDTO#notes
if it contains inline code strings.
This results in /bin/sh: *
errors and the greaser
lifecycle interspersing shell errors throughout release notes (see screenshots below).
grease
/bin/sh: * command not found
errorsCreateReleaseDTO#toString
should replace special characters in CreateReleaseDTO#notes
when stringifying releases.
greaser
lifecycle output for @flex-development/[email protected]
Release notes interspersed with shell errors
Commits with code strings
v16.6.0
macOS v11.3.1
[email protected]
grease<=1.1.0
node-shell-quote
shelljs
with zx
, then use $.quote
node-shell-quote
in TypeScript, then integrateCHANGELOG
entry for @flex-development/[email protected]
was missing all build
(:hammer: Build) scope commits. Not sure if this issue is related to this bug, but commit entries needed to be manually addedgrease
should utilize semver
utilities to preset IGreaseOptions.firstRelease
.
This feature would refactor the grease
workflow. Before the bump
lifecycle, if the package version satisfies 1.0.0
and the option isn't set by the user, options.firstRelease
will be set to true. Satisfying versions should include:
1.0.0
1.0.0-<prerelease>
, e.g 1.0.0-beta
1.0.0-<prerelease>.<build-number>
, e.g 1.0.0-dev.13
N/A
User goals | Usage frequency | Difficulty scale |
---|---|---|
ie. What the user wants to accomplish | ie. Daily, weekly, monthly, yearly | ie. Scale of 1 - 5 (filled out post submission) |
set options.firstRelease if final package version satisfies 1.0.0 && argv.firstRelease === undefined |
daily | 1 |
If a project version is being bumped after v1.0.0
, options.dryRun === true
, and release notes are being generated from a project CHANGELOG
, the notes
lifecycle does not log the generated release notes.
Instead, an Exception
is thrown because the new project version hasn't been written to the CHANGELOG
, and therefore can not be found within the CHANGELOG
content.
grease
with options.dryRun === true
in a project versioned after v1.0.0
notes
lifecycleThe notes
lifecycle should not require a version
argument if options.dryRun === true
.
grease
output for @flex-development/[email protected]
v16.6.0
macOS v11.3.1
[email protected]
grease<=1.1.0
If possible, the notes
lifecycle should tap into standard-version
changelog
lifecycle to use its options.dryRun
output.
The changelog
lifecycle could also be re-implemented in grease
, but it may be difficult to keep track of future updates to standard-version
. If it is re-implemented, however, the lifecycle signature could be updated and the return type could be changed to Promise<string>
, where string
is the new CHANGELOG
entry, Promise<void>
:
const Changelog: (
options?: IGreaseOptions,
newVersion?: NullishSemanticVersion
) => Promise<NullishString>
The notes
lifecycle signature could also be updated:
const Notes: (
options?: IGreaseOptions,
changelog?: NullishString,
version?: NullishSemanticVersion
) => Promise<NullishString>
Exception
origin in notes
lifecycle
// Search for package version in changelog content
if (!versions.includes(version)) {
const data = { errors: { version }, versions }
const message = `${version} not found in ${options.infile}`
throw new Exception(ExceptionStatusCode.NOT_FOUND, message, data)
}
If running the greaser
lifecycle and options.skip.tag === true
, a ValidationException
is thrown because the tag isn't pushed to the current repository. This prevents maintainers from integrating grease
with GitHub Action workflows that create release tags.
โน starting github release...
โ CreateReleaseDTO validation failure: [version]
{
name: 'BAD_REQUEST',
message: 'CreateReleaseDTO validation failure: [version]',
code: 400,
className: 'bad-request',
data: {
target: {
draft: true,
files: [ './*.tgz' ],
notes: '## Overview\n\n\n<!-- Package overview -->\n\n\n## Features\n\n\n\n\n-\n-\n-\n\n\n',
notesFile: undefined,
prerelease: false,
repo: undefined,
target: 'main',
title: undefined,
version: 'v1.0.0'
}
},
errors: [
{
value: 'v1.0.0',
property: 'version',
children: [],
constraints: { isSemVer: 'version must be pushed to current git repository' }
}
]
}
grease
with options.skip.tag
set to true
greaser
lifecycle to startIf options.skip.tag === true
, CreateReleaseDTO#version
validation should be skipped.
[email protected]
v16.6.0
/ yarn 3.0.1
The ValidateIf
logic for CreateReleaseDTO#version
should be updated:
@ValidateIf(() => !$c.options.dryRun && !$c.options.skip?.tag)
readonly version: ICreateReleaseDTO['version']
ValidateIf
logic for CreateReleaseDTO#version
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.