-
Notifications
You must be signed in to change notification settings - Fork 0
chore: 迁移日期时间工具库至luxon #336
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
Open
YufJi
wants to merge
28
commits into
test
Choose a base branch
from
chore/luxon
base: test
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 20 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
54a7c82
feat: Migrate date handling utilities from date-fns to Luxon
YufJi bbce7bc
feat: 补充与老版本一致性验证的测试用例
YufJi 64973dc
chore: old-basic
YufJi beb75ac
chore: 删除 Luxon 迁移总结文档
YufJi 583de92
feat(tests): enhance compatibility tests for date-time utilities
YufJi 26cab47
chore: 移除不再使用的 date-fns 依赖
YufJi f01d5fe
chore(tests): 添加快照测试以增强与老版本的一致性验证
YufJi c54174a
fix: 接受AI code review的建议
YufJi 65b898d
chore: 移除不再使用的 date-fns 依赖
YufJi d014595
fix: 接受AI code review的建议
YufJi 1e649c1
chore: 更新包名称为 @lcap/basic-template-old-fixture
YufJi da86463
test: 更新 CurrTime 测试并添加 CurrDateTime 测试以增强一致性验证
YufJi 1d71c82
修复: 移除 CurrDate 测试中的快照匹配以提高一致性
YufJi 8290046
Merge remote-tracking branch 'origin/test' into chore/luxon
YufJi c5af4b4
chore: 标记 AddDays、AddMonths 和 SubDays 方法为已弃用
YufJi 4f2dbe4
chore: 更新日期时间相关测试
YufJi d64b45d
chore: 更新 GetDateCount 测试以包含更多度量标准并改进快照匹配
YufJi b5a8700
chore: 更新日期处理逻辑以支持不同格式的日期字符串并增强快照测试
YufJi bf504ba
chore: 更新日期和日期时间处理逻辑,增强测试覆盖率和快照一致性
YufJi 6b7813f
feat(tests): add date utility tests for consistency with date-fns
YufJi e105dd4
chore: 移除不必要的 ISO 字符串格式化测试,简化日期格式化测试逻辑
YufJi 83110f6
chore: 移除冗余测试注释,简化日期时间测试代码
YufJi 25fc2cc
fix: 接受AI code review的建议
YufJi 08180f2
Merge remote-tracking branch 'origin/test' into chore/luxon
YufJi 4ae1ede
refactor: enhance date-time tests for consistency with old version
YufJi 16effa8
Merge remote-tracking branch 'origin/test' into chore/luxon
YufJi 6be289a
refactor: 删除不友好文案(zirun写的~
YufJi f9ac73c
Merge remote-tracking branch 'origin/test' into chore/luxon
YufJi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,28 @@ | ||
| const fc = require('fast-check'); | ||
| fc.configureGlobal({ numRuns: 100 }); | ||
|
|
||
| const { default: NaslSDK, Helpers } = require('./src/sdk'); | ||
| const { toString, fromString } = require('./src/init/dataTypes/tools'); | ||
| const Basic = require('./src/index'); | ||
| const { Helpers } = require('./src/sdk'); | ||
|
|
||
| try { | ||
| const utils = NaslSDK.initUtils({ | ||
| Basic.initDataTypes({ | ||
| dataTypesMap: { | ||
| 'nasl.core.DateTime': { typeName: 'DateTime' }, | ||
| 'nasl.core.Date': { typeName: 'Date' }, | ||
| }, | ||
| }); | ||
| const { utils } = Basic.initUtils({ | ||
| typeDefinitionMap: new Map(), | ||
| enumsMap: {}, | ||
| dataTypesMap: {}, | ||
|
|
||
| toString, | ||
| fromString, | ||
| toString: Basic.Tools.toString, | ||
| fromString: Basic.Tools.fromString, | ||
| }); | ||
|
|
||
| // 全局变量 | ||
| global.sdkUtils = utils; | ||
| global.sdkHelpers = Helpers; | ||
| global.Utils = utils; | ||
| global.Helpers = Helpers; | ||
| } catch (error) { | ||
| console.log('Error initializing NaslSDK:', error); | ||
| console.log('Error initializing Basic:', error); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.