Skip to content

Commit 4770110

Browse files
committed
Update dependencies
- Update dependencies (except demitasse which requires test changes) - Fixes eslint & prettier issues - Add James to the contributors list - Append `npm install` step in the package.json `update` script - Add `fix` script to package.json that auto-fixes prettier and eslint - Add `prettier` script to package.json which includes non-code files (e.g. json) that eslint ignores. Also include this in `npm run lint` so that PRs will catch prettier issues too.
1 parent 6d322b6 commit 4770110

File tree

7 files changed

+1548
-1642
lines changed

7 files changed

+1548
-1642
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ This polyfill is compatible with Node.js 14 or later.
1313

1414
## Roadmap
1515

16-
* [x] Fork non-production polyfill from [tc39/proposal-temporal repo](https://github.com/tc39/proposal-temporal/tree/main/polyfill)
17-
* [x] Release initial pre-alpha to NPM at [@js-temporal/polyfill](https://www.npmjs.com/package/@js-temporal/polyfill)
18-
* [x] Sync the code in this repo with the handful of polyfill changes that have recently been made in the [tc39/proposal-temporal](https://github.com/tc39/proposal-temporal) repo
19-
* [x] Release alpha version to NPM
20-
* [x] Deprecate all other earlier Temporal polyfills
21-
* [x] Optimize slow operations by reducing calls to Intl.DateTimeFormat constructor (see #7, #8, #10, #12)
22-
* [x] Convert to TypeScript for better maintainability
23-
* [x] Improve typing of sources for better maintainability
24-
* [ ] Migrate to JSBI for improved compile-time safety around BigInt operations.
25-
* [ ] Optimize performance of other slow operations
26-
* [ ] Release production version to NPM
16+
- [x] Fork non-production polyfill from [tc39/proposal-temporal repo](https://github.com/tc39/proposal-temporal/tree/main/polyfill)
17+
- [x] Release initial pre-alpha to NPM at [@js-temporal/polyfill](https://www.npmjs.com/package/@js-temporal/polyfill)
18+
- [x] Sync the code in this repo with the handful of polyfill changes that have recently been made in the [tc39/proposal-temporal](https://github.com/tc39/proposal-temporal) repo
19+
- [x] Release alpha version to NPM
20+
- [x] Deprecate all other earlier Temporal polyfills
21+
- [x] Optimize slow operations by reducing calls to Intl.DateTimeFormat constructor (see #7, #8, #10, #12)
22+
- [x] Convert to TypeScript for better maintainability
23+
- [x] Improve typing of sources for better maintainability
24+
- [ ] Migrate to JSBI for improved compile-time safety around BigInt operations.
25+
- [ ] Optimize performance of other slow operations
26+
- [ ] Release production version to NPM
2727

2828
## Bug Reports and Feedback
2929

lib/ecmascript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5002,7 +5002,7 @@ export function GetOptionsObject<T>(options: T) {
50025002
throw new TypeError(`Options parameter must be an object, not ${options === null ? 'null' : `${typeof options}`}`);
50035003
}
50045004

5005-
export function CreateOnePropObject<K extends string, V extends unknown>(propName: K, propValue: V): { [k in K]: V } {
5005+
export function CreateOnePropObject<K extends string, V>(propName: K, propValue: V): { [k in K]: V } {
50065006
const o = ObjectCreate(null);
50075007
o[propName] = propValue;
50085008
return o;

package-lock.json

Lines changed: 1509 additions & 1607 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@
2222
"build": "rm -rf dist/* tsc-out/* && tsc && rollup -c rollup.config.js",
2323
"prepare": "npm run build",
2424
"prepublishOnly": "npm run build",
25-
"update": "npx npm-check-updates -u -x @pipobscure/demitasse",
25+
"update": "npx npm-check-updates -u -x @pipobscure/demitasse && npm install",
2626
"playground": "TEMPORAL_PLAYGROUND=1 npm run build && node --experimental-modules --no-warnings --icu-data-dir node_modules/full-icu -r ./dist/playground.cjs",
27-
"lint": "eslint . --ext ts,js,mjs,.d.ts --max-warnings 0 --cache \"$@\"",
27+
"lint": "eslint . --ext ts,js,mjs,.d.ts --max-warnings 0 --cache \"$@\" && npm run prettier",
2828
"postlint": "npm run tscheck",
2929
"prune": "ts-prune -e -i test/tc39 -i \"(lib/index|lib/init|index.d).ts\"",
30-
"pretty": "eslint . --ext ts,js,mjs,.d.ts --fix",
30+
"prettier": "prettier lib/* ./test/*.mjs ./*.md ./*.json ./*.d.ts ./*.js ./.*.yml --check",
31+
"prettierfix": "prettier lib/* ./test/*.mjs ./*.md ./*.json ./*.d.ts ./*.js ./.*.yml --check --write",
32+
"eslintfix": "eslint . --ext ts,js,mjs,.d.ts --fix",
33+
"fix": "npm run eslintfix && npm run prettierfix",
3134
"tscheck": "tsc index.d.ts --noEmit --strict --lib ESNext"
3235
},
3336
"keywords": [
@@ -49,6 +52,7 @@
4952
"Daniel Ehrenberg",
5053
"Jason Williams",
5154
"Justin Grant",
55+
"James Wright",
5256
"Maggie Johnson-Pint",
5357
"Matt Johnson-Pint",
5458
"Ms2ger",
@@ -65,34 +69,34 @@
6569
"lib"
6670
],
6771
"dependencies": {
68-
"big-integer": "^1.6.49",
72+
"big-integer": "^1.6.51",
6973
"tslib": "^2.3.1"
7074
},
7175
"devDependencies": {
72-
"@babel/core": "^7.15.5",
73-
"@babel/preset-env": "^7.15.6",
76+
"@babel/core": "^7.16.0",
77+
"@babel/preset-env": "^7.16.4",
7478
"@pipobscure/demitasse": "^1.0.10",
7579
"@pipobscure/demitasse-pretty": "^1.0.10",
7680
"@pipobscure/demitasse-run": "^1.0.10",
7781
"@rollup/plugin-babel": "^5.3.0",
78-
"@rollup/plugin-commonjs": "^20.0.0",
79-
"@rollup/plugin-node-resolve": "^13.0.5",
82+
"@rollup/plugin-commonjs": "^21.0.1",
83+
"@rollup/plugin-node-resolve": "^13.0.6",
8084
"@rollup/plugin-replace": "^3.0.0",
81-
"@rollup/plugin-typescript": "^8.2.5",
82-
"@typescript-eslint/eslint-plugin": "^4.32.0",
83-
"@typescript-eslint/parser": "^4.32.0",
84-
"eslint": "^7.32.0",
85+
"@rollup/plugin-typescript": "^8.3.0",
86+
"@typescript-eslint/eslint-plugin": "^5.6.0",
87+
"@typescript-eslint/parser": "^5.6.0",
88+
"eslint": "^8.4.0",
8589
"eslint-config-prettier": "^8.3.0",
8690
"eslint-plugin-prettier": "^4.0.0",
87-
"full-icu": "^1.3.4",
88-
"prettier": "^2.4.1",
89-
"rollup": "^2.57.0",
90-
"rollup-plugin-dts": "^4.0.0",
91+
"full-icu": "^1.4.0",
92+
"prettier": "^2.5.1",
93+
"rollup": "^2.60.2",
94+
"rollup-plugin-dts": "^4.0.1",
9195
"rollup-plugin-terser": "^7.0.2",
9296
"test262-harness": "^9.0.0",
9397
"timezones.json": "^1.5.3",
94-
"ts-prune": "^0.10.1",
95-
"typescript": "^4.4.3"
98+
"ts-prune": "^0.10.2",
99+
"typescript": "^4.5.2"
96100
},
97101
"engines": {
98102
"node": ">=12"

test/duration.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,9 @@ describe('Duration', () => {
371371
});
372372
it('unrepresentable number is not allowed', () => {
373373
units.forEach((unit, ix) => {
374+
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision,no-loss-of-precision
374375
throws(() => new Duration(...Array(ix).fill(0), 1e309), RangeError);
376+
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision,no-loss-of-precision
375377
throws(() => Duration.from({ [unit]: 1e309 }), RangeError);
376378
});
377379
const manyNines = '9'.repeat(309);

test/zoneddatetime.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,6 +2493,7 @@ describe('ZonedDateTime', () => {
24932493
});
24942494
it('hoursInDay works with non-half-hour DST change', () => {
24952495
const zdt = ZonedDateTime.from('1933-01-01T12:00[Asia/Singapore]');
2496+
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision,no-loss-of-precision
24962497
assert(Math.abs(zdt.hoursInDay - 23.6666666666666666) < Number.EPSILON);
24972498
});
24982499
it('hoursInDay works when day starts at 1:00 due to DST start at midnight', () => {

tsconfig.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
"noImplicitReturns": true,
1717
"noImplicitThis": true,
1818
"strict": false,
19-
"lib": [
20-
"dom",
21-
"ES2020"
22-
],
19+
"lib": ["dom", "ES2020"],
2320
"preserveConstEnums": false,
2421
"skipDefaultLibCheck": true,
2522
"strictBindCallApply": true,
@@ -30,5 +27,5 @@
3027
"target": "es2020",
3128
"outDir": "tsc-out/",
3229
"types": []
33-
},
30+
}
3431
}

0 commit comments

Comments
 (0)