prepare umd build before publish
This commit is contained in:
committed by
Yoshua Wuyts
parent
d883d316bb
commit
c03bcd21e5
+5
-4
@@ -1,10 +1,11 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
coverage/
|
coverage/
|
||||||
coverage.json
|
dist/
|
||||||
tmp/
|
tmp/
|
||||||
npm-debug.log*
|
|
||||||
.DS_Store
|
|
||||||
.sauce-credentials.json
|
.sauce-credentials.json
|
||||||
*.swp
|
|
||||||
sauce_connect.log
|
sauce_connect.log
|
||||||
|
npm-debug.log*
|
||||||
|
coverage.json
|
||||||
|
.DS_Store
|
||||||
|
*.swp
|
||||||
.zuulrc
|
.zuulrc
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Vanilla example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="../../dist/choo.min.js"></script>
|
||||||
|
<script>
|
||||||
|
const app = choo()
|
||||||
|
|
||||||
|
app.model({
|
||||||
|
namespace: 'counter',
|
||||||
|
state: {
|
||||||
|
count: 0
|
||||||
|
},
|
||||||
|
reducers: {
|
||||||
|
increment: (action, state) => ({count: state.count + 1}),
|
||||||
|
decrement: (action, state) => ({count: state.count - 1})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const mainView = (params, state, send) => {
|
||||||
|
return choo.view`
|
||||||
|
<main class="app">
|
||||||
|
<h1>Counter example</h1>
|
||||||
|
<div>
|
||||||
|
Count: ${state.counter.count}
|
||||||
|
<button onclick=${(e) => send('counter:increment')}>+</button>
|
||||||
|
<button onclick=${(e) => send('counter:decrement')}>-</button>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
|
||||||
|
app.router((route) => [
|
||||||
|
route('/', mainView)
|
||||||
|
])
|
||||||
|
|
||||||
|
const tree = app.start()
|
||||||
|
document.body.appendChild(tree)
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+16
-1
@@ -11,7 +11,10 @@
|
|||||||
"test:browser": "standard && npm run deps && NODE_ENV=test zuul tests/browser/*",
|
"test:browser": "standard && npm run deps && NODE_ENV=test zuul tests/browser/*",
|
||||||
"test:browser:local": "standard && npm run deps && NODE_ENV=test zuul --local 8080 -- tests/browser/*",
|
"test:browser:local": "standard && npm run deps && NODE_ENV=test zuul --local 8080 -- tests/browser/*",
|
||||||
"preversion": "if [ ! -z $SKIP_TEST ]; then npm run test:browser; fi",
|
"preversion": "if [ ! -z $SKIP_TEST ]; then npm run test:browser; fi",
|
||||||
"test": "npm run test:electron"
|
"test": "npm run test:electron",
|
||||||
|
"build:dev": "NODE_ENV=development browserify index.js --standalone=choo -t envify > dist/choo.js",
|
||||||
|
"build:min": "NODE_ENV=production browserify index.js --standalone=choo -t envify -g unassertify -g uglifyify | uglifyjs > dist/choo.min.js",
|
||||||
|
"prepublish": "mkdir -p 'dist/' && npm run build:dev && npm run build:min"
|
||||||
},
|
},
|
||||||
"repository": "yoshuawuyts/choo",
|
"repository": "yoshuawuyts/choo",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -22,6 +25,11 @@
|
|||||||
"composable",
|
"composable",
|
||||||
"tiny"
|
"tiny"
|
||||||
],
|
],
|
||||||
|
"files": [
|
||||||
|
"index.js",
|
||||||
|
"http.js",
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"barracks": "^8.0.0",
|
"barracks": "^8.0.0",
|
||||||
@@ -40,6 +48,7 @@
|
|||||||
"browserify-istanbul": "^2.0.0",
|
"browserify-istanbul": "^2.0.0",
|
||||||
"bundle-collapser": "^1.2.1",
|
"bundle-collapser": "^1.2.1",
|
||||||
"dependency-check": "^2.5.1",
|
"dependency-check": "^2.5.1",
|
||||||
|
"envify": "^3.4.1",
|
||||||
"es2020": "^1.0.1",
|
"es2020": "^1.0.1",
|
||||||
"geval": "~2.1.1",
|
"geval": "~2.1.1",
|
||||||
"insert-css": "^0.2.0",
|
"insert-css": "^0.2.0",
|
||||||
@@ -54,9 +63,15 @@
|
|||||||
"standard": "^7.1.0",
|
"standard": "^7.1.0",
|
||||||
"tachyons": "^4.0.0-beta.19",
|
"tachyons": "^4.0.0-beta.19",
|
||||||
"tape": "^4.5.1",
|
"tape": "^4.5.1",
|
||||||
|
<<<<<<< HEAD
|
||||||
"tape-istanbul": "~1.0.2",
|
"tape-istanbul": "~1.0.2",
|
||||||
"tape-run": "~2.1.4",
|
"tape-run": "~2.1.4",
|
||||||
"yo-yoify": "^3.1.0",
|
"yo-yoify": "^3.1.0",
|
||||||
|
=======
|
||||||
|
"uglifyify": "^3.0.2",
|
||||||
|
"uglifyjs": "^2.4.10",
|
||||||
|
"unassertify": "^2.0.3",
|
||||||
|
>>>>>>> 7370fd0... prepare umd build before publish
|
||||||
"zuul": "toddself/zuul"
|
"zuul": "toddself/zuul"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user