-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit ESM modules that are natively compatible with Node.js 12+ and deno
- Loading branch information
Showing
58 changed files
with
195 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import * as url from 'url'; | ||
|
||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
fs.writeFileSync( | ||
path.join(__dirname, '../dist/cjs/package.json'), | ||
JSON.stringify({ | ||
type: 'commonjs', | ||
}), | ||
); | ||
|
||
fs.writeFileSync( | ||
path.join(__dirname, '../dist/esm/package.json'), | ||
JSON.stringify({ | ||
type: 'module', | ||
}), | ||
); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
], | ||
"author": "Uri Shaked <[email protected]>", | ||
"license": "MIT", | ||
"type": "module", | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/esm/index.js", | ||
"typings": "./dist/cjs/index.d.ts", | ||
|
@@ -21,16 +22,28 @@ | |
}, | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js" | ||
"import": { | ||
"default": "./dist/esm/index.js", | ||
"types": "./dist/esm/index.d.ts" | ||
}, | ||
"require": { | ||
"default": "./dist/cjs/index.js", | ||
"types": "./dist/cjs/index.d.ts" | ||
} | ||
}, | ||
"./gdb-tcp-server": { | ||
"import": "./dist/esm/gdb/gdb-tcp-server.js", | ||
"require": "./dist/cjs/gdb/gdb-tcp-server.js" | ||
"import": { | ||
"default": "./dist/esm/gdb/gdb-tcp-server.js", | ||
"types": "./dist/esm/gdb/gdb-tcp-server.d.ts" | ||
}, | ||
"require": { | ||
"default": "./dist/cjs/gdb/gdb-tcp-server.js", | ||
"types": "./dist/cjs/gdb/gdb-tcp-server.d.ts" | ||
} | ||
} | ||
}, | ||
"scripts": { | ||
"build": "rimraf dist && tsc && tsc -p tsconfig.esm.json && node build-scripts/dist-package-json", | ||
"build": "rimraf dist && tsc && tsc -p tsconfig.cjs.json && node build-scripts/dist-package-json", | ||
"prepublish": "npm run build", | ||
"prepare": "husky install", | ||
"format:check": "prettier --check **/*.{ts,js} !**/dist/** !**/node_modules/**", | ||
|
@@ -45,7 +58,7 @@ | |
}, | ||
"devDependencies": { | ||
"@types/minimist": "^1.2.2", | ||
"@types/node": "^14.14.22", | ||
"@types/node": "^16", | ||
"@typescript-eslint/eslint-plugin": "^6.7.3", | ||
"@typescript-eslint/parser": "^6.7.3", | ||
"eslint": "^8.50.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
export default { | ||
arrowParens: 'always', | ||
printWidth: 100, | ||
singleQuote: true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
export { GDBConnection } from './gdb/gdb-connection'; | ||
export { GDBServer } from './gdb/gdb-server'; | ||
export { GPIOPin, GPIOPinState } from './gpio-pin'; | ||
export { BasePeripheral, Peripheral } from './peripherals/peripheral'; | ||
export { RPI2C, I2CSpeed, I2CMode } from './peripherals/i2c'; | ||
export { RPUSBController } from './peripherals/usb'; | ||
export { RP2040 } from './rp2040'; | ||
export { USBCDC } from './usb/cdc'; | ||
export { GDBConnection } from './gdb/gdb-connection.js'; | ||
export { GDBServer } from './gdb/gdb-server.js'; | ||
export { GPIOPin, GPIOPinState } from './gpio-pin.js'; | ||
export { BasePeripheral, Peripheral } from './peripherals/peripheral.js'; | ||
export { RPI2C, I2CSpeed, I2CMode } from './peripherals/i2c.js'; | ||
export { RPUSBController } from './peripherals/usb.js'; | ||
export { RP2040 } from './rp2040.js'; | ||
export { USBCDC } from './usb/cdc.js'; | ||
export { | ||
DataDirection, | ||
DescriptorType, | ||
ISetupPacketParams, | ||
SetupRecipient, | ||
SetupRequest, | ||
SetupType, | ||
} from './usb/interfaces'; | ||
} from './usb/interfaces.js'; | ||
export { | ||
createSetupPacket, | ||
getDescriptorPacket, | ||
setDeviceAddressPacket, | ||
setDeviceConfigurationPacket, | ||
} from './usb/setup'; | ||
export { ConsoleLogger, Logger, LogLevel } from './utils/logging'; | ||
} from './usb/setup.js'; | ||
export { ConsoleLogger, Logger, LogLevel } from './utils/logging.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.