initial commit
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Luke Edwards · committed by Luke Edwards · the first commit · Browse files · 7 files·+96 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+96 added−0 removed
- other:+96 added−0 removed
Provenance
- Commit
db7477a- Tree
a79c304- Author
Luke Edwards <luke.edwards05@gmail.com>- Committer
Luke Edwards <luke.edwards05@gmail.com>
7 files changed+96 added−0 removed
added:src/index.js+3 added
123export default function () { //}added:.editorconfig+13 added
1+# http://editorconfig.org2+root = true3+4+[*]5+indent_size = 26+indent_style = tab7+end_of_line = lf8+charset = utf-89+trim_trailing_whitespace = true10+insert_final_newline = true11+12+[*.{json,yml,md}]13+indent_style = spaceadded:.gitignore+5 added
1+node_modules2+.DS_Store3+*.lock4+*.log5+distadded:.travis.yml+3 added
123language: node_jsnode_js: - 6added:builder.js+27 added
123456789101112131415161718192021222324252627const fs = require('fs');const mkdir = require('mk-dirs');const pretty = require('pretty-bytes');const { minify } = require('terser');const sizer = require('gzip-size');const pkg = require('./package');
let data = fs.readFileSync('src/index.js', 'utf8');
mkdir('dist').then(() => { // Copy as is for ESM fs.writeFileSync(pkg.module, data);
// Mutate exports for CJS data = data.replace(/export default/, 'module.exports ='); fs.writeFileSync(pkg.main, data);
// Minify & print gzip-size let { code } = minify(data, { toplevel:true }); console.log(`> gzip size: ${pretty(sizer.sync(code))}`);
// Write UMD bundle let name = pkg['umd:name'] || pkg.name; let UMD = `!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.${name}=t()}(this,function(){`; UMD += code.replace(/module.exports=/, 'return ') + '});'; fs.writeFileSync(pkg.unpkg, UMD);});added:license+9 added
1+MIT License2+3+Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)4+5+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:6+7+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.8+9+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.added:package.json+36 added
123456789101112131415161718192021222324252627282930313233343536{ "name": "clsx", "version": "0.0.0", "repository": "lukeed/clsx", "description": "WIP", "unpkg": "dist/clsx.min.js", "module": "dist/clsx.mjs", "main": "dist/clsx.js", "license": "MIT", "author": { "name": "Luke Edwards", "email": "luke.edwards05@gmail.com", "url": "lukeed.com" }, "engines": { "node": ">=6" }, "scripts": { "build": "node builder", "pretest": "npm run build", "test": "tape test/*.js | tap-spec" }, "files": [ "dist" ], "keywords": [ ], "devDependencies": { "gzip-size": "^3.0.0", "mk-dirs": "^1.0.0", "pretty-bytes": "^4.0.2", "tap-spec": "^5.0.0", "tape": "^4.9.1", "terser": "^3.10.0" }}