daily-color 1.3.1 → 2.0.1
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/README.md +4 -3
- package/bin/dailycolor.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -3
- package/package.json +6 -1
- package/.eslintrc.json +0 -3
- package/.github/workflows/code-quality.yml +0 -29
- package/.github/workflows/publish-please.yml +0 -26
- package/.github/workflows/release-please.yml +0 -21
- package/.github/workflows/update-please.yml +0 -45
- package/.npmpackagejsonlintrc.json +0 -3
- package/.prettierignore +0 -3
- package/CHANGELOG.md +0 -54
- package/dist/daily-color.js +0 -1
- package/index.html +0 -54
- package/test/index.js +0 -3
- package/webpack.config.js +0 -12
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/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getDailyColor(): string;
|
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.1",
|
|
4
4
|
"description": "Provides a unique hex code each day",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"color",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"author": "aimee rivers",
|
|
18
|
+
"files": [
|
|
19
|
+
"index.d.ts",
|
|
20
|
+
"index.js"
|
|
21
|
+
],
|
|
18
22
|
"main": "index.js",
|
|
19
23
|
"bin": {
|
|
20
24
|
"dailycolor": "./bin/dailycolor.js"
|
|
@@ -23,6 +27,7 @@
|
|
|
23
27
|
"type": "git",
|
|
24
28
|
"url": "git+https://github.com/aimeerivers/daily-color.git"
|
|
25
29
|
},
|
|
30
|
+
"type": "module",
|
|
26
31
|
"scripts": {
|
|
27
32
|
"format": "prettier --write .",
|
|
28
33
|
"format:check": "prettier --check .",
|
package/.eslintrc.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
name: Code quality
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches: [main]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
code-quality:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v4
|
|
13
|
-
|
|
14
|
-
- name: Use Node.js
|
|
15
|
-
uses: actions/setup-node@v3
|
|
16
|
-
with:
|
|
17
|
-
node-version: node
|
|
18
|
-
|
|
19
|
-
- name: Install dependencies
|
|
20
|
-
run: npm install
|
|
21
|
-
|
|
22
|
-
- name: Check package linting
|
|
23
|
-
run: npm run package:lint
|
|
24
|
-
|
|
25
|
-
- name: Check code linting
|
|
26
|
-
run: npm run lint:check
|
|
27
|
-
|
|
28
|
-
- name: Check formatting
|
|
29
|
-
run: npm run format:check
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
name: Publish please
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types: [created]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
build-and-publish:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- name: Check out code
|
|
12
|
-
uses: actions/checkout@v4
|
|
13
|
-
|
|
14
|
-
- name: Set up Node.js
|
|
15
|
-
uses: actions/setup-node@v3
|
|
16
|
-
with:
|
|
17
|
-
node-version: node
|
|
18
|
-
registry-url: https://registry.npmjs.org
|
|
19
|
-
|
|
20
|
-
- name: Install dependencies
|
|
21
|
-
run: npm install
|
|
22
|
-
|
|
23
|
-
- name: Publish to npm
|
|
24
|
-
run: npm publish
|
|
25
|
-
env:
|
|
26
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
name: Release please
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
|
|
9
|
-
permissions:
|
|
10
|
-
contents: write
|
|
11
|
-
pull-requests: write
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
release-please:
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
steps:
|
|
17
|
-
- uses: googleapis/release-please-action@v3
|
|
18
|
-
with:
|
|
19
|
-
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
|
20
|
-
release-type: node
|
|
21
|
-
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"deps","section":"Dependencies","hidden":false}]'
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
name: Update please
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
inputs:
|
|
6
|
-
target:
|
|
7
|
-
type: choice
|
|
8
|
-
description: Target versions to upgrade to
|
|
9
|
-
required: true
|
|
10
|
-
options:
|
|
11
|
-
- latest
|
|
12
|
-
- minor
|
|
13
|
-
- patch
|
|
14
|
-
schedule:
|
|
15
|
-
- cron: "0 0 10 * *"
|
|
16
|
-
|
|
17
|
-
jobs:
|
|
18
|
-
update-please:
|
|
19
|
-
runs-on: ubuntu-latest
|
|
20
|
-
|
|
21
|
-
steps:
|
|
22
|
-
- name: Checkout Repository
|
|
23
|
-
uses: actions/checkout@v4
|
|
24
|
-
|
|
25
|
-
- name: Setup Node.js Environment
|
|
26
|
-
uses: actions/setup-node@v4
|
|
27
|
-
|
|
28
|
-
- name: Install npm-check-updates
|
|
29
|
-
run: npm install -g npm-check-updates
|
|
30
|
-
|
|
31
|
-
- name: Update ${{ github.event.inputs.target || 'minor' }} dependencies
|
|
32
|
-
run: ncu -t ${{ github.event.inputs.target || 'minor' }} -u --install always
|
|
33
|
-
|
|
34
|
-
- name: Audit dependencies
|
|
35
|
-
run: npm audit fix ${{ github.event.inputs.target == 'latest' && '--force' || ''}}
|
|
36
|
-
|
|
37
|
-
- name: Create Pull Request
|
|
38
|
-
uses: peter-evans/create-pull-request@v6
|
|
39
|
-
with:
|
|
40
|
-
token: ${{ secrets.UPDATE_PLEASE_TOKEN }}
|
|
41
|
-
commit-message: "deps: update dependencies"
|
|
42
|
-
title: "deps: update dependencies"
|
|
43
|
-
body: "Update Please has found one or more dependencies to be updated! 🚀"
|
|
44
|
-
branch: update-please-${{ github.sha }}
|
|
45
|
-
labels: chore
|
package/.prettierignore
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [1.3.1](https://github.com/aimeerivers/daily-color/compare/v1.3.0...v1.3.1) (2024-11-09)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### Bug Fixes
|
|
7
|
-
|
|
8
|
-
* Make the text stand out slightly better on the demo page ([#13](https://github.com/aimeerivers/daily-color/issues/13)) ([f1a61bc](https://github.com/aimeerivers/daily-color/commit/f1a61bcadb0cab38d89a152b2886226e7c8e53cd))
|
|
9
|
-
|
|
10
|
-
## [1.3.0](https://github.com/aimeerivers/daily-color/compare/v1.2.0...v1.3.0) (2024-11-09)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Features
|
|
14
|
-
|
|
15
|
-
* Improve the demo display ([#10](https://github.com/aimeerivers/daily-color/issues/10)) ([ff95cd2](https://github.com/aimeerivers/daily-color/commit/ff95cd2b0afeca1d81f574b687e29d9015eb7c54))
|
|
16
|
-
|
|
17
|
-
## [1.2.0](https://github.com/aimeerivers/daily-color/compare/v1.1.0...v1.2.0) (2024-11-09)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Features
|
|
21
|
-
|
|
22
|
-
* Add an HTML page to show the current color of the day ([#8](https://github.com/aimeerivers/daily-color/issues/8)) ([e702363](https://github.com/aimeerivers/daily-color/commit/e702363cbb73e358742c2cb59874b9a2b55baa52))
|
|
23
|
-
|
|
24
|
-
## [1.1.0](https://github.com/aimeerivers/daily-color/compare/v1.0.1...v1.1.0) (2024-11-09)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### Features
|
|
28
|
-
|
|
29
|
-
* Provide a webpack bundle, for projects that don't use NPM ([#6](https://github.com/aimeerivers/daily-color/issues/6)) ([6d53597](https://github.com/aimeerivers/daily-color/commit/6d535973e9f8f601bf4e908911665eb9fda5ee67))
|
|
30
|
-
|
|
31
|
-
## [1.0.1](https://github.com/aimeerivers/daily-color/compare/v1.0.0...v1.0.1) (2024-11-09)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### Dependencies
|
|
35
|
-
|
|
36
|
-
* update dependencies ([#3](https://github.com/aimeerivers/daily-color/issues/3)) ([3fbbb9a](https://github.com/aimeerivers/daily-color/commit/3fbbb9a3428a046d34c7f9671d4a891dbd06972e))
|
|
37
|
-
|
|
38
|
-
## 1.0.0 (2024-11-09)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
### Features
|
|
42
|
-
|
|
43
|
-
* Add a bin script for CLI ([f81da29](https://github.com/aimeerivers/daily-color/commit/f81da29a370963f941b161992a79040b045d6b9a))
|
|
44
|
-
* Start a new project ([a9f5689](https://github.com/aimeerivers/daily-color/commit/a9f56899a72d35c4168131bc9dfb2172f0238f97))
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
### Dependencies
|
|
48
|
-
|
|
49
|
-
* Fix version ([0a1af33](https://github.com/aimeerivers/daily-color/commit/0a1af33525693ae8d5f7f5f186abb7a946ce70d8))
|
|
50
|
-
* Install eslint-config-plus-prettier ([36e2f49](https://github.com/aimeerivers/daily-color/commit/36e2f49af188015a4736541e0412cb9580063c4c))
|
|
51
|
-
* Install npm-package-json-lint ([6281541](https://github.com/aimeerivers/daily-color/commit/6281541c637d7b546dfc2a479ba76eb800ddb5ab))
|
|
52
|
-
* Uninstall npm-package-json-lint ([9a330b1](https://github.com/aimeerivers/daily-color/commit/9a330b11f131d287cb51b8ac430393c49b94c1cb))
|
|
53
|
-
* Update eslint-config-plus-prettier ([e08d8d4](https://github.com/aimeerivers/daily-color/commit/e08d8d47e47b55c04b4cb3f9411cadb924191761))
|
|
54
|
-
* Update eslint-config-plus-prettier to v1.6.0 which limits the eslint version ([fd17ce9](https://github.com/aimeerivers/daily-color/commit/fd17ce9be58db5bdb726f1f363e1bae2cf2bc99f))
|
package/dist/daily-color.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.getDailyColor=e():t.getDailyColor=e()}(self,(()=>{return t={237:t=>{t.exports=function(){const t=function(t){const e=t.getDate(),o=t.getMonth()+1,r=`${t.getFullYear()}-${o}-${e}`;let n=0;for(let t=0;t<r.length;t++)n=(n<<5)-n+r.charCodeAt(t),n|=0;return Math.abs(n)}(new Date),e=t>>8&255,o=255&t;return`#${(t>>16&255).toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}}},e={},function o(r){var n=e[r];if(void 0!==n)return n.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,o),a.exports}(237);var t,e}));
|
package/index.html
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Daily Color</title>
|
|
7
|
-
<style>
|
|
8
|
-
body,
|
|
9
|
-
html {
|
|
10
|
-
align-items: center;
|
|
11
|
-
display: flex;
|
|
12
|
-
font-family: sans-serif;
|
|
13
|
-
height: 100%;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
margin: 0;
|
|
16
|
-
}
|
|
17
|
-
#color {
|
|
18
|
-
font-size: 4em;
|
|
19
|
-
font-weight: bold;
|
|
20
|
-
text-align: center;
|
|
21
|
-
}
|
|
22
|
-
#color.light {
|
|
23
|
-
text-shadow: 0 0 0.4em rgba(0, 0, 0, 0.5);
|
|
24
|
-
}
|
|
25
|
-
#color.dark {
|
|
26
|
-
text-shadow: 0 0 0.4em rgba(255, 255, 255, 0.5);
|
|
27
|
-
}
|
|
28
|
-
</style>
|
|
29
|
-
</head>
|
|
30
|
-
|
|
31
|
-
<body>
|
|
32
|
-
<div id="color"></div>
|
|
33
|
-
<script src="https://www.aimeerivers.com/daily-color/dist/daily-color.js"></script>
|
|
34
|
-
<script>
|
|
35
|
-
const color = getDailyColor();
|
|
36
|
-
const colorDiv = document.getElementById("color");
|
|
37
|
-
document.body.style.backgroundColor = color;
|
|
38
|
-
colorDiv.innerText = color;
|
|
39
|
-
colorDiv.style.color = color;
|
|
40
|
-
|
|
41
|
-
const brightness = getBrightness(color.substring(1));
|
|
42
|
-
if (brightness < 128) {
|
|
43
|
-
colorDiv.classList.add("dark");
|
|
44
|
-
} else {
|
|
45
|
-
colorDiv.classList.add("light");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function getBrightness(color) {
|
|
49
|
-
const rgb = color.match(/\w\w/g).map((hex) => parseInt(hex, 16));
|
|
50
|
-
return 0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]; // Luminosity formula
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
</body>
|
|
54
|
-
</html>
|
package/test/index.js
DELETED
package/webpack.config.js
DELETED