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

clean-release

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-release

A CLI tool to copy files to be released into a tmp clean directory for npm publishing, electronjs packaging, docker image creation, or deployment

  • 2.9.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-93.75%
Maintainers
1
Weekly downloads
 
Created
Source

clean-release

Dependency Status devDependency Status Build Status: Linux Build Status: Windows npm version Downloads type-coverage

A CLI tool to copy files to be released into a tmp clean directory for npm publishing, electronjs packaging, docker image creation or deployment

install

yarn global add clean-release

usage

run clean-release or clean-release --config clean-release.config.js or clean-release --config clean-release.config.ts

config

keytypedescription
includestring[]the files included, support glob
excludestring[]?the files excluded, support glob
basestring?the base path, eg: dist, then dist/foo/bar.js will be copied into foo as foo/bar.js
postScriptpostScriptused to publish to npm, eg: npm publish "[dir]" --access public
releaseRepositorystring?used to publish to a git release repository, eg: https://github.com/plantain-00/baogame-release.git
releaseBranchNamestring?the branch name of the release repository
notCleanboolean?if true, do not clean the tmp directory
askVersionboolean?if true, will ask promp version
changesGitStagedboolean?if true, will make sure all changes is git staged
execOptionschildProcess.ExecOptions?passed to childProcess.exec

post script

postScript?: Script | Script[];

type Script = string | ((context: Context) => string) | ((context: Context) => Promise<string>)

type Context = {
  dir: string
  version: string
  tag: string | undefined
}

npm package demo

const { name, devDependencies: { electron: electronVersion } } = require('./package.json')

module.exports = {
  include: [
    'bin/*',
    'dist/**/*',
    'LICENSE',
    'package.json',
    'README.md'
  ],
  exclude: [
  ],
  askVersion: true,
  changesGitStaged: true,
  postScript: [
    'git add package.json',
    'git commit -m "[version]"',
    'git tag v[version]',
    'git push',
    'git push origin v[version]',
    'cd "[dir]" && npm i --production',
    'prune-node-modules "[dir]/node_modules"',
    `electron-packager "[dir]" "${name}" --out=dist --arch=x64 --electron-version=${electronVersion} --platform=darwin --ignore="dist/"`,
    `electron-packager "[dir]" "${name}" --out=dist --arch=x64 --electron-version=${electronVersion} --platform=win32 --ignore="dist/"`,
    `7z a -r -tzip dist/${name}-darwin-x64-[version].zip dist/${name}-darwin-x64/`,
    `7z a -r -tzip dist/${name}-win32-x64-$[version].zip dist/${name}-win32-x64/`,
    `electron-installer-windows --src dist/${name}-win32-x64/ --dest dist/`,
    `cd dist && create-dmg ${name}-darwin-x64/${name}.app`
  ]
}

electronjs packaging demo

module.exports = {
  include: [
    'libs.js',
    'main.js',
    'config.js',
    'index.css',
    'scripts/index.js',
    'index.html',
    'LICENSE',
    'package.json',
    'README.md'
  ],
  exclude: [
  ],
  postScript: [
    'cd "[dir]" && npm i --production',
    'electron-packager "[dir]" "news" --out=dist --arch=x64 --version=1.2.1 --app-version="1.0.8" --platform=darwin --ignore="dist/"',
    'electron-packager "[dir]" "news" --out=dist --arch=x64 --version=1.2.1 --app-version="1.0.8" --platform=win32 --ignore="dist/"'
  ]
}

docker demo

module.exports = {
  include: [
    'dist/*.js',
    'static/protocol.proto',
    'static/scripts/*.bundle-*.js',
    'static/index.html',
    'LICENSE',
    'package.json',
    'README.md',
    'Dockerfile'
  ],
  exclude: [
  ],
  postScript: [
    'cd "[dir]" && docker build -t plantain/baogame . && docker push plantain/baogame'
  ]
}

change logs

# v2
cd "[dir]"

# v1
cd [dir]

FAQs

Package last updated on 10 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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