-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up deprecated methods. Renamed methods: * defineMode() => useMode(); * getModeDefinition() => getMode(); Changes in color space definition: * input{} => fromMode{} * output{} => toMode{} * parsers[] => parse[] * serialize: don't include the awkward "color(" part Make culori tree-shakeable, fixes #143. Culori now provides three flavors: * 'culori' — full library, with all color spaces pre-registered; * 'culori/css' — with just the css-color-4-related color spaces; * 'culori/fn' - tree-shakeable collection of functions, no color spaces pre-registered.
- Loading branch information
Showing
74 changed files
with
2,749 additions
and
3,942 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": ["eslint:recommended", "plugin:import/recommended"], | ||
"parserOptions": { | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["import"], | ||
"rules": { | ||
"constructor-super": 1, | ||
"import/no-anonymous-default-export": 1, | ||
"import/no-unused-modules": 1, | ||
"no-const-assign": 1, | ||
"no-mixed-spaces-and-tabs": 0, | ||
"no-this-before-super": 1, | ||
"no-undef": 2, | ||
"no-unused-vars": [1, { "args": "none" }], | ||
"valid-typeof": 1 | ||
} | ||
} |
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,2 @@ | ||
#!/bin/sh | ||
npx pretty-quick --staged |
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 @@ | ||
*.md |
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,84 @@ | ||
import { build } from 'esbuild'; | ||
|
||
// Bundled CJS | ||
build({ | ||
entryPoints: ['./src/index.js'], | ||
logLevel: 'info', | ||
bundle: true, | ||
format: 'cjs', | ||
outfile: 'bundled/culori.cjs' | ||
}); | ||
|
||
// Bundled CJS, minified | ||
build({ | ||
entryPoints: ['./src/index.js'], | ||
logLevel: 'info', | ||
bundle: true, | ||
minify: true, | ||
format: 'cjs', | ||
outfile: 'bundled/culori.min.cjs' | ||
}); | ||
|
||
// Bundled ESM | ||
build({ | ||
entryPoints: ['./src/index.js'], | ||
logLevel: 'info', | ||
bundle: true, | ||
format: 'esm', | ||
outfile: 'bundled/culori.mjs' | ||
}); | ||
|
||
// Bundled ESM, minified | ||
build({ | ||
entryPoints: ['./src/index.js'], | ||
logLevel: 'info', | ||
bundle: true, | ||
minify: true, | ||
format: 'esm', | ||
outfile: 'bundled/culori.min.mjs' | ||
}); | ||
|
||
// Bundled IIFE | ||
build({ | ||
entryPoints: ['./src/index.js'], | ||
logLevel: 'info', | ||
bundle: true, | ||
format: 'iife', | ||
globalName: 'culori', | ||
outfile: 'bundled/culori.js' | ||
}); | ||
|
||
// Bundled IIFE, minified | ||
build({ | ||
entryPoints: ['./src/index.js'], | ||
logLevel: 'info', | ||
bundle: true, | ||
minify: true, | ||
format: 'iife', | ||
globalName: 'culori', | ||
outfile: 'bundled/culori.min.js' | ||
}); | ||
|
||
// Bundled UMD | ||
// Adapted from: https://github.com/umdjs/umd/blob/master/templates/returnExports.js | ||
build({ | ||
entryPoints: ['./src/index.js'], | ||
logLevel: 'info', | ||
bundle: true, | ||
format: 'iife', | ||
globalName: 'culori', | ||
banner: { | ||
js: `(function(root, factory) { | ||
if (typeof define === 'function' && define.amd) { | ||
define([], factory); | ||
} else if (typeof module === 'object' && module.exports) { | ||
module.exports = factory(); | ||
} else { | ||
root.culori = factory(); | ||
} | ||
} | ||
(typeof self !== 'undefined' ? self : this, function() {` | ||
}, | ||
footer: { js: `return culori; }));` }, | ||
outfile: 'bundled/culori.umd.js' | ||
}); |
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
Oops, something went wrong.