New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FLUID-5799, FLUID-5967: Reducing Fragility #5
Changes from all commits
c863229
d8bf7b2
a64ac5f
4a37de5
2edf5c8
bf764ca
140c2cd
0a69275
be30428
49e5978
36feebf
cd241fc
cb85d89
099f773
0e0d366
7a4f85a
74478a1
66d5a98
2775e6a
3ed2231
e663e25
35a2d3c
f7da24a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "eslint-config-fluid" | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ npm install fluid-publish --save-dev | |
|
||
## Usage ## | ||
|
||
### Command Line ### | ||
### Command Line API ### | ||
|
||
Run these commands from the root directory of the module to be published. | ||
|
||
|
@@ -27,6 +27,20 @@ fluid-publish | |
./node_modules/.bin/fluid-publish | ||
``` | ||
|
||
#### --version #### | ||
|
||
__value__: true (Boolean) | ||
|
||
Returns the current version of the Fluid-Publish module itself. No publishing | ||
steps will occur when this flag is enabled. | ||
|
||
```bash | ||
# returns the version of fluid-publish | ||
fluid-publish --version | ||
# fluid-publish 2.0.0 | ||
``` | ||
|
||
|
||
#### --standard #### | ||
|
||
__value__: true (Boolean) | ||
|
@@ -54,25 +68,23 @@ fluid-publish | |
fluid-publish --standard | ||
``` | ||
|
||
#### --options ##### | ||
#### options ##### | ||
|
||
__value__: {String} stringified JSON object | ||
Optional key/value pairs, in the form `key=value`, to override the default configuration used across the publish script. The defaults can be found in publish.js's [package.json](package.json) file under the `defaultOptions` key. | ||
|
||
A stringified JSON object containing overrides to the default options used across the publish script. The defaults can be found in publish.js's [package.json](package.json) file under the `defaultOptions` key. | ||
<em><strong>NOTE</strong>: If only a <code>key</code> is provided, the value is assumed to be <code>true</code></em> | ||
|
||
(See: [Options](#options)) | ||
(See: [Options](#options), [process.argv](https://nodejs.org/docs/latest/api/process.html#process_process_argv)) | ||
|
||
```bash | ||
# publishes a dev build and applies the tag "nightly" to it | ||
fluid-publish --options="{'devTag': 'nightly'}" | ||
fluid-publish devTag="nightly" | ||
``` | ||
|
||
### Node ### | ||
### JavaScript API ### | ||
|
||
##### parameters ##### | ||
fluid.publish can also be accessed through standard JavaScript function calls in a [node](https://nodejs.org) app. | ||
|
||
* isTest {Boolean} - Indicates if this is a test run, if true a tarball will be generated instead of publishing to NPM. | ||
* options {Object} - The defaults can be found in publish.js's [package.json](package.json) file under the `defaultOptions` key. (See: [Options](#options)) | ||
|
||
#### `dev` #### | ||
|
||
|
@@ -83,10 +95,10 @@ var publish = require("fluid-publish"); | |
publish.dev(); | ||
``` | ||
|
||
##### parameters ##### | ||
##### arguments ##### | ||
|
||
* isTest {Boolean} - Indicates if this is a test run, if true a tarball will be generated instead of publishing to NPM. | ||
* options {Object} - The defaults can be found in publish.js's [package.json](package.json) file under the `defaultOptions` key. (See: [Options](#options)) | ||
1. isTest {Boolean} - Indicates if this is a test run, if true a tarball will be generated instead of publishing to NPM. | ||
2. options {Object} - The defaults can be found in publish.js's [package.json](package.json) file under the `defaultOptions` key. (See: [Options](#options)) | ||
|
||
#### `standard` #### | ||
|
||
|
@@ -97,6 +109,11 @@ var publish = require("fluid-publish"); | |
publish.standard(); | ||
``` | ||
|
||
##### arguments ##### | ||
|
||
1. isTest {Boolean} - Indicates if this is a test run, if true a tarball will be generated instead of publishing to NPM. | ||
2. options {Object} - The defaults can be found in publish.js's [package.json](package.json) file under the `defaultOptions` key. (See: [Options](#options)) | ||
|
||
## Options ## | ||
|
||
<table> | ||
|
@@ -125,6 +142,17 @@ publish.standard(); | |
"git status -s -uno" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>checkRemoteCmd</code> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This material doesn't appear in this diff (yet) but this is the closest line: i) There's a typo where "--standard" appears twice, presumably the first instance should be "--version" fluid-publish remoteName="origin" --standard etc. |
||
</td> | ||
<td> | ||
The CLI to execute which determines if the remote repository exists. This prevents trying to push a version control tag to a repo that doesn't exist. | ||
</td> | ||
<td> | ||
"git ls-remote --exit-code ${remote}" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>rawTimestampCmd</code> | ||
|
@@ -171,45 +199,30 @@ publish.standard(); | |
</tr> | ||
<tr> | ||
<td> | ||
<code>versionCmd</code> | ||
<code>publishDevCmd</code> | ||
</td> | ||
<td> | ||
The CLI to execute which sets the dev version to release under. | ||
<ul> | ||
<li> | ||
<code>${version}</code> will be substituted with the generated dev build version. | ||
</li> | ||
</ul> | ||
The CLI to execute which publishes a development release to NPM. | ||
Uses the value specified by the `devTag` option. | ||
</td> | ||
<td> | ||
"npm version --no-git-tag-version ${version}" | ||
<br> | ||
<br> | ||
<p> | ||
<em><strong>NOTE</strong>: This command will update the version in the package.json file, but will not commit the change.</em> | ||
</p> | ||
"npm publish --tag ${devTag}" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>distTagCmd</code> | ||
<code>versionCmd</code> | ||
</td> | ||
<td> | ||
The CLI to execute which tags an NPM release. | ||
The CLI to execute which sets the dev version to release under. | ||
<ul> | ||
<li> | ||
<code>${packageName}</code> will be substituted with executing module's name. | ||
</li> | ||
<li> | ||
<code>${version}</code> will be substituted with the generated dev build version. | ||
</li> | ||
<li> | ||
<code>${tag}</code>will be substituted with the value from the <code>devTag</code> option. | ||
</li> | ||
</ul> | ||
</td> | ||
<td> | ||
"npm dist-tag add ${packageName}@${version} ${tag}" | ||
"npm version --no-git-tag-version ${version}" | ||
<br> | ||
<br> | ||
<p> | ||
|
@@ -298,6 +311,83 @@ publish.standard(); | |
"dev" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>remoteName</code> | ||
</td> | ||
<td> | ||
The remote repository to push version control tag to. | ||
</td> | ||
<td> | ||
"upstream" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>changesHint</code> | ||
</td> | ||
<td> | ||
A hint for addressing uncommitted changes. | ||
</td> | ||
<td> | ||
"Address uncommitted changes: Commit \"git commit -a\", Stash \"git stash\" or Clean \"git reset --hard\"\n" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>checkRemoteHint</code> | ||
</td> | ||
<td> | ||
A hint for addressing an issue where the remote repository cannot be found. | ||
</td> | ||
<td> | ||
"Run \"git remote -v\" for a list of available remote repositories.\n" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>publishHint</code> | ||
</td> | ||
<td> | ||
A hint for addressing an issue where publishing a standard release to the registry fails. | ||
</td> | ||
<td> | ||
"Ensure that you have access to publish to the registry and that the current version does not already exist.\n" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>publishDevHint</code> | ||
</td> | ||
<td> | ||
A hint for addressing an issue where publishing a development (pre-release) to the registry fails. | ||
</td> | ||
<td> | ||
"Ensure that you have access to publish to the registry and that the current version does not already exist.\nIf the npm tag specified by --tag is recognizable as a valid semver version number, it will be rejected by npm. This is because version numbers and tags share a common namespace for npm packages.\n" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>vcTagHint</code> | ||
</td> | ||
<td> | ||
A hint for addressing an issue where applying a version control tag fails. | ||
</td> | ||
<td> | ||
"If the tag already exists, run \"git tag -d v${version}\" to remove the existing tag.\n" | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>pushVCTagHint</code> | ||
</td> | ||
<td> | ||
A hint for addressing an issue where pushing a version control tag to a remote repository fails. | ||
</td> | ||
<td> | ||
"If the tag already exists, run \"git push ${remote} :refs/tags/v${version} to remove the existing tag.\n" | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"name": "fluid-publish", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "A command line tool and node module that can be used to simplify the process of publishing a module to NPM. This is particularly useful for creating development releases, e.g. nightly or continuous integration releases.", | ||
"main": "publish.js", | ||
"engines": { | ||
"node": ">=0.12.0" | ||
"node": ">=4.0.0" | ||
}, | ||
"scripts": { | ||
"pub": "node publish.js", | ||
|
@@ -30,27 +30,36 @@ | |
"homepage": "http://fluidproject.org", | ||
"dependencies": { | ||
"es6-template-strings": "2.0.0", | ||
"extend": "^3.0.0" | ||
"extend": "3.0.0" | ||
}, | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt-contrib-jshint": "~0.9.0", | ||
"grunt": "1.0.1", | ||
"eslint-config-fluid": "1.0.0", | ||
"fluid-grunt-eslint": "18.1.2", | ||
"grunt-jsonlint": "1.0.4", | ||
"sinon": "^1.17.1" | ||
"sinon": "1.17.1" | ||
}, | ||
"defaultOptions": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note for the future - this strategy of packing configuration options into package.json is cute, but doesn't actually enable reuse of the functionality. In order to customise these strings, the user has to fork this module and change them! When we start work on the "mature multirepo fluid-publish" sketched out in #7, we should move this module over to being a standard Infusion component and have all these options as part of its defaults. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the default values aren't easily modifiable. In execution they are, but I agree that's not great for reuse and building upon. |
||
"changesCmd": "git status -s -uno", | ||
"checkRemoteCmd": "git ls-remote --exit-code ${remote}", | ||
"rawTimestampCmd": "git show -s --format=%ct HEAD", | ||
"revisionCmd": "git rev-parse --verify --short HEAD", | ||
"packCmd": "npm pack", | ||
"publishCmd": "npm publish", | ||
"publishDevCmd": "npm publish --tag ${devTag}", | ||
"versionCmd": "npm version --no-git-tag-version ${version}", | ||
"distTagCmd": "npm dist-tag add ${packageName}@${version} ${tag}", | ||
"cleanCmd": "git checkout -- package.json", | ||
"vcTagCmd": "git tag -a v${version} -m 'Tagging the ${version} release'", | ||
"pushVCTagCmd": "git push upstream v${version}", | ||
"pushVCTagCmd": "git push ${remote} v${version}", | ||
"devVersion": "${version}-${preRelease}.${timestamp}.${revision}", | ||
"devTag": "dev", | ||
"moduleRoot": "" | ||
"remoteName": "upstream", | ||
"moduleRoot": "", | ||
"changesHint": "Address uncommitted changes: Commit \"git commit -a\", Stash \"git stash\" or Clean \"git reset --hard\"\n", | ||
"checkRemoteHint": "Run \"git remote -v\" for a list of available remote repositories.\n", | ||
"publishHint": "Ensure that you have access to publish to the registry and that the current version does not already exist.\n", | ||
"publishDevHint": "Ensure that you have access to publish to the registry and that the current version does not already exist.\nIf the npm tag specified by --tag is recognizable as a valid semver version number, it will be rejected by npm. This is because version numbers and tags share a common namespace for npm packages.\n", | ||
"vcTagHint": "If the tag already exists, run \"git tag -d v${version}\" to remove the existing tag.\n", | ||
"pushVCTagHint": "If the tag already exists, run \"git push ${remote} :refs/tags/v${version} to remove the existing tag.\n" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could you update this to our new shared eslint repo - thanks!