-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Broken json import and missing require.resolve
- Loading branch information
1 parent
694d902
commit 46ce76d
Showing
10 changed files
with
77 additions
and
76 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 |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
/cli.cjs | ||
/test/fixtures/* | ||
/test/generated/* | ||
# eslint doesn't like json imports | ||
/test/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
import process from 'node:process' | ||
import run, * as cli from './src/index.js' | ||
import { basename } from 'node:path' | ||
import { pathToFileURL } from 'node:url' | ||
#!/usr/bin/env node | ||
|
||
export default cli | ||
import run from './cli.js' | ||
|
||
// Auto-Run the CLI if this file is not imported | ||
if (basename(pathToFileURL(process.argv[1]).href) === 'riot') { | ||
/* c8 ignore next */ | ||
run(process.argv) | ||
} | ||
run(process.argv) |
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
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,15 +1,27 @@ | ||
import json from '@rollup/plugin-json' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
|
||
export default { | ||
input: 'index.js', | ||
input: 'src/index.js', | ||
output: [ | ||
{ | ||
banner: '#!/usr/bin/env node', | ||
file: 'cli.js', | ||
format: 'es', | ||
}, | ||
{ | ||
banner: '#!/usr/bin/env node', | ||
file: 'cli.cjs', | ||
format: 'cjs', | ||
}, | ||
], | ||
plugins: [ | ||
// make sure that the json file gets bundled | ||
json({ | ||
preferConst: true, | ||
}), | ||
resolve({ | ||
resolveOnly: ['package.json'], | ||
}), | ||
commonjs(), | ||
], | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.