File: prepare-dist.sh

package info (click to toggle)
node-immutable 4.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,676 kB
  • sloc: javascript: 8,303; sh: 17; makefile: 6
file content (25 lines) | stat: -rwxr-xr-x 806 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh -e

# This script prepares an npm directory with files safe to publish to npm or the
# npm git branch:
#
#     "immutable": "git://github.com/immutable-js/immutable-js.git#npm"
#

# Create empty npm directory
rm -rf npm
mkdir -p npm

# Copy over necessary files
cp -r dist npm/
cp README.md npm/
cp LICENSE npm/

# Ensure a vanilla package.json before deploying so other tools do not interpret
# The built output as requiring any further transformation.
node -e "var package = require('./package.json'); \
  package = Object.fromEntries(Object.entries(package).filter(([key]) => package.publishKeys.includes(key))); \
  require('fs').writeFileSync('./npm/package.json', JSON.stringify(package, null, 2));"

# Retain marginal support for bower on the npm branch
cp npm/package.json npm/bower.json