Skip to content

Commit 232809d

Browse files
committed
init(daytime): add modern date library 🎉
0 parents  commit 232809d

45 files changed

Lines changed: 7951 additions & 0 deletions

Some content is hidden

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

.github/workflows/ci.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-check:
11+
name: Build Check
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [22.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build project
31+
run: npm run build

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Deno
2+
.deno/
3+
coverage/
4+
deno.lock
5+
6+
# IDE
7+
.vscode/
8+
.idea/
9+
10+
# OS
11+
.DS_Store
12+
Thumbs.db
13+
14+
# Node
15+
dist/
16+
node_modules/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 NeaByteLab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Daytime [![Module type: CJS+ESM](https://img.shields.io/badge/module%20type-cjs%2Besm-brightgreen)](https://github.com/voxpelli/badges-cjs-esm) [![npm version](https://img.shields.io/npm/v/@neabyte/daytime.svg)](https://www.npmjs.org/package/@neabyte/daytime) [![JSR](https://jsr.io/badges/@neabyte/daytime)](https://jsr.io/@neabyte/daytime) [![Node.js CI](https://github.com/NeaByteLab/Daytime/actions/workflows/ci.yaml/badge.svg)](https://github.com/NeaByteLab/Daytime)
2+
3+
**Modern date library with chainable methods and rich formatting options.**
4+
5+
> [!NOTE]
6+
> This project under development. It is not yet ready for production use.
7+
8+
## Testing
9+
10+
Run the test suite:
11+
12+
```bash
13+
deno task test
14+
```
15+
16+
Format and lint:
17+
18+
```bash
19+
deno task check
20+
```
21+
22+
## License
23+
24+
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.

build.config.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
import { resolve } from 'node:path'
3+
4+
/**
5+
* Build configuration for the Daytime library.
6+
* @description Configures build settings, aliases, and output options.
7+
*/
8+
export default defineBuildConfig({
9+
/** The entry points for the build */
10+
entries: ['src/Main'],
11+
/** Whether to generate declaration files */
12+
declaration: true,
13+
/** Whether to clean the build output */
14+
clean: true,
15+
/** Aliases for the build */
16+
alias: {
17+
'@app': resolve(__dirname, 'src'),
18+
'@helpers': resolve(__dirname, 'src/helpers'),
19+
'@utils': resolve(__dirname, 'src/utils')
20+
},
21+
/** Rollup configuration for the build */
22+
rollup: {
23+
/** Whether to emit CommonJS modules */
24+
emitCJS: true,
25+
/** Whether to inline dependencies */
26+
inlineDependencies: true
27+
},
28+
/** Whether to generate source maps */
29+
sourcemap: false,
30+
/** Whether to fail on warnings */
31+
failOnWarn: false
32+
})

deno.json

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"name": "@neabyte/daytime",
3+
"description": "Modern date library with chainable methods and rich formatting options",
4+
"version": "0.1.0",
5+
"type": "module",
6+
"license": "MIT",
7+
"exports": "./src/Main.ts",
8+
"compilerOptions": {
9+
"allowUnreachableCode": false,
10+
"allowUnusedLabels": false,
11+
"checkJs": false,
12+
"exactOptionalPropertyTypes": true,
13+
"jsx": "react",
14+
"lib": ["deno.ns", "dom"],
15+
"noErrorTruncation": true,
16+
"noFallthroughCasesInSwitch": true,
17+
"noImplicitAny": true,
18+
"noImplicitOverride": true,
19+
"noImplicitReturns": true,
20+
"noImplicitThis": true,
21+
"noPropertyAccessFromIndexSignature": true,
22+
"noUncheckedIndexedAccess": true,
23+
"noUnusedLocals": true,
24+
"noUnusedParameters": true,
25+
"strict": true,
26+
"strictBindCallApply": true,
27+
"strictFunctionTypes": true,
28+
"strictNullChecks": true,
29+
"strictPropertyInitialization": true,
30+
"useUnknownInCatchVariables": true
31+
},
32+
"fmt": {
33+
"bracePosition": "sameLine",
34+
"indentWidth": 2,
35+
"lineWidth": 100,
36+
"proseWrap": "preserve",
37+
"semiColons": false,
38+
"singleBodyPosition": "nextLine",
39+
"singleQuote": true,
40+
"spaceAround": false,
41+
"spaceSurroundingProperties": true,
42+
"trailingCommas": "never",
43+
"useBraces": "always",
44+
"useTabs": false
45+
},
46+
"lint": {
47+
"include": ["src/"],
48+
"rules": {
49+
"tags": ["fresh", "jsr", "jsx", "react", "recommended", "workspace"],
50+
"include": [
51+
"ban-untagged-todo",
52+
"camelcase",
53+
"default-param-last",
54+
"eqeqeq",
55+
"explicit-function-return-type",
56+
"explicit-module-boundary-types",
57+
"guard-for-in",
58+
"no-await-in-loop",
59+
"no-boolean-literal-for-arguments",
60+
"no-const-assign",
61+
"no-eval",
62+
"no-implicit-declare-namespace-export",
63+
"no-inferrable-types",
64+
"no-invalid-triple-slash-reference",
65+
"no-non-null-asserted-optional-chain",
66+
"no-non-null-assertion",
67+
"no-self-compare",
68+
"no-sparse-arrays",
69+
"no-sync-fn-in-async-fn",
70+
"no-throw-literal",
71+
"no-undef",
72+
"no-useless-rename",
73+
"no-top-level-await",
74+
"single-var-declarator"
75+
],
76+
"exclude": [
77+
"no-console",
78+
"no-external-import",
79+
"prefer-ascii",
80+
"prefer-primordials"
81+
]
82+
}
83+
},
84+
"lock": true,
85+
"nodeModulesDir": "auto",
86+
"test": {
87+
"include": ["tests/**/*.ts"],
88+
"exclude": ["tests/**/*.d.ts"]
89+
},
90+
"tasks": {
91+
"check": "deno fmt src/ && deno lint src/ && deno check src/",
92+
"test": "deno fmt tests/ && deno lint tests/ && deno test --no-check"
93+
},
94+
"imports": {
95+
"@std/assert": "jsr:@std/assert@^1.0.15",
96+
"@std/expect": "jsr:@std/expect@^1.0.17",
97+
"@app/": "./src/",
98+
"@helpers/": "./src/helpers/",
99+
"@utils/": "./src/utils/",
100+
"@tests/": "./tests/"
101+
},
102+
"publish": {
103+
"exclude": [
104+
"*.bench.ts",
105+
"*.spec.ts",
106+
"*.test.ts",
107+
".github/",
108+
"build.config.ts",
109+
"coverage/",
110+
"dist/",
111+
"package-lock.json",
112+
"package.json",
113+
"tests/"
114+
]
115+
}
116+
}

0 commit comments

Comments
 (0)