@christopher-drifte/clock 1.1.1 → 1.3.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/data/date.json +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/{src → dist}/index.js +3 -8
- package/dist/index.js.map +1 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +10 -0
- package/dist/utils.js.map +1 -0
- package/package.json +15 -4
- package/.github/workflows/publish.yml +0 -44
- package/.release-please-manifest.json +0 -1
- package/CHANGELOG.md +0 -23
- package/jest.config.js +0 -4
- package/release-please-config.json +0 -9
- package/src/utils.js +0 -9
- package/test/index.test.js +0 -7
package/data/date.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "date": "2026-03-
|
|
1
|
+
{ "date": "2026-03-12T11:48:04.770+01:00" }
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,IAAI,QAAwB,CAAC"}
|
package/{src → dist}/index.js
RENAMED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { dirname, join } from "path";
|
|
2
|
-
|
|
3
2
|
import { fileURLToPath } from "url";
|
|
4
|
-
import { formatDate } from "./utils.js";
|
|
5
3
|
import { readFileSync } from "fs";
|
|
6
|
-
|
|
4
|
+
import { formatDate } from "./utils.js";
|
|
7
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
6
|
const __dirname = dirname(__filename);
|
|
9
|
-
|
|
10
|
-
const json = JSON.parse(
|
|
11
|
-
readFileSync(join(__dirname, "..", "data", "date.json"), "utf8")
|
|
12
|
-
);
|
|
13
|
-
|
|
7
|
+
const json = JSON.parse(readFileSync(join(__dirname, "..", "data", "date.json"), "utf8"));
|
|
14
8
|
export const date = formatDate(json.date);
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAMtC,MAAM,IAAI,GAAa,IAAI,CAAC,KAAK,CAC/B,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,CACjE,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,GAAG,IAAI,KAAG,MAMhD,CAAC"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Internal utility function for formatting dates
|
|
2
|
+
// Not part of the public API
|
|
3
|
+
export const formatDate = (date) => {
|
|
4
|
+
return `Today is ${new Date(date).toLocaleDateString("en-GB", {
|
|
5
|
+
day: "numeric",
|
|
6
|
+
month: "long",
|
|
7
|
+
year: "numeric",
|
|
8
|
+
})}`;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,6BAA6B;AAC7B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAmB,EAAU,EAAE;IACxD,OAAO,YAAY,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE;QAC5D,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,SAAS;KAChB,CAAC,EAAE,CAAC;AACP,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@christopher-drifte/clock",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"data"
|
|
10
|
+
],
|
|
6
11
|
"scripts": {
|
|
7
|
-
"
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"prepublishOnly": "npm run build",
|
|
14
|
+
"test": "NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" jest"
|
|
8
15
|
},
|
|
9
16
|
"keywords": [],
|
|
10
17
|
"author": "",
|
|
@@ -15,6 +22,10 @@
|
|
|
15
22
|
"url": "https://github.com/christopher-drifte/clock.git"
|
|
16
23
|
},
|
|
17
24
|
"devDependencies": {
|
|
18
|
-
"jest": "^30.
|
|
25
|
+
"@types/jest": "^30.0.0",
|
|
26
|
+
"@types/node": "^25.5.0",
|
|
27
|
+
"jest": "^30.3.0",
|
|
28
|
+
"ts-jest": "^29.4.6",
|
|
29
|
+
"typescript": "^5.9.3"
|
|
19
30
|
}
|
|
20
31
|
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
name: Release Please
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
permissions:
|
|
9
|
-
contents: write
|
|
10
|
-
pull-requests: write
|
|
11
|
-
id-token: write
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
release-please:
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
steps:
|
|
17
|
-
- uses: googleapis/release-please-action@v4
|
|
18
|
-
id: release
|
|
19
|
-
with:
|
|
20
|
-
release-type: node
|
|
21
|
-
|
|
22
|
-
# Publish to npm only when a release is created
|
|
23
|
-
- uses: actions/checkout@v4
|
|
24
|
-
if: ${{ steps.release.outputs.release_created }}
|
|
25
|
-
|
|
26
|
-
- uses: actions/setup-node@v4
|
|
27
|
-
if: ${{ steps.release.outputs.release_created }}
|
|
28
|
-
with:
|
|
29
|
-
node-version: "20"
|
|
30
|
-
registry-url: "https://registry.npmjs.org"
|
|
31
|
-
|
|
32
|
-
- name: Install dependencies
|
|
33
|
-
if: ${{ steps.release.outputs.release_created }}
|
|
34
|
-
run: npm ci
|
|
35
|
-
|
|
36
|
-
- name: Run tests
|
|
37
|
-
if: ${{ steps.release.outputs.release_created }}
|
|
38
|
-
run: npm test
|
|
39
|
-
|
|
40
|
-
- name: Publish to npm
|
|
41
|
-
if: ${{ steps.release.outputs.release_created }}
|
|
42
|
-
run: npm publish --provenance --access public
|
|
43
|
-
env:
|
|
44
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{".":"1.1.1"}
|
package/CHANGELOG.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [1.1.1](https://github.com/christopher-drifte/clock/compare/v1.1.0...v1.1.1) (2026-03-12)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### Bug Fixes
|
|
7
|
-
|
|
8
|
-
* add repository field to package.json for npm provenance ([66d927f](https://github.com/christopher-drifte/clock/commit/66d927f84d1bf0d6d520767541ae19e20d66847e))
|
|
9
|
-
|
|
10
|
-
## [1.1.0](https://github.com/christopher-drifte/clock/compare/v1.0.0...v1.1.0) (2026-03-12)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Features
|
|
14
|
-
|
|
15
|
-
* add npm version badge to README ([569f764](https://github.com/christopher-drifte/clock/commit/569f764ed07f962f89e7c32eab9733810a32521a))
|
|
16
|
-
|
|
17
|
-
## 1.0.0 (2026-03-12)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Features
|
|
21
|
-
|
|
22
|
-
* Add GitHub Actions workflow for npm publishing on release ([782eea3](https://github.com/christopher-drifte/clock/commit/782eea34623bb6c26f81f831bcd67870394dc5e9))
|
|
23
|
-
* Add tests, organize project structure, and configure Jest for ES modules ([fdaab87](https://github.com/christopher-drifte/clock/commit/fdaab87384a5b1e9ea64c94c27486b1e56218028))
|
package/jest.config.js
DELETED
package/src/utils.js
DELETED