daily-color 1.3.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +4 -3
- package/bin/dailycolor.js +1 -1
- package/dist/daily-color.js +1 -1
- package/index.html +3 -2
- package/index.js +1 -3
- package/package.json +2 -1
- package/webpack.config.js +12 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.0](https://github.com/aimeerivers/daily-color/compare/v1.3.1...v2.0.0) (2024-11-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* Importing with `require` will no longer work. Instead use `import { getDailyColor } from "daily-color";`
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* Convert to ES module ([#15](https://github.com/aimeerivers/daily-color/issues/15)) ([0444973](https://github.com/aimeerivers/daily-color/commit/04449739647216ddda101b5fdd4b3c7be2e0a662))
|
|
13
|
+
|
|
3
14
|
## [1.3.1](https://github.com/aimeerivers/daily-color/compare/v1.3.0...v1.3.1) (2024-11-09)
|
|
4
15
|
|
|
5
16
|
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npm install daily-color
|
|
|
15
15
|
In a JavaScript/TypeScript project, using NPM:
|
|
16
16
|
|
|
17
17
|
```javascript
|
|
18
|
-
|
|
18
|
+
import { getDailyColor } from "daily-color";
|
|
19
19
|
|
|
20
20
|
console.log("Today's color is:", getDailyColor());
|
|
21
21
|
```
|
|
@@ -23,8 +23,9 @@ console.log("Today's color is:", getDailyColor());
|
|
|
23
23
|
Directly loading the bundled JavaScript, for static projects not using NPM:
|
|
24
24
|
|
|
25
25
|
```html
|
|
26
|
-
<script
|
|
27
|
-
|
|
26
|
+
<script type="module">
|
|
27
|
+
import { getDailyColor } from "https://www.aimeerivers.com/daily-color/dist/daily-color.js";
|
|
28
|
+
|
|
28
29
|
console.log("Today's color is:", getDailyColor());
|
|
29
30
|
</script>
|
|
30
31
|
```
|
package/bin/dailycolor.js
CHANGED
package/dist/daily-color.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var t={d:(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(){const t=function(t){const e=t.getDate(),r=t.getMonth()+1,o=`${t.getFullYear()}-${r}-${e}`;let a=0;for(let t=0;t<o.length;t++)a=(a<<5)-a+o.charCodeAt(t),a|=0;return Math.abs(a)}(new Date),e=t>>8&255,r=255&t;return`#${(t>>16&255).toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}t.d(e,{x:()=>r});var o=e.x;export{o as getDailyColor};
|
package/index.html
CHANGED
|
@@ -30,8 +30,9 @@
|
|
|
30
30
|
|
|
31
31
|
<body>
|
|
32
32
|
<div id="color"></div>
|
|
33
|
-
<script
|
|
34
|
-
|
|
33
|
+
<script type="module">
|
|
34
|
+
import { getDailyColor } from "https://www.aimeerivers.com/daily-color/dist/daily-color.js";
|
|
35
|
+
|
|
35
36
|
const color = getDailyColor();
|
|
36
37
|
const colorDiv = document.getElementById("color");
|
|
37
38
|
document.body.style.backgroundColor = color;
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "daily-color",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Provides a unique hex code each day",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"color",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"type": "git",
|
|
24
24
|
"url": "git+https://github.com/aimeerivers/daily-color.git"
|
|
25
25
|
},
|
|
26
|
+
"type": "module",
|
|
26
27
|
"scripts": {
|
|
27
28
|
"format": "prettier --write .",
|
|
28
29
|
"format:check": "prettier --check .",
|
package/webpack.config.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
|
|
7
|
+
export default {
|
|
4
8
|
entry: "./index.js",
|
|
5
9
|
output: {
|
|
6
10
|
path: path.resolve(__dirname, "dist"),
|
|
7
11
|
filename: "daily-color.js",
|
|
8
|
-
library:
|
|
9
|
-
|
|
12
|
+
library: {
|
|
13
|
+
type: "module",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
experiments: {
|
|
17
|
+
outputModule: true,
|
|
10
18
|
},
|
|
11
19
|
mode: "production",
|
|
12
20
|
};
|