Skip to content

Commit

Permalink
refactor(kiwi): rollup builds and lerna workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
codebender828 committed Dec 1, 2019
1 parent 6b4b396 commit 6615655
Show file tree
Hide file tree
Showing 59 changed files with 7,625 additions and 1,940 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DS_Store
node_modules
/dist
*/dist/*
/public
/storybook-static

Expand All @@ -24,3 +24,8 @@ yarn-error.log*
*.njsproj
*.sln
*.sw?

# Workspaces
packages/*/coverage
packages/*/dist
packages/*/node_modules
15 changes: 15 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"packages": [
"packages/*"
],
"npmClient": "yarn",
"version": "independent",
"useWorkspaces": true,
"registry": "https://registry.npmjs.org/",
"command": {
"publish": {
"conventionalCommits": true,
"message": "chore(release): publish"
}
}
}
67 changes: 41 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "kiwi-ui",
"version": "0.1.0",
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
Expand All @@ -12,61 +14,74 @@
"build-storybook": "build-storybook --quiet",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"build-vsc": "cd node_modules/vue-styled-components && npm install && npm run build && cd ../../"
},
"dependencies": {
"@babel/preset-env": "^7.6.3",
"@fortawesome/free-solid-svg-icons": "^5.11.2",
"@fortawesome/pro-light-svg-icons": "^5.11.2",
"@styled-system/should-forward-prop": "^5.1.2",
"@vue/composition-api": "^0.3.2",
"breadstick": "^0.1.17",
"color": "^3.1.2",
"core-js": "^2.6.5",
"css-loader": "^3.2.0",
"esm": "^3.2.25",
"lodash-es": "^4.17.15",
"register-service-worker": "^1.6.2",
"style-loader": "^1.0.0",
"velocity-animate": "^1.5.2",
"vue": "^2.6.10",
"vue-create-context": "^1.1.0",
"vue-notification": "^1.3.20",
"vue-router": "^3.0.3",
"vue-styled-components": "git+https://github.com/codebender828/vue-styled-components.git"
"bootstrap": "lerna bootstrap --use-workspaces"
},
"devDependencies": {
"@babel/core": "^7.6.0",
"@babel/plugin-transform-modules-commonjs": "^7.6.0",
"@babel/core": "^7.7.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
"@babel/plugin-transform-modules-commonjs": "^7.7.4",
"@babel/plugin-transform-parameters": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@fortawesome/free-solid-svg-icons": "^5.11.2",
"@fortawesome/pro-light-svg-icons": "^5.11.2",
"@storybook/addon-actions": "^5.2.1",
"@storybook/addon-centered": "^5.2.1",
"@storybook/addon-links": "^5.2.1",
"@storybook/addons": "^5.2.1",
"@storybook/vue": "^5.2.1",
"@styled-system/css": "^5.0.23",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"@vue/babel-preset-app": "^4.1.1",
"@vue/babel-preset-jsx": "^1.1.2",
"@vue/cli-plugin-babel": "^3.11.0",
"@vue/cli-plugin-e2e-cypress": "^3.11.0",
"@vue/cli-plugin-eslint": "^3.11.0",
"@vue/cli-plugin-pwa": "^3.11.0",
"@vue/cli-plugin-unit-jest": "^3.11.0",
"@vue/cli-service": "^3.11.0",
"@vue/composition-api": "^0.3.2",
"@vue/eslint-config-standard": "^4.0.0",
"@vue/test-utils": "1.0.0-beta.29",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.6",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-for-of": "^6.23.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-vue": "^2.0.2",
"babelrc-rollup": "^3.0.0",
"breadstick": "^0.1.17",
"color": "^3.1.2",
"core-js": "^3.4.5",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"eslint-plugin-vue-a11y": "^0.0.31",
"husky": "^3.0.8",
"install": "^0.13.0",
"lerna": "^3.18.5",
"lint-staged": "^9.4.2",
"node-sass": "^4.12.0",
"register-service-worker": "^1.6.2",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-jsx": "^1.0.3",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.1.2",
"rollup-plugin-vue": "^5.1.4",
"sass-loader": "^8.0.0",
"styled-system": "^5.1.2",
"velocity-animate": "^1.5.2",
"vue": "^2.6.10",
"vue-loader": "^15.7.1",
"vue-styled-components": "git+https://github.com/codebender828/vsc.git",
"vue-template-compiler": "^2.6.10",
"vuepress": "^1.2.0"
}
Expand Down
25 changes: 25 additions & 0 deletions packages/kiwi-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@kiwi-ui/core",
"version": "1.0.0",
"description": "🥝 A Scalable, Accessible, High Performance, Vue.js UI component library",
"author": "Jonathan Bakebwa <[email protected]>",
"license": "MIT",
"sideEffects": false,
"private": false,
"scripts": {
"build": "rollup --c --watch"
},
"dependencies": {
"breadstick": "^0.1.17",
"color": "^3.1.2",
"lodash-es": "^4.17.15"
},
"peerDependencies": {
"velocity-animate": "^1.5.2",
"vue": "^2.6.10",
"vue-styled-components": "^1.4.14"
},
"devDependencies": {
"core-js": "^3.4.5"
}
}
99 changes: 99 additions & 0 deletions packages/kiwi-ui/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import babel from 'rollup-plugin-babel'
import resolve from 'rollup-plugin-node-resolve'
import cjs from 'rollup-plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import buble from 'rollup-plugin-buble'
import vue from 'rollup-plugin-vue'
import pkg from './package.json'

const production = !process.env.ROLLUP_WATCH

// Plugins
const bubelConfig = buble({
objectAssign: 'Object.assign',
transforms: {
dangerousTaggedTemplateString: true,
dangerousForOf: true
}
})

const babelConfig = babel({
exclude: /node_modules/,
runtimeHelpers: true,
babelrc: false,
presets: [
[
'@babel/preset-env', {
modules: false
}
]
],
plugins: [
'babel-plugin-transform-es2015-for-of'
]
})

const vueConfig = vue({
template: {
isProduction: true
}
})

// Externals
const externals = [
...Object.keys(pkg.peerDependencies || {})
]

const commons = {
external: externals,
plugins: [
resolve(),
bubelConfig,
babelConfig,
vueConfig,
cjs({
include: /node_modules/
}),
production && terser()
]
}

/**
* Configurations
*/
export default [
{
input: 'src/index.js',
output: [
{
file: `dist/index.esm.js`,
format: 'esm'
}
],
...commons
},
{
input: 'src/index.js',
output: [
{
name: 'KiwiUI',
file: `dist/index.umd.js`,
format: 'umd',
exports: 'named'
}
],
...commons
},
{
input: 'src/index.js',
output: [
{
name: 'KiwiUI',
file: `dist/index.cjs.js`,
format: 'cjs',
exports: 'named'
}
],
...commons
}
]
Loading

0 comments on commit 6615655

Please sign in to comment.