-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29c628f
commit 6d11658
Showing
9 changed files
with
95 additions
and
30 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
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ lib | |
node_modules | ||
tests/tmp | ||
package-lock.json | ||
dist |
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 |
---|---|---|
|
@@ -2,20 +2,27 @@ | |
"name": "@torchlight-api/torchlight-cli", | ||
"version": "0.1.4", | ||
"description": "A CLI for Torchlight - the syntax highlighting API", | ||
"type": "module", | ||
"exports": "./index.js", | ||
"source": "./src/index.js", | ||
"module": "./dist/torchlight-cli.esm.js", | ||
"main": "./dist/torchlight-cli.cjs.js", | ||
"scripts": { | ||
"test": "standard --env jest && jest", | ||
"build": "babel src --out-dir lib --copy-files \"--ignore\" \"src/stubs/**/*\"" | ||
"build": "rollup --config rollup.config.js", | ||
"release:dev": "./bin/release dev", | ||
"release:prod": "./bin/release prod" | ||
}, | ||
"bin": { | ||
"torchlight": "lib/bin/torchlight.js" | ||
"torchlight": "dist/bin/torchlight.cjs.js" | ||
}, | ||
"keywords": [ | ||
"syntax", | ||
"highlighting", | ||
"torchlight" | ||
], | ||
"files": [ | ||
"/dist/*", | ||
"/src/**/*" | ||
], | ||
"author": "Aaron Francis <[email protected]> (https://torchlight.dev)", | ||
"license": "MIT", | ||
"dependencies": { | ||
|
@@ -31,18 +38,19 @@ | |
"md5": "^2.3.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.15.0", | ||
"@babel/cli": "^7.14.8", | ||
"@babel/core": "^7.15.0", | ||
"@babel/node": "^7.12.13", | ||
"@babel/preset-env": "^7.18.2", | ||
"@rollup/plugin-babel": "^5.3.1", | ||
"@rollup/plugin-node-resolve": "^13.3.0", | ||
"babel-jest": "^27.0.6", | ||
"jest": "^27.0.6", | ||
"rollup": "^2.75.6", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"standard": "^16.0.3" | ||
}, | ||
"standard": { | ||
"ignore": [ | ||
"tests", | ||
"lib" | ||
"dist", | ||
"tests" | ||
] | ||
}, | ||
"jest": { | ||
|
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import babel from '@rollup/plugin-babel' | ||
import { terser } from 'rollup-plugin-terser' | ||
|
||
const common = { | ||
external: [ | ||
/node_modules/ | ||
], | ||
plugins: [ | ||
resolve(), | ||
babel({ | ||
babelHelpers: 'bundled' | ||
}) | ||
] | ||
} | ||
|
||
const cjs = { | ||
format: 'cjs', | ||
exports: 'named', | ||
sourcemap: true | ||
} | ||
|
||
const esm = { | ||
...cjs, | ||
format: 'es' | ||
} | ||
|
||
module.exports = [{ | ||
...common, | ||
input: 'src/index.js', | ||
output: [{ | ||
file: 'dist/torchlight-cli.esm.js', | ||
...esm | ||
}, { | ||
file: 'dist/torchlight-cli.esm.min.js', | ||
plugins: [terser()], | ||
...esm | ||
}, { | ||
file: 'dist/torchlight-cli.cjs.js', | ||
...cjs | ||
}, { | ||
file: 'dist/torchlight-cli.cjs.min.js', | ||
plugins: [terser()], | ||
...cjs | ||
}] | ||
}, { | ||
...common, | ||
input: 'src/bin/torchlight.js', | ||
output: [{ | ||
banner: '#! /usr/bin/env node', | ||
file: 'dist/bin/torchlight.cjs.js', | ||
...cjs | ||
}] | ||
}] |
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,3 @@ | ||
#! /usr/bin/env node | ||
import { makeProgram } from '../cli.js' | ||
|
||
makeProgram().parse() |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import torchlight from './torchlight.js' | ||
import Block from './block.js' | ||
|
||
export { | ||
torchlight, | ||
Block | ||
} |
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