Skip to content

Commit fb3b524

Browse files
committed
feat: initialize friendly-dates library with core functionality and configurations v1.0.0
- Add package.json for project metadata and scripts - Include original logo image in public/icons - Implement main date formatting logic in src/friendly-dates.ts - Create index.ts for module re-exports - Set up TypeScript configuration in tsconfig.json - Configure build process with tsup in tsup.config.ts
1 parent 3fb4a75 commit fb3b524

23 files changed

+9372
-669
lines changed

.github/workflows/ci.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Lint
30+
run: npm run lint
31+
32+
- name: Build
33+
run: npm run build
34+
35+
publish:
36+
needs: test
37+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'release:')
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v3
41+
42+
- name: Use Node.js
43+
uses: actions/setup-node@v3
44+
with:
45+
node-version: '18.x'
46+
registry-url: 'https://registry.npmjs.org'
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Build
52+
run: npm run build
53+
54+
- name: Publish to npm
55+
run: npm publish
56+
env:
57+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.gitignore

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional stylelint cache
58+
.stylelintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variable files
76+
.env
77+
.env.development.local
78+
.env.test.local
79+
.env.production.local
80+
.env.local
81+
82+
# parcel-bundler cache (https://parceljs.org/)
83+
.cache
84+
.parcel-cache
85+
86+
# Next.js build output
87+
.next
88+
out
89+
90+
# Nuxt.js build / generate output
91+
.nuxt
92+
dist
93+
94+
# Gatsby files
95+
.cache/
96+
# Comment in the public line in if your project uses Gatsby and not Next.js
97+
# https://nextjs.org/blog/next-9-1#public-directory-support
98+
# public
99+
100+
# vuepress build output
101+
.vuepress/dist
102+
103+
# vuepress v2.x temp and cache directory
104+
.temp
105+
.cache
106+
107+
# vitepress build output
108+
**/.vitepress/dist
109+
110+
# vitepress cache directory
111+
**/.vitepress/cache
112+
113+
# Docusaurus cache and generated files
114+
.docusaurus
115+
116+
# Serverless directories
117+
.serverless/
118+
119+
# FuseBox cache
120+
.fusebox/
121+
122+
# DynamoDB Local files
123+
.dynamodb/
124+
125+
# TernJS port file
126+
.tern-port
127+
128+
# Stores VSCode versions used for testing VSCode extensions
129+
.vscode-test
130+
131+
# yarn v2
132+
.yarn/cache
133+
.yarn/unplugged
134+
.yarn/build-state.yml
135+
.yarn/install-state.gz
136+
.pnp.*

.hintrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": [
3+
"development"
4+
],
5+
"hints": {
6+
"meta-viewport": "off"
7+
}
8+
}

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"shd101wyy.markdown-preview-enhanced"
4+
]
5+
}

CONTRIBUTING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Contributing to Friendly-Dates
2+
3+
Thank you for your interest in contributing to Friendly-Dates! This document provides guidelines and instructions for contributing to this project.
4+
5+
## Code of Conduct
6+
7+
By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and considerate of others.
8+
9+
## Getting Started
10+
11+
1. **Fork the repository** on GitHub
12+
2. **Clone your fork** to your local machine
13+
3. **Install dependencies**:
14+
15+
```bash
16+
npm install
17+
```
18+
19+
4. **Create a branch** for your feature or bugfix:
20+
21+
```bash
22+
git checkout -b feature/your-feature-name
23+
```
24+
25+
or
26+
27+
```bash
28+
git checkout -b fix/issue-you-are-fixing
29+
```
30+
31+
## Development Workflow
32+
33+
1. **Make your changes** to the codebase
34+
2. **Write or update tests** for your changes
35+
3. **Run tests** to ensure everything works:
36+
37+
```bash
38+
npm test
39+
```
40+
41+
4. **Run linting** to ensure code style consistency:
42+
43+
```bash
44+
npm run lint
45+
```
46+
47+
5. **Format your code**:
48+
49+
```bash
50+
npm run format
51+
```
52+
53+
6. **Build the project** to verify your changes work in the compiled version:
54+
55+
```bash
56+
npm run build
57+
```
58+
59+
## Pull Request Process
60+
61+
1. **Update the README.md** with details of changes if applicable
62+
2. **Ensure all tests pass** with your changes
63+
3. **Commit your changes** with clear, descriptive commit messages
64+
4. **Push to your fork** and submit a pull request to the `main` branch
65+
5. **Describe your changes** in the pull request, explaining the problem and solution
66+
67+
## Commit Message Guidelines
68+
69+
We follow conventional commits for clear and structured history:
70+
71+
- `feat`: A new feature
72+
- `fix`: A bug fix
73+
- `docs`: Documentation changes
74+
- `style`: Changes that do not affect the meaning of the code (formatting, etc)
75+
- `refactor`: Code change that neither fixes a bug nor adds a feature
76+
- `perf`: Code change that improves performance
77+
- `test`: Adding or updating tests
78+
- `chore`: Changes to build process or auxiliary tools
79+
80+
Example:
81+
82+
```git
83+
feat: add Spanish localization
84+
```
85+
86+
## Code Style
87+
88+
We use ESLint and Prettier to maintain code quality and consistency. Please ensure your code follows the established style:
89+
90+
- Use TypeScript strict mode
91+
- Write meaningful comments for complex logic
92+
- Use descriptive variable and function names
93+
- Keep functions small and focused on a single task
94+
- Avoid any-type when possible
95+
96+
## Adding Locales
97+
98+
When adding a new locale:
99+
100+
1. Create a new locale configuration following the `LocaleConfig` interface
101+
2. Add tests for the new locale
102+
3. Update the README.md documentation to include the new locale
103+
104+
## Testing Guidelines
105+
106+
- All new features should have corresponding tests
107+
- Focus on testing behavior, not implementation details
108+
- Include edge cases in your tests
109+
- Make sure all existing tests continue to pass
110+
111+
## Release Process
112+
113+
Maintainers will follow these steps for releases:
114+
115+
1. Update version in package.json
116+
2. Update CHANGELOG.md
117+
3. Tag the release (`git tag v1.x.x`)
118+
4. Push tags (`git push --tags`)
119+
5. Publish to npm (`npm publish`)
120+
121+
## Questions?
122+
123+
Feel free to open an issue with any questions or concerns about contributing.
124+
125+
Thank you for helping improve Friendly-Dates!

LICENSE

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
This is free and unencumbered software released into the public domain.
1+
# MIT License
22

3-
Anyone is free to copy, modify, publish, use, compile, sell, or
4-
distribute this software, either in source code form or as a compiled
5-
binary, for any purpose, commercial or non-commercial, and by any
6-
means.
3+
Copyright (c) 2025 Dynamic Innovative Studio
74

8-
In jurisdictions that recognize copyright laws, the author or authors
9-
of this software dedicate any and all copyright interest in the
10-
software to the public domain. We make this dedication for the benefit
11-
of the public at large and to the detriment of our heirs and
12-
successors. We intend this dedication to be an overt act of
13-
relinquishment in perpetuity of all present and future rights to this
14-
software under copyright law.
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:
1511

16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19-
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20-
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22-
OTHER DEALINGS IN THE SOFTWARE.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
2314

24-
For more information, please refer to <https://unlicense.org>
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.

0 commit comments

Comments
 (0)