Comments (3)
@Matrim-Cauthon, should we go ahead and use npm version minor
by using npm.commands
? I found this on NPM website:
Although npm can be used programmatically, its API is meant for use by the CLI only, and no guarantees are made regarding its fitness for any other purpose. If you want to use npm to reliably perform some task, the safest thing to do is to invoke the desired npm command with appropriate arguments.
We could however go ahead and use it programmatically, but there are alternatives to this.
- One is by updating the package.json and bower.json files
- Or, by executing a CLI command through nodejs using
require('child_process').exec
I tried both approach, and it would work as expected. One thing to note though is that when using npm version
, it would auto-tag it and auto-commit it (thus requiring the current branch to be clean) unless we add a --no-git-tag-version
flag and --force
flag to prevent it from auto-committing and auto-tagging.
Another possible approach is by using the ordinary npm version
on the CLI itself, but adding a 'scripts' attribute on the package.json:
"scripts": {
"preversion": "gulp test",
"version": "gulp version && git add",
"postversion": "git push && git push --tags"
}
The gulp version
should build the file and add the necessary comments on the compiled xjs.js. Also, it could version up the bower file programmatically.
from xjs.
should we go ahead and use npm version minor
Note that we don't just need to bump the minor version. This will be true especially when we do true semver, which will happen when we get to a stable version --- 1.X.X or higher.
I'm biased towards a gulp-based approach since we're using that to define our most-commonly used tasks anyway. How it's implemented under the hood is not important as long as we're able to specify how to bump the version number 👍
from xjs.
The npm version minor was just an example. So we'll just go ahead and do this:
One is by updating the package.json and bower.json files
This way, we will be the ones to manually commit the changes, and manually add the tag. I believe this is OK since we usually bump the versions on the develop or release branch, while we tag the versions on our master branch.
The command would be like this:
gulp version --major|minor|patch --up|down
Without the flags, it would behave as gulp version --minor --up
What this gulp task would do is execute the default
task first, then execute the version up/down task.
from xjs.
Related Issues (20)
- Issues with case sensitive matching HOT 1
- Allow `duplicate` item calls to return UIDs of newly added sources
- Expose method to refresh source on show and on scene enter
- Fix documentation
- OnAsyncCallback should handle more than two parameters
- Typescript type definitions HOT 1
- Ability to copy presets
- Provide event callbacks for presets
- How to get source id for item HOT 5
- Set 'play on source show' on media items HOT 1
- Bug ActionAfterPlayback; wrong constants HOT 1
- Bug: isVideo returns false on looping videos
- getPlaybackDuration only works for active scene HOT 1
- Race condition for isVisible (and possibly more checks) HOT 1
- from php script i want to change dynamically source media HOT 3
- Apply new audio changes to XJS HOT 2
- Xsplit Broadcaster extension store
- Stream and recording start/stop event notification HOT 4
- Unable to get name of Scenes HOT 5
- Which kind of format must be? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xjs.