Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

chore(travis): publish next version #192

Merged
merged 1 commit into from
Jun 19, 2017
Merged

chore(travis): publish next version #192

merged 1 commit into from
Jun 19, 2017

Conversation

vchimev
Copy link
Contributor

@vchimev vchimev commented Jun 16, 2017

  • add .travis.yml config
  • add prepublish-next script

@vchimev vchimev requested a review from sis0k0 June 16, 2017 11:27
Copy link
Contributor

@sis0k0 sis0k0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we don't keep the bumped version of the package in the master branch, but use

npm --no-git-tag-version version patch

instead

@@ -0,0 +1,32 @@
#!/usr/bin/env node

var fsModule = require('fs');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { readFileSync, writeFileSync } from "fs";

// Adds a publishConfig section to the package.json file
// and sets a tag to it

var path = './package.json';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const and double quotes in this file

.travis.yml Outdated
branch: vchimev-travis
skip_cleanup: true
api_key:
secure: HYqLXOd6FqNrOO0KTseros1LTkQ+OdZIzL1lncg+3RAcb/pxViVSUHbXZ9ml3ubVFU/ZN6n4l2snmjzCCYlkQ3CeeI6qqLMsXN2ywUFFdDJyFkz7VD0jyxoilS7HXY2TqFWtF58OeBFG5woY2OdfL2dzxrM2hsbs8ODvuUhoA1g0Y4DgH9W/RQK/8Ml+jII16/bzpKNCCI45zxRzzTW80QyxFR1Q2ABXVUQDBQa0LJ38eo8WDl8Jh1RdUTFJwicQG14WZTC69b1Sr4BHpm5nFExp7XX8gbmu6fcMyItGvbIhTqDA02CmjL7MYm5349SiJh+y9wLkxbBIH8rmY3pL3NIL9pBkPoYbWU/ZoG5e1iqc+2RoZjw7VW969IokeFiQV4QiNLEbFC9PnlXQJDmeKQXSh+aRKST6CKxDZxisp4gmt7h+4Rp7gU8BTVGbN0by15S7ab+CL8ZGa8gUqtGHwEjmFEpE0fQvcaZYVQHWO4kw4cwmwqXiyvnF2o5LYjjY4gjGnOOiKS2qZmABjftdUvKc5N0vZ2Vyq1O657EP8RFUAcvIJlZ1dBKDYq/vGr0hQ4iReJXyTYdCWHSNgzq4boAsdes3kHK8I9VBMrlUWmA9Ba/lMAaBgW5qOEQhdtWYKjHwmFadWwHfQocGLqp5TBTqWZF1sCC0OFybsME7SdU=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't that be 'secure' and not in source control?


var path = './package.json';
var fileOptions = {encoding: "utf-8"};
var content = fsModule.readFileSync(path, fileOptions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use the "getPackageJson" method from "../projectHelpers"

}

var packageDef = JSON.parse(content);
if (!packageDef.publishConfig) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packageDef.publishConfig = Object.assign(
packageDef.publishConfig || {},
{ tag });

instead of 19-22

}
packageDef.publishConfig.tag = tag;

if (packageDef.private) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed,

delete packageDef.private

the above will return true always even if 'private' doesn't exist

var package_version = process.argv[3];
packageDef.version += '-' + package_version;

var newContent = JSON.stringify(packageDef, null, ' ');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use "writePackageJson" from the projectHelpers

delete packageDef.private;
}

var package_version = process.argv[3];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can extract the process args in the beginning of the file

@vchimev vchimev force-pushed the vchimev-travis branch 3 times, most recently from e1ba920 to 2e451b2 Compare June 16, 2017 14:04
- add .travis.yml config
- add prepublish-next script
@vchimev vchimev merged commit 46b4584 into master Jun 19, 2017
@vchimev vchimev deleted the vchimev-travis branch June 19, 2017 11:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants