Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
justingrant committed Dec 6, 2021
1 parent 6d322b6 commit 4770110
Show file tree
Hide file tree
Showing 7 changed files with 1,548 additions and 1,642 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ This polyfill is compatible with Node.js 14 or later.

## Roadmap

* [x] Fork non-production polyfill from [tc39/proposal-temporal repo](https://github.com/tc39/proposal-temporal/tree/main/polyfill)
* [x] Release initial pre-alpha to NPM at [@js-temporal/polyfill](https://www.npmjs.com/package/@js-temporal/polyfill)
* [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
* [x] Release alpha version to NPM
* [x] Deprecate all other earlier Temporal polyfills
* [x] Optimize slow operations by reducing calls to Intl.DateTimeFormat constructor (see #7, #8, #10, #12)
* [x] Convert to TypeScript for better maintainability
* [x] Improve typing of sources for better maintainability
* [ ] Migrate to JSBI for improved compile-time safety around BigInt operations.
* [ ] Optimize performance of other slow operations
* [ ] Release production version to NPM
- [x] Fork non-production polyfill from [tc39/proposal-temporal repo](https://github.com/tc39/proposal-temporal/tree/main/polyfill)
- [x] Release initial pre-alpha to NPM at [@js-temporal/polyfill](https://www.npmjs.com/package/@js-temporal/polyfill)
- [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
- [x] Release alpha version to NPM
- [x] Deprecate all other earlier Temporal polyfills
- [x] Optimize slow operations by reducing calls to Intl.DateTimeFormat constructor (see #7, #8, #10, #12)
- [x] Convert to TypeScript for better maintainability
- [x] Improve typing of sources for better maintainability
- [ ] Migrate to JSBI for improved compile-time safety around BigInt operations.
- [ ] Optimize performance of other slow operations
- [ ] Release production version to NPM

## Bug Reports and Feedback

Expand Down
2 changes: 1 addition & 1 deletion lib/ecmascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5002,7 +5002,7 @@ export function GetOptionsObject<T>(options: T) {
throw new TypeError(`Options parameter must be an object, not ${options === null ? 'null' : `${typeof options}`}`);
}

export function CreateOnePropObject<K extends string, V extends unknown>(propName: K, propValue: V): { [k in K]: V } {
export function CreateOnePropObject<K extends string, V>(propName: K, propValue: V): { [k in K]: V } {
const o = ObjectCreate(null);
o[propName] = propValue;
return o;
Expand Down
3,116 changes: 1,509 additions & 1,607 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 22 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
"build": "rm -rf dist/* tsc-out/* && tsc && rollup -c rollup.config.js",
"prepare": "npm run build",
"prepublishOnly": "npm run build",
"update": "npx npm-check-updates -u -x @pipobscure/demitasse",
"update": "npx npm-check-updates -u -x @pipobscure/demitasse && npm install",
"playground": "TEMPORAL_PLAYGROUND=1 npm run build && node --experimental-modules --no-warnings --icu-data-dir node_modules/full-icu -r ./dist/playground.cjs",
"lint": "eslint . --ext ts,js,mjs,.d.ts --max-warnings 0 --cache \"$@\"",
"lint": "eslint . --ext ts,js,mjs,.d.ts --max-warnings 0 --cache \"$@\" && npm run prettier",
"postlint": "npm run tscheck",
"prune": "ts-prune -e -i test/tc39 -i \"(lib/index|lib/init|index.d).ts\"",
"pretty": "eslint . --ext ts,js,mjs,.d.ts --fix",
"prettier": "prettier lib/* ./test/*.mjs ./*.md ./*.json ./*.d.ts ./*.js ./.*.yml --check",
"prettierfix": "prettier lib/* ./test/*.mjs ./*.md ./*.json ./*.d.ts ./*.js ./.*.yml --check --write",
"eslintfix": "eslint . --ext ts,js,mjs,.d.ts --fix",
"fix": "npm run eslintfix && npm run prettierfix",
"tscheck": "tsc index.d.ts --noEmit --strict --lib ESNext"
},
"keywords": [
Expand All @@ -49,6 +52,7 @@
"Daniel Ehrenberg",
"Jason Williams",
"Justin Grant",
"James Wright",
"Maggie Johnson-Pint",
"Matt Johnson-Pint",
"Ms2ger",
Expand All @@ -65,34 +69,34 @@
"lib"
],
"dependencies": {
"big-integer": "^1.6.49",
"big-integer": "^1.6.51",
"tslib": "^2.3.1"
},
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.4",
"@pipobscure/demitasse": "^1.0.10",
"@pipobscure/demitasse-pretty": "^1.0.10",
"@pipobscure/demitasse-run": "^1.0.10",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.5",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/plugin-replace": "^3.0.0",
"@rollup/plugin-typescript": "^8.2.5",
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.32.0",
"eslint": "^7.32.0",
"@rollup/plugin-typescript": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"eslint": "^8.4.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"full-icu": "^1.3.4",
"prettier": "^2.4.1",
"rollup": "^2.57.0",
"rollup-plugin-dts": "^4.0.0",
"full-icu": "^1.4.0",
"prettier": "^2.5.1",
"rollup": "^2.60.2",
"rollup-plugin-dts": "^4.0.1",
"rollup-plugin-terser": "^7.0.2",
"test262-harness": "^9.0.0",
"timezones.json": "^1.5.3",
"ts-prune": "^0.10.1",
"typescript": "^4.4.3"
"ts-prune": "^0.10.2",
"typescript": "^4.5.2"
},
"engines": {
"node": ">=12"
Expand Down
2 changes: 2 additions & 0 deletions test/duration.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ describe('Duration', () => {
});
it('unrepresentable number is not allowed', () => {
units.forEach((unit, ix) => {
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision,no-loss-of-precision
throws(() => new Duration(...Array(ix).fill(0), 1e309), RangeError);
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision,no-loss-of-precision
throws(() => Duration.from({ [unit]: 1e309 }), RangeError);
});
const manyNines = '9'.repeat(309);
Expand Down
1 change: 1 addition & 0 deletions test/zoneddatetime.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,7 @@ describe('ZonedDateTime', () => {
});
it('hoursInDay works with non-half-hour DST change', () => {
const zdt = ZonedDateTime.from('1933-01-01T12:00[Asia/Singapore]');
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision,no-loss-of-precision
assert(Math.abs(zdt.hoursInDay - 23.6666666666666666) < Number.EPSILON);
});
it('hoursInDay works when day starts at 1:00 due to DST start at midnight', () => {
Expand Down
7 changes: 2 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
"noImplicitReturns": true,
"noImplicitThis": true,
"strict": false,
"lib": [
"dom",
"ES2020"
],
"lib": ["dom", "ES2020"],
"preserveConstEnums": false,
"skipDefaultLibCheck": true,
"strictBindCallApply": true,
Expand All @@ -30,5 +27,5 @@
"target": "es2020",
"outDir": "tsc-out/",
"types": []
},
}
}

0 comments on commit 4770110

Please sign in to comment.