Skip to content

Commit 9010294

Browse files
authored
v1.0.0 release (#139)
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.
1 parent b7f1f88 commit 9010294

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2749
-3942
lines changed

.eslintrc.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

.eslintrc.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": ["eslint:recommended", "plugin:import/recommended"],
8+
"parserOptions": {
9+
"ecmaVersion": 12,
10+
"sourceType": "module"
11+
},
12+
"plugins": ["import"],
13+
"rules": {
14+
"constructor-super": 1,
15+
"import/no-anonymous-default-export": 1,
16+
"import/no-unused-modules": 1,
17+
"no-const-assign": 1,
18+
"no-mixed-spaces-and-tabs": 0,
19+
"no-this-before-super": 1,
20+
"no-undef": 2,
21+
"no-unused-vars": [1, { "args": "none" }],
22+
"valid-typeof": 1
23+
}
24+
}

.git-hooks/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
npx pretty-quick --staged

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.md

build.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { build } from 'esbuild';
2+
3+
// Bundled CJS
4+
build({
5+
entryPoints: ['./src/index.js'],
6+
logLevel: 'info',
7+
bundle: true,
8+
format: 'cjs',
9+
outfile: 'bundled/culori.cjs'
10+
});
11+
12+
// Bundled CJS, minified
13+
build({
14+
entryPoints: ['./src/index.js'],
15+
logLevel: 'info',
16+
bundle: true,
17+
minify: true,
18+
format: 'cjs',
19+
outfile: 'bundled/culori.min.cjs'
20+
});
21+
22+
// Bundled ESM
23+
build({
24+
entryPoints: ['./src/index.js'],
25+
logLevel: 'info',
26+
bundle: true,
27+
format: 'esm',
28+
outfile: 'bundled/culori.mjs'
29+
});
30+
31+
// Bundled ESM, minified
32+
build({
33+
entryPoints: ['./src/index.js'],
34+
logLevel: 'info',
35+
bundle: true,
36+
minify: true,
37+
format: 'esm',
38+
outfile: 'bundled/culori.min.mjs'
39+
});
40+
41+
// Bundled IIFE
42+
build({
43+
entryPoints: ['./src/index.js'],
44+
logLevel: 'info',
45+
bundle: true,
46+
format: 'iife',
47+
globalName: 'culori',
48+
outfile: 'bundled/culori.js'
49+
});
50+
51+
// Bundled IIFE, minified
52+
build({
53+
entryPoints: ['./src/index.js'],
54+
logLevel: 'info',
55+
bundle: true,
56+
minify: true,
57+
format: 'iife',
58+
globalName: 'culori',
59+
outfile: 'bundled/culori.min.js'
60+
});
61+
62+
// Bundled UMD
63+
// Adapted from: https://github.com/umdjs/umd/blob/master/templates/returnExports.js
64+
build({
65+
entryPoints: ['./src/index.js'],
66+
logLevel: 'info',
67+
bundle: true,
68+
format: 'iife',
69+
globalName: 'culori',
70+
banner: {
71+
js: `(function(root, factory) {
72+
if (typeof define === 'function' && define.amd) {
73+
define([], factory);
74+
} else if (typeof module === 'object' && module.exports) {
75+
module.exports = factory();
76+
} else {
77+
root.culori = factory();
78+
}
79+
}
80+
(typeof self !== 'undefined' ? self : this, function() {`
81+
},
82+
footer: { js: `return culori; }));` },
83+
outfile: 'bundled/culori.umd.js'
84+
});

docs/_includes/layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h1>{{ title }}</h1>
2121
</div>
2222
{% include 'partials/footer.html' %}
2323

24-
<script src="https://unpkg.com/culori"></script>
24+
<script src="https://unpkg.com/culori@{{ pkg.version }}"></script>
2525
<script type="text/javascript">
2626
document.body.style.setProperty(
2727
'--random-1',

docs/_includes/partials/footer.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<footer>
22
<div class="container">
33
<p>
4-
A <a href="https://labs.moqups.com">Moqups Labs</a> thing. Source
5-
code available on
6-
<a href="https://github.com/evercoder/culori">GitHub</a>.
7-
</p>
8-
9-
<p>
10-
Can this page be improved?
4+
A <a href="https://labs.moqups.com">Moqups Labs</a> thing. Can this
5+
page be improved?
116
<a
127
href="https://github.com/Evercoder/culori/blob/main/{{ page.inputPath }}"
138
>Edit it on GitHub</a

docs/_includes/partials/header.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
</div>
1414
<nav>
1515
<ul>
16-
{%- for post in (collections.all | sortby('menu-order')) -%}
16+
{%- for post in (collections.all | sortby('menu-order')) -%} {%
17+
if post.data['menu-order'] %}
1718
<li class="{% if page.url == post.url %}active {% endif %}">
1819
<a href="{{ post.url }}">{{ post.data.title }}</a>
1920
</li>
20-
{%- endfor -%}
21+
{% endif %} {%- endfor -%}
22+
<li>
23+
<a href="https://github.com/Evercoder/culori"
24+
>GitHub <span aria-hidden="true"></span></a
25+
>
26+
</li>
2127
</ul>
2228
</nav>
2329
</div>

0 commit comments

Comments
 (0)