Skip to content
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

[package.json] Add ./package.json to exports #1239

Merged
merged 1 commit into from Aug 29, 2022

Conversation

hatem-72
Copy link
Contributor

@hatem-72 hatem-72 commented Jul 11, 2022

This PR fixes the compatibility between react-native and the last luxon versions (broken since v2.5.0).

It adds the package.json to the exports section

  "exports": {
    ".": {
      "import": "./src/luxon.js",
      "require": "./build/node/luxon.js"
    },
+   "./package.json": "./package.json",
  },

It is something you can find in other popular libraries that have to deal with multiple js environments and bundlers, such as react-native.
Something similar happened to the uuidjs/uuid repository:

This PR will close #1238

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 11, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@gbinu42
Copy link

gbinu42 commented Jul 20, 2022

Hi @icambron can this be merged?

@dminkovsky
Copy link

Just merged the same fix here: nhost/nhost#828.

@cglacet
Copy link

cglacet commented Aug 25, 2022

I believe the bug is still here in version 3.0.1.

@icambron icambron merged commit 50197fe into moment:master Aug 29, 2022
@icambron
Copy link
Member

I don't understand what this does, but I don't see an issue with exporting package.json

@cglacet
Copy link

cglacet commented Sep 23, 2022

@icambron if you don't modify the file as suggested here it gives the following error :

warn Package luxon has been ignored because it contains invalid configuration. 
Reason: Package subpath './package.json' is not defined by "exports" in /Users/project/node_modules/luxon/package.json

brboi added a commit to odoo-dev/odoo that referenced this pull request Aug 30, 2023
**Changelog**

**3.4.2 (2023-08-26)**

- Fixes regression from 3.4.1 (moment/luxon#1493)

**3.4.1 (2023-08-23)**

- Fixes for regressions from 3.4.0
  (moment/luxon#1482 and moment/luxon#1488)

**3.4.0 (2023-08-08)**

- Fix type checking on input zones
- Fix Islamic months listing
- Fix normalize() for negative inputs

**3.3.0 (2023-03-03)**

- Fix off-by-one in Interval#count (moment/luxon#1308)
- Support formatting for custom zones (moment/luxon#1377)
- Fix parsing for narrow spaces (moment/luxon#1369)
- Handle leap year issue with AD 100 (moment/luxon#1390)
- Allow parsing of just an offset

**3.2.1 (2023-01-04)**

- Fix for RFC-2822 regex vulnerability
- Better handling of BCP tags with -x- extensions

**3.2.0 (2022-12-29)**

- Allow timeZone to be specified as an intl option
- Fix for diff's handling of end-of-month when crossing leap years
  (moment/luxon#1340)
- Add Interval.toLocaleString() (moment/luxon#1320)

**3.1.1 (2022-11-28)**

- Add Settings.twoDigitCutoffYear

**3.1.0 (2022-10-31)**

- Add Duration.rescale

**3.0.4 (2022-09-24)**

- Fix quarters in diffs (moment/luxon#1279)
- Export package.json in package (moment/luxon#1239)

**3.0.2 (2022-08-28)**

- Lots of doc changes
- Added DateTime.expandFormat
- Added support for custom conversion matrices in Durations
robodoo pushed a commit to odoo/odoo that referenced this pull request Sep 4, 2023
**Changelog**

**3.4.2 (2023-08-26)**

- Fixes regression from 3.4.1 (moment/luxon#1493)

**3.4.1 (2023-08-23)**

- Fixes for regressions from 3.4.0
  (moment/luxon#1482 and moment/luxon#1488)

**3.4.0 (2023-08-08)**

- Fix type checking on input zones
- Fix Islamic months listing
- Fix normalize() for negative inputs

**3.3.0 (2023-03-03)**

- Fix off-by-one in Interval#count (moment/luxon#1308)
- Support formatting for custom zones (moment/luxon#1377)
- Fix parsing for narrow spaces (moment/luxon#1369)
- Handle leap year issue with AD 100 (moment/luxon#1390)
- Allow parsing of just an offset

**3.2.1 (2023-01-04)**

- Fix for RFC-2822 regex vulnerability
- Better handling of BCP tags with -x- extensions

**3.2.0 (2022-12-29)**

- Allow timeZone to be specified as an intl option
- Fix for diff's handling of end-of-month when crossing leap years
  (moment/luxon#1340)
- Add Interval.toLocaleString() (moment/luxon#1320)

**3.1.1 (2022-11-28)**

- Add Settings.twoDigitCutoffYear

**3.1.0 (2022-10-31)**

- Add Duration.rescale

**3.0.4 (2022-09-24)**

- Fix quarters in diffs (moment/luxon#1279)
- Export package.json in package (moment/luxon#1239)

**3.0.2 (2022-08-28)**

- Lots of doc changes
- Added DateTime.expandFormat
- Added support for custom conversion matrices in Durations

closes #133599

Related: odoo/enterprise#46556
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pod install fails with react-native build which includes luxon
5 participants