From 873b05d23aecb9f0142fc3ebda593fd2a7d81c17 Mon Sep 17 00:00:00 2001 From: Andrew Dillon Date: Wed, 19 Dec 2018 16:01:49 -0600 Subject: [PATCH] Update to publish under @pdf-lib scope --- .npmignore | 12 ++++++++++++ Makefile.js | 30 ++++++++++++++++++++++++++++++ package.json | 39 +++++++++++++++++++++++++-------------- 3 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..68665701 --- /dev/null +++ b/.npmignore @@ -0,0 +1,12 @@ +src/ +test/ +.gitignore +.nycrc +.travis.yml +babel.config.js +esdoc.json +index.html +Makefile.js +rollup.config.js +stats.html +yarn.lock diff --git a/Makefile.js b/Makefile.js index 26988deb..171ad458 100644 --- a/Makefile.js +++ b/Makefile.js @@ -6,6 +6,10 @@ require('shelljs/make'); config.fatal = true; config.verbose = true; +const { execFileSync } = require('child_process'); + +const packageJson = require('./package.json'); + target.all = () => { target.clean(); target.generateTrieJson(); @@ -61,3 +65,29 @@ target.clean = () => { 'src/opentype/shapers/use.json', ); }; + +/* =============================== Release ================================== */ + +target.releaseNext = () => { + const version = `${packageJson.version}@next`; + console.log('Releasing version', version); + + target.all(); + + execFileSync('yarn', ['publish', '--tag', 'next', '--access', 'public'], { stdio: 'inherit' }); +}; + +target.releaseLatest = async () => { + const currentBranch = exec('git rev-parse --abbrev-ref HEAD').stdout.trim(); + if (currentBranch !== 'master') { + console.error('Must be on `master` branch to cut an @latest release.'); + return; + } + + const version = `${packageJson.version}@latest`; + console.log('Releasing version', version); + + target.all(); + + execFileSync('yarn', ['publish', '--tag', 'latest', '--access', 'public'], { stdio: 'inherit' }); +}; diff --git a/package.json b/package.json index 8b860c14..d894aacd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "fontkit", - "version": "1.7.7", + "name": "@pdf-lib/fontkit", + "version": "0.0.0", "description": "An advanced font engine for Node and the browser", "main": "dist/fontkit.umd.js", "unpkg": "dist/fontkit.umd.min.js", @@ -12,17 +12,6 @@ "test": "mocha", "coverage": "cross-env BABEL_ENV=cover nyc mocha" }, - "author": "Devon Govett ", - "license": "MIT", - "keywords": [ - "opentype", - "font", - "typography", - "subset", - "emoji", - "glyph", - "layout" - ], "dependencies": { "@pdf-lib/brotli": "^0.0.0", "@pdf-lib/restructure": "^0.0.0", @@ -61,5 +50,27 @@ "rollup-plugin-terser": "^3.0.0", "rollup-plugin-visualizer": "^0.9.2", "shelljs": "^0.8.3" - } + }, + "repository": { + "type": "git", + "url": "git://github.com/Hopding/fontkit.git" + }, + "keywords": [ + "opentype", + "font", + "typography", + "subset", + "emoji", + "glyph", + "layout" + ], + "author": "Andrew Dillon ", + "contributors": [ + "Devon Govett (http://badassjs.com/)" + ], + "bugs": { + "url": "https://github.com/Hopding/fontkit/issues" + }, + "license": "MIT", + "homepage": "https://github.com/Hopding/fontkit" }