Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Commit

Permalink
add npm deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
ueewbd committed Apr 24, 2019
1 parent 02e691d commit cd8a38e
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .gitignore
Expand Up @@ -35,7 +35,13 @@ dist
# test
test/package-lock.json

# vscode
# tools, IDE
.nvmrc
.vscode
yarn-error.log

.demo
# demo
.demo

.npmignore
*.tgz
2 changes: 0 additions & 2 deletions babel.config.js
Expand Up @@ -4,8 +4,6 @@ const explorerUrl = (process.env.explorerUrl || 'https://static-cdn.kloudless.co
module.exports = {
presets: [
'@babel/env',
// '@babel/preset-react',
// '@vue/app',
],
plugins: [
'babel-plugin-stylus-compiler',
Expand Down
15 changes: 15 additions & 0 deletions generate_npmignore.sh
@@ -0,0 +1,15 @@
# create .npmignore base on .gitignore
cp .gitignore .npmignore
# whitelist .gitignore and dist folder in .npmignore
# so that npm will pick these two when packing
echo 'storybook-common/' >> .npmignore
echo 'storybook-react/' >> .npmignore
echo 'storybook-vue/' >> .npmignore
echo '.eslintrc.js' >> .npmignore
echo '.eslintignore' >> .npmignore
echo '.bowerrc' >> .npmignore
echo 'bower.json' >> .npmignore
echo 'webpack.loader.config.js' >> .npmignore
echo 'Gruntfile.js' >> .npmignore
echo '!.gitignore' >> .npmignore
echo '!dist' >> .npmignore
72 changes: 72 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.1",
"author": "Kloudless <hello@kloudless.com> (https://kloudless.com)",
"description": "The Kloudless File Explorer is a JavaScript library that allows your users to browse and select files and folders from their storage services. It comes in two modes: a chooser and a saver.",
"main": "./dist/loader/js/interface.js",
"keywords": [
"kloudless",
"file picker",
Expand All @@ -24,10 +25,12 @@
"dev": "npm run build:explorer && explorerUrl=http://localhost:3000/file-explorer npm run build:loader",
"build:explorer": "grunt dev -f",
"build:loader": "webpack --config webpack.loader.config.js",
"transpile": "babel src/loader/js -d dist/loader/js",
"transpile": "babel src/loader/js -d dist/loader/js --ignore src/loader/js/webpack",
"storybook:vue": "npm run storybook --prefix storybook-vue/",
"build:storybook": "npm run build --prefix ./storybook-vue",
"deploy:storybook": "npm run build:storybook && storybook-to-ghpages --remote=github --existing-output-dir=.demo"
"deploy:storybook": "npm run build:storybook && storybook-to-ghpages --remote=github --existing-output-dir=.demo",
"prepack": "bash generate_npmignore.sh && npm install && npm run transpile && npm run build:loader",
"postpack": "rm -f .npmignore"
},
"dependencies": {},
"devDependencies": {
Expand All @@ -51,6 +54,7 @@
"@babel/cli": "7.2.3",
"@babel/core": "7.4.0",
"@babel/preset-env": "7.4.1",
"@babel/preset-react": "7.0.0",
"@storybook/storybook-deployer": "2.8.1",
"babel-loader": "^8.0.5",
"babel-plugin-stylus-compiler": "1.4.0",
Expand Down

0 comments on commit cd8a38e

Please sign in to comment.