Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

npm-scripts-versioning

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-scripts-versioning - npm Package Compare versions

Comparing version
1.0.0-beta.0
to
1.0.0-beta.1
+14
-3
lib/push-changed-version-ref-files.js

@@ -6,3 +6,3 @@ #!/usr/bin/env node

*
* Copyright (c) 2017, Brandon D. Sara (https://bsara.github.io/)
* Copyright (c) 2017, Brandon D. Sara (https://bsara.pro/)
*

@@ -27,6 +27,17 @@ * Permission to use, copy, modify, and/or distribute this software for any

const { files, version } = require('../package.json');
const fs = require('fs');
const { files, version } = require('package.json');
const filePaths = pkg.files.filter((filePath) => (filePath.startsWith("!") === false));
if (fs.existsSync('package-lock.json')) {
filePaths.push('package-lock.json');
}
// Commit & push changes
// -------------------------------------------------------------
if (!which('git')) {

@@ -37,3 +48,3 @@ echo("git executable not found! Install git and try again.");

_execCmd(`git add package.json ${files.join(" ")}`, "add (`git add`) changed version reference files");
_execCmd(`git add package.json ${filePaths.join(" ")}`, "add (`git add`) changed version reference files");
_execCmd(`git commit -m "version bump (v${version})"`, "commit version changes");

@@ -40,0 +51,0 @@ _execCmd('git push', "push git version bump commit to default git remote");

+2
-2

@@ -6,3 +6,3 @@ #!/usr/bin/env node

*
* Copyright (c) 2017, Brandon D. Sara (https://bsara.github.io/)
* Copyright (c) 2017, Brandon D. Sara (http://bsara.pro/)
*

@@ -27,3 +27,3 @@ * Permission to use, copy, modify, and/or distribute this software for any

const { version } = require('../package.json');
const { version } = require('package.json');

@@ -30,0 +30,0 @@

@@ -6,3 +6,3 @@ #!/usr/bin/env node

*
* Copyright (c) 2017, Brandon D. Sara (https://bsara.github.io/)
* Copyright (c) 2017, Brandon D. Sara (https://bsara.pro/)
*

@@ -27,8 +27,18 @@ * Permission to use, copy, modify, and/or distribute this software for any

const { name, files, version } = require('../package.json');
const escapeStringRegexp = require('escape-string-regexp');
const { name, files, version } = require('package.json');
files.forEach(function(filePath) {
sed('-i', RegExp(`\\*\\s+${name}\\s+\\d+\\.\\d+\\.\\d+(-\\w+){0,1}(\\.\\d+){0,1}`), `* ${name} v${version}`, filePath);
const filePaths = files.filter((filePath) => (filePath.startsWith("!") === false));
// CREDIT: `semver-regex` NPM package (https://github.com/sindresorhus/semver-regex/blob/master/index.js)
const semverRegex = '\\bv?(?:0|[1-9]\\d*)\\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[\\da-z\\-]+(?:\\.[a-z\\d\\-]+)*)?(?:\\+[a-z\\d\\-]+(?:\\.[a-z\\d\\-]+)*)?\\b';
// Update all files containing project's version in comments
// -------------------------------------------------------------
filePaths.forEach(function(filePath) {
sed('-i', RegExp(`\\*\\s+${escapeStringRegexp(name)}\\s+${semverRegex}`), `* ${name} v${version}`, filePath);
});
ISC License (ISC)
Copyright (c) 2017, Brandon D. Sara (https://bsara.github.io/)
Copyright (c) 2017, Brandon D. Sara (https://bsara.pro/)

@@ -5,0 +5,0 @@ Permission to use, copy, modify, and/or distribute this software for any

{
"name": "npm-scripts-versioning",
"version": "1.0.0-beta.0",
"version": "1.0.0-beta.1",
"description": "",
"authors": [
"Brandon Sara (https://bsara.github.io/)"
"Brandon Sara (https://bsara.pro/)"
],

@@ -40,11 +40,13 @@ "license": "ISC",

"scripts": {
"lint": "eslint ."
"l": "npm run lint",
"lint": "npx eslint ."
},
"dependencies": {
"escape-string-regexp": "^1.0.5",
"shelljs": "^0.7.6"
},
"devDependencies": {
"eslint": "^3.16.1",
"eslint-config-bsara": "^1.1.0"
"@bsara/eslint-config": "^2.1.5",
"eslint": "^3.19.0"
}
}

@@ -32,3 +32,3 @@ # NPM Scripts: Versioning [![NPM Package](https://img.shields.io/npm/v/npm-scripts-versioning.svg?style=flat-square)][npm]

Copyright (c) 2017, Brandon D. Sara (https://bsara.github.io/)
Copyright (c) 2017, Brandon D. Sara (https://bsara.pro/)

@@ -35,0 +35,0 @@ Permission to use, copy, modify, and/or distribute this software for any