Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

add-dist-header

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

add-dist-header - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

2

bin/cli.js

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

// Parameters
const validFlags = ['delimiter', 'keep', 'no-version', 'quiet'];
const validFlags = ['delimiter', 'keep', 'no-version', 'note', 'quiet'];
const args = process.argv.slice(2);

@@ -35,0 +35,0 @@ const flags = args.filter(arg => /^--/.test(arg));

@@ -1,2 +0,2 @@

//! add-dist-header v0.3.4 ~~ https://github.com/center-key/add-dist-header ~~ MIT License
//! add-dist-header v0.3.5 ~~ https://github.com/center-key/add-dist-header ~~ MIT License

@@ -3,0 +3,0 @@ export declare type Settings = {

@@ -1,2 +0,2 @@

//! add-dist-header v0.3.4 ~~ https://github.com/center-key/add-dist-header ~~ MIT License
//! add-dist-header v0.3.5 ~~ https://github.com/center-key/add-dist-header ~~ MIT License

@@ -43,4 +43,5 @@ import { isBinary } from 'istextorbinary';

const out2 = settings.replaceComment ? out1.replace(firstLine[type], '') : out1;
const versionPattern = /~~~version~~~/g;
const out3 = settings.setVersion ? out2.replace(versionPattern, pkg.version) : out2;
const versionPattern = /{{pkg[.]version}}/g;
const deprecated = /~~~version~~~/g;
const out3 = settings.setVersion ? out2.replace(versionPattern, pkg.version).replace(deprecated, pkg.version) : out2;
const info = (_c = (_b = pkg.homepage) !== null && _b !== void 0 ? _b : pkg.docs) !== null && _c !== void 0 ? _c : pkg.repository;

@@ -47,0 +48,0 @@ const unlicensed = !pkg.license || pkg.license === 'UNLICENSED';

{
"name": "add-dist-header",
"version": "0.3.4",
"version": "0.3.5",
"description": "Prepend a one-line banner comment (with license notice) to distribution files",

@@ -68,12 +68,16 @@ "license": "MIT",

},
"runScriptsConfig": {
"build": [
"rimraf build dist spec/fixtures/target **/.DS_Store",
"jshint . --exclude-path .gitignore",
"eslint --max-warnings 0 . --ext .ts",
"tsc",
"tsc --module UMD --outDir build/umd",
"copy-file build/umd/add-dist-header.js build/add-dist-header.umd.cjs",
"copy-file build/add-dist-header.js --folder dist",
"node bin/cli.js --no-version build dist"
]
},
"scripts": {
"step:01": "rimraf build dist spec/fixtures/target **/.DS_Store",
"step:02": "jshint . --exclude-path .gitignore",
"step:03": "eslint --max-warnings 0 . --ext .ts",
"step:10": "tsc",
"step:11": "tsc --module UMD --outDir build/umd",
"step:12": "copy-file build/umd/add-dist-header.js build/add-dist-header.umd.cjs",
"step:20": "copy-file build/add-dist-header.js --folder dist",
"step:21": "node bin/cli.js --no-version build dist",
"pretest": "npm-run-all step:*",
"pretest": "run-scripts build",
"test": "mocha spec/*.spec.js && w3c-html-validator"

@@ -98,7 +102,7 @@ },

"copy-folder-util": "~0.2",
"eslint": "~8.25",
"eslint": "~8.26",
"jshint": "~2.13",
"mocha": "~10.0",
"npm-run-all2": "~6.0",
"mocha": "~10.1",
"rimraf": "~3.0",
"run-scripts-util": "~0.1",
"typescript": "~4.8",

@@ -105,0 +109,0 @@ "w3c-html-validator": "~1.2"

@@ -74,4 +74,2 @@ # Add Dist Header

### 3. CLI Flags
const validFlags = ['delimiter', 'keep', 'no-version', 'quiet'];
Command-line flags:

@@ -82,3 +80,4 @@ | Flag | Description | Values | Default |

| `--keep` | Do not delete the original first line<br>comment. | N/A | N/A |
| `--no-version` | Do not substitute occurrences of `~~~version~~~`<br>with the **package.json** version number. | N/A | N/A |
| `--no-version` | Do not substitute occurrences of `{{pkg.version}}` with<br>the **package.json** version number. | N/A | N/A |
| `--note` | Place to add a comment only for humans. | **string** | N/A |
| `--quiet` | Suppress informational messages. | N/A | N/A |

@@ -88,3 +87,3 @@

In addition to prepending the header comment, **add-dist-header** also replaces all occurrences of
`~~~version~~~` in each file with the version number found in **package.json**.
`{{pkg.version}}` in each file with the version number found in **package.json**.
This enables inserting the current package version number into your distribution files.

@@ -124,2 +123,3 @@

- 🔢 [rev-web-assets](https://github.com/center-key/rev-web-assets):&nbsp; _Revision web asset filenames with cache busting content hash fingerprints_
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):&nbsp; _Organize npm scripts into named groups of easy to manage commands_
- 🚦 [w3c-html-validator](https://github.com/center-key/w3c-html-validator):&nbsp; _Check the markup validity of HTML files using the W3C validator_

@@ -126,0 +126,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc