-
Notifications
You must be signed in to change notification settings - Fork 9
feat: convert to ESM #56
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,10 @@ | ||
| { | ||
| "name": "@hapi/ammo", | ||
| "description": "HTTP Range processing utilities", | ||
| "version": "6.0.1", | ||
| "version": "7.0.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While this is clearly a breaking change, the version should not be updated in the PR. |
||
| "type": "module", | ||
| "repository": "git://github.com/hapijs/ammo", | ||
| "main": "lib/index.js", | ||
| "exports": "./lib/index.js", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably also export |
||
| "types": "lib/index.d.ts", | ||
| "keywords": [ | ||
| "http", | ||
|
|
@@ -30,7 +31,7 @@ | |
| "typescript": "~4.6.4" | ||
| }, | ||
| "scripts": { | ||
| "test": "lab -a @hapi/code -t 100 -L -Y", | ||
| "test": "lab -a @hapi/code -Y", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Omitting coverage and linting is a big no-no IMO. I know lab doesn't currently handle coverage checks for modules, so something needs to be done. Either we update the implementation, or find an acceptable alternative. Same goes for linting, but it is probably more of a configuration issue.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep yep, agreed. I'm omitting temporarily. This is still a TBD. |
||
| "test-cov-html": "lab -a @hapi/code -r html -o coverage.html" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }, | ||
| "license": "BSD-3-Clause" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| 'use strict'; | ||
| import Stream from 'node:stream'; | ||
|
|
||
| const Stream = require('stream'); | ||
|
|
||
| const Ammo = require('..'); | ||
| const Code = require('@hapi/code'); | ||
| const Lab = require('@hapi/lab'); | ||
| const Wreck = require('@hapi/wreck'); | ||
| import * as Ammo from '../lib/index.js'; | ||
| import * as Code from '@hapi/code'; | ||
| import * as Lab from '@hapi/lab'; | ||
| import Wreck from '@hapi/wreck'; | ||
|
|
||
|
|
||
| const internals = {}; | ||
|
|
||
|
|
||
| const { describe, it } = exports.lab = Lab.script(); | ||
| const lab = Lab.script(); | ||
| const { describe, it } = lab; | ||
| const expect = Code.expect; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer if |
||
| export { lab }; | ||
|
|
||
|
|
||
| describe('header()', () => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would much prefer if the exports are declared when defined, as it closer aligns with intentions of the style guide (to immediately know if a variable / function / class is exported).