-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[package] Get ready for real public npm packages!
- Loading branch information
Daniel Spitzer
committed
Oct 2, 2018
1 parent
984f7ae
commit 7cc8782
Showing
5 changed files
with
92 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
{ | ||
"name": "tradeshift-ui", | ||
"name": "@tradeshift/tradeshift-ui", | ||
"version": "11.0.0-alpha.1", | ||
"private": true, | ||
"description": "The Tradeshift UI Library & Framework", | ||
"homepage": "https://ui.tradeshift.com/", | ||
"bugs": { | ||
"url": "https://github.com/Tradeshift/tradeshift-ui/issues", | ||
"email": "[email protected]" | ||
"url": "https://github.com/Tradeshift/tradeshift-ui/issues" | ||
}, | ||
"author": "Tradeshift UI Team", | ||
"contributors": [ | ||
"Wired Earp <jmo@tradeshift.com> (https://github.com/wiredearp)", | ||
"Daniel Spitzer <dsp@tradeshift.com> (https://github.com/sampi)", | ||
"Leo Zhang <[email protected]> (https://github.com/zdlm)", | ||
"Daniel Spitzer <[email protected]> (https://github.com/sampi)" | ||
"Tynan DeBold <[email protected]> (https://github.com/tynandebold)", | ||
"Wired Earp (https://github.com/wiredearp)" | ||
], | ||
"license": "SEE LICENSE IN LICENSE.md", | ||
"engines": { | ||
|
@@ -38,27 +37,15 @@ | |
"****** NODE *****": "", | ||
"postinstall": "cd docs && npm ci", | ||
"precommit": "lint-staged", | ||
"gh-pages": "grunt dist && node tasks/gh-pages.js" | ||
"gh-pages": "grunt dist && node tasks/gh-pages.js", | ||
"package-dist": "node tasks/package-dist.js" | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"prettier --write", | ||
"eslint --config ./.eslintrc.json", | ||
"git add" | ||
], | ||
"*.json": [ | ||
"prettier --write", | ||
"git add" | ||
], | ||
"*.less": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
"*.js": ["prettier --write", "eslint --config ./.eslintrc.json", "git add"], | ||
"*.json": ["prettier --write", "git add"], | ||
"*.less": ["prettier --write", "git add"] | ||
}, | ||
"browserslist": [ | ||
"Last 2 versions", | ||
"ie 11" | ||
], | ||
"browserslist": ["Last 2 versions", "ie 11"], | ||
"devDependencies": { | ||
"alce": "^1.2.0", | ||
"ali-oss": "^4.10.1", | ||
|
@@ -125,5 +112,8 @@ | |
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Tradeshift/tradeshift-ui.git" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* Generate the minimum viable package.json for an npm package | ||
*/ | ||
|
||
const prettier = require('prettier'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const packageJson = require('../package.json'); | ||
|
||
delete packageJson.scripts; | ||
delete packageJson.devDependencies; | ||
delete packageJson.browserslist; | ||
delete packageJson['lint-staged']; | ||
packageJson.main = 'ts.js'; | ||
|
||
try { | ||
write('../dist/npm/package.json', packageJson); | ||
} catch (e) { | ||
process.exit(1); | ||
} | ||
process.exit(0); | ||
|
||
function write(file, json) { | ||
fs.writeFileSync( | ||
path.join(path.dirname(fs.realpathSync(__filename)), file), | ||
pretty(json), | ||
'utf-8' | ||
); | ||
} | ||
|
||
function pretty(json) { | ||
return prettier.format(`${JSON.stringify(json, null, '\t')}\n`, { | ||
parser: 'json', | ||
useTabs: true, | ||
printWidth: 100 | ||
}); | ||
} |