Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
81 changes: 39 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
"node": ">=18"
},
"dependencies": {
"@js-temporal/polyfill": "^0.5.1",
"rrule-temporal": "^1.4.5"
},
"overrides": {
"@js-temporal/polyfill": "npm:temporal-polyfill@^0.3.0"
},
"devDependencies": {
"date-fns": "^4.1.0",
"dayjs": "^1.11.19",
Expand All @@ -45,7 +47,8 @@
"no-useless-catch": "off",
"promise/prefer-await-to-then": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-spread": "off"
"unicorn/prefer-spread": "off",
"import-x/no-extraneous-dependencies": "off"
}
},
"scripts": {
Expand Down
39 changes: 39 additions & 0 deletions test/polyfill-check.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const assert = require('node:assert/strict');
const {execSync} = require('node:child_process');
const path = require('node:path');
const {describe, it} = require('mocha');

describe('Temporal Polyfill Configuration', () => {
it('should NOT have JSBI dependency installed', () => {
try {
execSync('npm ls jsbi --json', {encoding: 'utf8', stdio: 'pipe'});
assert.fail('JSBI should not be installed');
} catch {
// Expected: JSBI should not be found (command will fail)
assert.ok(true, 'JSBI is not installed as expected');
}
});

it('should use temporal-polyfill (not @js-temporal/polyfill with JSBI)', () => {
const result = execSync('npm ls @js-temporal/polyfill --json', {encoding: 'utf8'});
const data = JSON.parse(result);

// Find the actual resolved package
const resolved = data.dependencies['rrule-temporal'].dependencies['@js-temporal/polyfill'];

assert.ok(resolved, '@js-temporal/polyfill should be resolved');
assert.match(resolved.resolved, /temporal-polyfill/);
});

it('should load temporal-polyfill when requiring @js-temporal/polyfill', () => {
// Clear require cache to force fresh load
const modulePath = require.resolve('@js-temporal/polyfill');
delete require.cache[modulePath];

const _Temporal = require('@js-temporal/polyfill');
const packageJsonPath = path.join(path.dirname(modulePath), 'package.json');
const packageJson = require(packageJsonPath);

assert.strictEqual(packageJson.name, 'temporal-polyfill');
});
});
Loading