Skip to content

Commit 6d84069

Browse files
committed
Update rollup config
1 parent 85cb296 commit 6d84069

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ Command line interface to run [jspython](https://github.com/jspython-dev/jspytho
1010

1111
### Run in terminal
1212
```
13-
jspython-cli --file path/to/jspython/file
14-
jspython-cli --file test.jsy
13+
jspython path/to/jspython/file
14+
jspython --file path/to/jspython/file
15+
jspython --file=test.jspy
16+
1517
```
1618

1719
### Development
1820
Run example using node. (Works only if you have `@jspython-dev/jspython-cli` devDependencies in you project)
1921
```
20-
node ./bin/jspython-cli --file=examples/project/axios-test.jspy
21-
node ./bin/jspython-cli --file examples/project/parse.jspy
22-
node ./bin/jspython-cli --file examples/project/p-test.jspy
22+
node ./bin/jspython --file=examples/project/axios-test.jspy
23+
node ./bin/jspython --file examples/project/parse.jspy
2324
```
2425

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "CLI for jspython. Allows you to run jspython (*.jspy) files",
55
"main": "src/index.ts",
66
"bin": {
7-
"JSPython-cli": "bin/JSPython-cli"
7+
"jspython": "bin/jspython"
88
},
99
"scripts": {
1010
"test": "echo \"Error: no test specified\" && exit 1",

rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const pkg = require('./package.json');
55

66
export default {
77
input: pkg.main,
8-
output: { file: pkg.bin['JSPython-cli'], format: 'cjs', sourcemap: true, compact: true, banner: '#!/usr/bin/env node' },
8+
output: { file: pkg.bin['jspython'], format: 'cjs', sourcemap: true, compact: true, banner: '#!/usr/bin/env node' },
99
plugins: [
1010
typescript({
1111
clean: true
@@ -16,5 +16,5 @@ export default {
1616
]
1717
})
1818
],
19-
external: ['arg', 'fs', 'JSPython']
19+
external: ['arg', 'fs', '@jspython-dev/jspython']
2020
};

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import arg from 'arg';
22
import fs from 'fs';
3-
import { jsPython, PackageToImport } from '@jspython-dev/jspython';
3+
import { jsPython, PackageToImport, Interpreter, PackageLoader } from '@jspython-dev/jspython';
44

55
const pkg = require('../package.json');
66

7-
export const interpreter = jsPython();
7+
export const interpreter: Interpreter = jsPython() as Interpreter;
88

99
run();
1010

@@ -15,7 +15,7 @@ async function run() {
1515
}
1616

1717
if (options.file) {
18-
interpreter.registerPackagesLoader(packageLoader);
18+
interpreter.registerPackagesLoader(packageLoader as PackageLoader);
1919
const scripts = fs.readFileSync(options.file, 'utf8');
2020
const res = await interpreter.evaluate(scripts);
2121
console.log('Execution result:\n', res);
@@ -39,7 +39,7 @@ function getOptionsFromArguments(rawArgs: string[]) {
3939
};
4040
}
4141

42-
42+
/**@type {PackageLoader} */
4343
function packageLoader(packages: PackageToImport[]): object {
4444
const libraries: any = {};
4545
packages.forEach(({ name, as, properties }: PackageToImport) => {

0 commit comments

Comments
 (0)