npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

clean-release

v2.18.0

Published

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

Downloads

575

Readme

clean-release

Dependency Status devDependency Status Build Status: Windows Github CI 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

options

key | description --- | --- -config | config file -h,--help | Print this message. -v,--version | Print the version --only-changed-packages | Only changed packages will bump. --effected-packages | The packages will be considered as effected packages.

config

key | type | description --- | --- | --- include | string[] | the files included, support glob exclude | string[]? | the files excluded, support glob base | string? | the base path, eg: dist, then dist/foo/bar.js will be copied into foo as foo/bar.js postScript | postScript | post script releaseRepository | string? | used to publish to a git release repository, eg: https://github.com/plantain-00/baogame-release.git releaseBranchName | string? | the branch name of the release repository notClean | boolean? | if true, do not clean the tmp directory askVersion | boolean? | if true, will ask promp version changesGitStaged | boolean? | if true, will make sure all changes is git staged execOptions | childProcess.ExecOptions? | passed to childProcess.exec onlyChangedPackages | boolean? | if true, for monorepo, only bump changed packages

post script

postScript?: Script | Script[];

import type * as cleanScripts from 'clean-scripts'

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

type Context = {
  dir: string
  version: string
  tag: string | undefined
  effectedWorkspacePaths?: string[][]
}

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: ({ dir, version }) => [
    '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`
  ]
}

yarn workspaces demo

export default {
  include: [
    'packages/*/dist/*',
    'packages/*/package.json',
    'packages/*/README.md',
    'LICENSE',
    'package.json',
    'README.md'
  ],
  exclude: [
  ],
  askVersion: true,
  changesGitStaged: true,
  postScript: ({ dir, tag, version, effectedWorkspacePaths }) => [
    ...effectedWorkspacePaths.map((w) => w.map((e) => {
      return tag
        ? `npm publish "${dir}/${e}" --access public --tag ${tag}`
        : `npm publish "${dir}/${e}" --access public`
    })),
    `git commit -m "${version}"`,
    `git tag -a v${version} -m 'v${version}'`,
    'git push',
    `git push origin v${version}`
  ]
}

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: ({ dir }) => [
    `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: ({ dir }) => [
    `cd "${dir}" && docker build -t plantain/baogame . && docker push plantain/baogame`
  ]
}

change logs

# v2
cd "${dir}"

# v1
cd ${dir}