Skip to content

Typescript rewrite #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 170 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
000f595
WIP - Phase 1 of converting to TypeScript is mostly complete
MichaelLeeHobbs Apr 23, 2023
4d1e56b
WIP - Phase 1 of converting to TypeScript is mostly complete
MichaelLeeHobbs Apr 23, 2023
5a69ad9
WIP - refactored compactField into CronFields. Clean up on other files
MichaelLeeHobbs Apr 23, 2023
078fe83
WIP: cleanup types
MichaelLeeHobbs Apr 23, 2023
36271a6
WIP: cleanup types
MichaelLeeHobbs Apr 23, 2023
036fca9
WIP: refactored findSchedule in to multiple smaller functions
MichaelLeeHobbs Apr 23, 2023
b9e6bac
WIP: refactored findSchedule in to multiple smaller functions
MichaelLeeHobbs Apr 23, 2023
a332968
WIP: refactored shiftTimezone on to CronDate
MichaelLeeHobbs Apr 24, 2023
6d8a85f
WIP: refactored file names. Testing install from github
MichaelLeeHobbs Apr 24, 2023
281efe9
added prepare script
MichaelLeeHobbs Apr 24, 2023
81a8800
updated library packaging
MichaelLeeHobbs Apr 24, 2023
14a40ef
updated the default export to match the current library
MichaelLeeHobbs Apr 24, 2023
d0cb09f
updated exports for compatible with CommonJS-style require
MichaelLeeHobbs Apr 24, 2023
391e9e7
attempt 2 at cjs combability
MichaelLeeHobbs Apr 24, 2023
805a27b
attempt 3 at cjs compatability
MichaelLeeHobbs Apr 24, 2023
0cc6b80
some clean up
MichaelLeeHobbs Apr 24, 2023
2795eed
wip - cleaner support for CJS and ESM
MichaelLeeHobbs Apr 24, 2023
730921a
wip - looks like we still need the index.cjs.js to support cjs even w…
MichaelLeeHobbs Apr 24, 2023
1feeabc
wip - added notes, and general cleanup
MichaelLeeHobbs Apr 24, 2023
2231615
wip - added note
MichaelLeeHobbs Apr 24, 2023
d16bc5d
wip - init jest setup/work
MichaelLeeHobbs Apr 24, 2023
6eea54b
WIP - testing precommit lint
MichaelLeeHobbs Apr 24, 2023
b6794a1
WIP - testing precommit lint
MichaelLeeHobbs Apr 24, 2023
1a90deb
wip - testing pre-commit hook
MichaelLeeHobbs Apr 24, 2023
2710da0
wip - formatted code
MichaelLeeHobbs Apr 24, 2023
7743b58
wip - refactoring test...
MichaelLeeHobbs Apr 25, 2023
184744a
wip - refactoring test...
MichaelLeeHobbs Apr 25, 2023
060bab9
wip - refactored CronParser stringify test
MichaelLeeHobbs Apr 25, 2023
d338492
wip - Test conversion complete. Overall coverage is at 91%. Lost lots…
MichaelLeeHobbs Apr 26, 2023
7ef341a
wip - types cleanup
MichaelLeeHobbs Apr 27, 2023
94a0add
wip - cleanup
MichaelLeeHobbs Apr 27, 2023
722df4b
wip - simplified code
MichaelLeeHobbs Apr 27, 2023
c12e6e4
wip - simplified code
MichaelLeeHobbs Apr 27, 2023
3184fdc
wip - fixes #153 and #299. Adds test for #156
MichaelLeeHobbs Apr 28, 2023
b073cfe
wip - Adds fix for #156 in the form of toString vs stringify as it'd …
MichaelLeeHobbs Apr 28, 2023
fa910fa
wip - Adds fix for #244 in the form of strict mode which defaults to …
MichaelLeeHobbs Apr 28, 2023
7fc1773
wip - working on a fix for 284
MichaelLeeHobbs Apr 29, 2023
61ee67a
wip - working on a fix for 284
MichaelLeeHobbs Apr 29, 2023
672df08
wip - fixed 284, major cleanup
MichaelLeeHobbs Apr 29, 2023
eca418a
wip - 99.5% code coverage and mostly documented
MichaelLeeHobbs Apr 30, 2023
75eba12
wip - code analysis clean up
MichaelLeeHobbs Apr 30, 2023
24d0d1d
wip - add documentation
MichaelLeeHobbs Apr 30, 2023
2eb4fc2
wip - updated notes
MichaelLeeHobbs Apr 30, 2023
a7ecb58
wip - basically done
MichaelLeeHobbs Apr 30, 2023
e717cef
Done for now
MichaelLeeHobbs Apr 30, 2023
5ad2f4f
fixed typos
MichaelLeeHobbs Apr 30, 2023
095916e
removed tsx
MichaelLeeHobbs May 4, 2023
3ca6ef3
removed npx from scripts calling jest
MichaelLeeHobbs May 4, 2023
9c5762f
removed old_typesVersions
MichaelLeeHobbs May 4, 2023
204ffbd
update requires node version
MichaelLeeHobbs May 4, 2023
fd78774
Remove .run folder from repository
MichaelLeeHobbs May 4, 2023
04d3071
Remove GPT4 PROMPTS from repository
MichaelLeeHobbs May 4, 2023
b780f77
cleaned up .gitignore
MichaelLeeHobbs May 4, 2023
71db6bb
cleaned up .npmignore
MichaelLeeHobbs May 4, 2023
330ec94
cleaned up .eslintrc.cjs
MichaelLeeHobbs May 4, 2023
3a06e5b
Update src/CronDate.ts
MichaelLeeHobbs May 4, 2023
9b6f51f
renamed applyDateOperation and made hoursLength optional
MichaelLeeHobbs May 4, 2023
10eef40
renamed handleMathOp to invokeDateOperation
MichaelLeeHobbs May 4, 2023
4849100
cleaned up predefined expressions
MichaelLeeHobbs May 4, 2023
a721e08
cleaned up Predefined Expressions
MichaelLeeHobbs May 4, 2023
ad81072
removed pointless defensive code
MichaelLeeHobbs May 4, 2023
29f2b65
added types RawCronFields and SerializedCronFields
MichaelLeeHobbs May 4, 2023
5f9d8ac
cleaned up asserts on getRawFields
MichaelLeeHobbs May 4, 2023
33443c3
fixed test
MichaelLeeHobbs May 4, 2023
67a4c2b
cleaned up parse options
MichaelLeeHobbs May 4, 2023
2cc95e2
cleaned up handleSingleRange, handleMultipleRanges
MichaelLeeHobbs May 4, 2023
6ec7d1a
commented compactField
MichaelLeeHobbs May 4, 2023
f393744
changed output dir to dist
MichaelLeeHobbs May 4, 2023
09c57f4
cleaned up PredefinedExpressionsEnum
MichaelLeeHobbs May 5, 2023
d9b67fa
cleaned up assert
MichaelLeeHobbs May 5, 2023
2925327
Merge remote-tracking branch 'origin/master'
MichaelLeeHobbs May 5, 2023
d0352a1
removed collect coverage from .js
MichaelLeeHobbs May 5, 2023
6e4607b
added prettier as a dev dependencies and added object-curly-spacing t…
MichaelLeeHobbs May 5, 2023
172641c
Renamed enums using PascalCase
MichaelLeeHobbs May 5, 2023
3ec3ddc
removed prettier, having eslint and prettier at the same time was a b…
MichaelLeeHobbs May 5, 2023
6a4fa5d
refactored out CronConstants.ts and refactored constraints into the f…
MichaelLeeHobbs May 5, 2023
2d96b49
disabled failing test that are allowed by current behavior. It's upto…
MichaelLeeHobbs May 5, 2023
c315950
fixed comment
MichaelLeeHobbs May 5, 2023
9681153
Fixed bugs for dual builds which broke the tests. Fixed the tests
MichaelLeeHobbs May 7, 2023
e0e909e
refactored casing on enums
MichaelLeeHobbs May 8, 2023
de8d623
removed debug
MichaelLeeHobbs May 8, 2023
59566a0
renamed interfaces and cleaned up some code
MichaelLeeHobbs May 8, 2023
467fdef
freeze instead of cloning to prevent mutation
MichaelLeeHobbs May 8, 2023
91a1e2c
optimized applyDateOperation
MichaelLeeHobbs May 20, 2023
5cc4170
renamed CronFields to CronFieldCollection
MichaelLeeHobbs May 20, 2023
484e302
removed archive
MichaelLeeHobbs May 20, 2023
ce0048a
fixed github build based on suggestion from harrisiirak
MichaelLeeHobbs May 20, 2023
b2cfbff
this commit is to capture DaysInMonth changes before removing it so w…
MichaelLeeHobbs May 20, 2023
e6835fa
refactored out DaysInMonth enum, we had to do silly things to make it…
MichaelLeeHobbs May 20, 2023
c3ebd04
cleaned up enum names
MichaelLeeHobbs May 20, 2023
6f91fb5
cleaned up unneeded mutation protection
MichaelLeeHobbs May 20, 2023
b0c1a68
cleaned up tests
MichaelLeeHobbs May 20, 2023
6f0129f
cleaned up var naming
MichaelLeeHobbs May 20, 2023
c1812c8
clean up old todos
MichaelLeeHobbs May 22, 2023
05d4f6c
cleaned up unneeded mutation protection
MichaelLeeHobbs May 22, 2023
d0ee50c
added documentation for strict mode
MichaelLeeHobbs May 22, 2023
72c3e36
cleaned up the project, 100% coverage, fixed broken test, replaced sp…
MichaelLeeHobbs May 22, 2023
0ea8af3
clean up
MichaelLeeHobbs May 23, 2023
6e8a8c4
remove unsupported Node.js versions from the build matrix.
MichaelLeeHobbs May 28, 2023
76827ec
removed notes
MichaelLeeHobbs May 28, 2023
b0ed594
removed redundant utc option
MichaelLeeHobbs May 28, 2023
4f6593a
cleaned up comments
MichaelLeeHobbs May 28, 2023
aa36aae
renamed DayOfTheMonthRange to DayOfMonthRange
MichaelLeeHobbs May 28, 2023
e9c43f5
renamed DayOfTheWeekRange to DayOfWeekRange
MichaelLeeHobbs May 28, 2023
ff10ea8
renamed CronFieldTypes to CronFieldType
MichaelLeeHobbs May 28, 2023
650d7d9
Update src/wrapper-index.cjs
MichaelLeeHobbs May 28, 2023
25c4653
removed ESM support and updated documentation
MichaelLeeHobbs May 30, 2023
b3b5f11
Update src/fields/CronMonth.ts
MichaelLeeHobbs Jun 5, 2023
e950926
Update src/fields/CronMonth.ts
MichaelLeeHobbs Jun 5, 2023
86e85e8
perf(npm): remove superfluous files from npm package (#328)
sheerlox Aug 11, 2023
3c1f091
Bump package version
harrisiirak Aug 14, 2023
c939a8b
Update package-lock.json
harrisiirak Aug 28, 2023
0688c90
Add +x flag to .husky/pre-commit
harrisiirak Aug 28, 2023
dc37382
Update files in package.json
harrisiirak Aug 28, 2023
c3e7ba7
Use CronUnit enum directly where possible
harrisiirak Aug 31, 2023
f007f42
Add parseInt radix
harrisiirak Aug 31, 2023
0ec95d0
Remove docs from repo
harrisiirak Aug 31, 2023
a096963
Array index access formatting
harrisiirak Aug 31, 2023
b47821e
Rename CronDayOfTheWeek to CronDayOfWeek
harrisiirak Aug 31, 2023
4816963
Cleanup CronFields tests
harrisiirak Aug 31, 2023
fcc29fa
Remove unnecessary assertion
harrisiirak Aug 31, 2023
83c3d72
Remove unused code path
harrisiirak Aug 31, 2023
e65481f
Rename test cases
harrisiirak Aug 31, 2023
349facd
Change assertion
harrisiirak Aug 31, 2023
83be54b
Remove Object.freeze usage
harrisiirak Aug 31, 2023
7e4fa66
Remove assertions that can create possible performance issues
harrisiirak Aug 31, 2023
b60921e
Upgrade luxon
harrisiirak Aug 31, 2023
126aaca
Update dev deps
harrisiirak Aug 31, 2023
e13df99
Update dev deps
harrisiirak Sep 5, 2023
1aec006
Ingore duplicate enum values
harrisiirak Sep 5, 2023
0971a2e
Update import order
harrisiirak Sep 5, 2023
f04ab74
Import field classes directly and remove CronFieldCollection module r…
harrisiirak Sep 5, 2023
08d5dfa
Remove duplicate options interface
harrisiirak Sep 8, 2023
68bd1a9
Simplify CronFieldCollection usage
harrisiirak Sep 8, 2023
b8b9451
Remove package.cjs.json
harrisiirak Sep 8, 2023
d352e5b
Remove invalid target from ignorePatterns
harrisiirak Sep 8, 2023
4c09aa6
Change allowJs to false
harrisiirak Sep 8, 2023
453ba4c
Update LICENSE
harrisiirak Sep 8, 2023
c8ed529
Include Node.js 20 in build workflow
harrisiirak Sep 8, 2023
324a120
Iterators cleanup. Implement E6 compatible iterator for CronExpressio…
harrisiirak Sep 8, 2023
0812387
Cleanup CronExpression tests
harrisiirak Sep 11, 2023
73e4938
Cleanup CronDate tests
harrisiirak Sep 11, 2023
4779643
Cleanup CronParser tests
harrisiirak Sep 11, 2023
41b3e8a
Cleanup CronFields tests
harrisiirak Sep 11, 2023
de3a218
Cleanup CronExpressionParser tests
harrisiirak Sep 11, 2023
211a366
More tests cleanup
harrisiirak Sep 11, 2023
a3fbd6c
Bump luxon to v3.5.0
harrisiirak Jan 27, 2025
46b6e64
Apply minor performance improvements to findSchedule loop
harrisiirak Jan 27, 2025
fec99c9
Optimize unit add/subtract logic in CronDate
harrisiirak Jan 27, 2025
afa9573
Refactor types and decouple CronExpression from CronExpressionParser …
harrisiirak Jan 27, 2025
35803ef
Upgrade eslint deps and config format
harrisiirak Feb 1, 2025
40fd99c
Fix index exports and add missing CronExpressionParser export
harrisiirak Feb 2, 2025
3ec29ca
Add CronFieldCollection.from method to simplify interval fields modif…
harrisiirak Feb 2, 2025
e964653
Update README.md with relevant changes
harrisiirak Feb 2, 2025
9fd4757
Refactor CronParser class and split file parsing related logic into C…
harrisiirak Feb 2, 2025
2ba4802
Remove applyDateOperation check
harrisiirak Feb 2, 2025
dc0e8e8
Ignore loop guard in coverage report
harrisiirak Feb 2, 2025
19d2412
Update husky usage
harrisiirak Feb 2, 2025
cf974bb
Remove unnecessary startOf calls for second add/subtract in CronDate
harrisiirak Feb 2, 2025
4469139
Add benchmarking tooling
harrisiirak Feb 4, 2025
26d4935
Bump min Node.js version requirement
harrisiirak Feb 5, 2025
7cbd530
Add documentation generation and publishing GH Actions workflow
harrisiirak Feb 5, 2025
f4eab2b
Remove component.json
harrisiirak Feb 5, 2025
c05ca19
Add .npmignore
harrisiirak Feb 5, 2025
b64cc49
Update tsconfig.json
harrisiirak Feb 5, 2025
80a04e9
Add prettier for code linting/formatting
harrisiirak Feb 5, 2025
8a1018e
Reformat files
harrisiirak Feb 5, 2025
3678b9e
Use test instead it
harrisiirak Feb 6, 2025
df63265
Merge branch 'master' into typescript-rewrite
harrisiirak Feb 13, 2025
2b31846
Update package.json
harrisiirak Feb 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# .editorconfig
root = true

[*]
indent_style = space
indent_size = 2
max_line_length = 120

[*.{js,ts}]
ij_typescript_spaces_within_imports = true
15 changes: 0 additions & 15 deletions .eslintrc.json

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Documentation

on:
push:
branches:
- master

permissions:
contents: read
pages: write
id-token: write

jobs:
documentation:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '>=22'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Generate documentation
run: npm run docs

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
12 changes: 6 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ name: Build

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x]
node-version: [18.x, 19.x, 20.x, 21.x, 22.x, 23.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm test
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
node_modules
lib-cov
coverage
*.seed
Expand All @@ -12,10 +12,18 @@ coverage
pids
logs
results
dist
testing
docs

npm-debug.log

.run
.idea
.history
.vscode
.nyc_output
yarn.lock

benchmarks/versions/
benchmarks/results/

!coverage/*.svg
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run precommit
36 changes: 36 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Source
src/
*.ts
!*.d.ts

# Tests
tests/
coverage/
.nyc_output/

# Benchmarks
benchmarks/

# Development configs
.editorconfig
.eslintrc*
.prettierrc*
.github/
.vscode/
.idea/
.history/
tsconfig.json
jest.config.js
eslint.config.js

# Documentation
docs/

# Misc
.DS_Store
*.log

# Keep dist folder
!dist/
!dist/**/*.js
!dist/**/*.d.ts
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"semi": true,
"tabWidth": 2,
"printWidth": 120,
"trailingComma": "all",
"bracketSpacing": true
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2016 Harri Siirak
Copyright (c) 2014-2023 Harri Siirak

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading