iamkun / iamkun/dayjs

reproductible patch

Open Beginner friendly
#3,163 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

From debian could you apply this patch

It keep locale filesystem order independant:
```
diff --git a/build/index.js b/build/index.js
index 4dd7708..c711ed6 100644
--- a/build/index.js
+++ b/build/index.js
@@ -30,7 +30,16 @@ async function listLocaleJson(localeArr) {
name: localeData.match(localeNameRegex)[1]
})
}))
- promisifyWriteFile(path.join(__dirname, '../locale.json'), JSON.stringify(localeListArr), 'utf8')
+ const out = localeListArr.sort((a, b) => {
+ if (a.key < b.key) return -1;
+ if (a.key > b.key) return 1;
+ return 0;
+ });
+ promisifyWriteFile(
+ path.join(__dirname, '../locale.json'),
+ JSON.stringify(out, null, 2) + '\n',
+ 'utf8'
+ );
}
```

Contributor guide

Open the contributing guide

Research direction

Start in build/index.js at listLocaleJson(localeArr), then inspect how locale.json is generated. Apply the requested deterministic sorting and formatting, and verify that the generated locale.json has stable filesystem-independent ordering and a trailing newline.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, localization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.