Skip to content

Commit

Permalink
Merge pull request #19 from donaldp/release/0.5.0
Browse files Browse the repository at this point in the history
Release/0.5.0
  • Loading branch information
donaldp authored Dec 7, 2022
2 parents 6057b2e + 91b746b commit 4aa52ec
Showing 52 changed files with 4,660 additions and 2,663 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/node_modules
/public
/dist
.env
.env.backup
npm-debug.log
41 changes: 31 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -30,6 +30,12 @@ To start using `imba-shell`, run the following command:
imba-shell
```

To enable TypeScript, you can pass the `--ts` flag:

```bash
imba-shell --ts
```

> Note, you can also use `imbas` instead of `imba-shell`.
### Multiline
@@ -129,7 +135,8 @@ Imba:
```py
import { ImbaRepl } from 'imba-shell'

const repl = new ImbaRepl 'imba> '
# you can also pass "typescript" instead of "imba"
const repl = new ImbaRepl 'imba', 'imba> '

repl.run!
```
@@ -139,7 +146,8 @@ JavaScript:
```js
const { ImbaRepl } = require('imba-shell');

const repl = new ImbaRepl('imba> ');
/** you can also pass "typescript" instead of "imba" */
const repl = new ImbaRepl('imba', 'imba> ');

repl.run();
```
@@ -157,7 +165,7 @@ import { ImbaRepl } from 'imba-shell'
import os from 'os'
import path from 'path'

const repl = new ImbaRepl 'imba> ', path.join(os.homedir!, '.my_repl_history')
const repl = new ImbaRepl 'imba', 'imba> ', path.join(os.homedir!, '.my_repl_history')

repl.run!
```
@@ -169,7 +177,7 @@ const { ImbaRepl } = require('imba-shell');
const os = require('os');
const path = require('path');

const repl = new ImbaRepl('imba> ', path.join(os.homedir(), '.my_repl_history'));
const repl = new ImbaRepl('imba', 'imba> ', path.join(os.homedir(), '.my_repl_history'));

repl.run();
```
@@ -227,12 +235,25 @@ When calling `foo` in the REPL, it will return `bar`.
Todo
-------

- ☑ Code completion.
- ☑ Multiline Editor.
- ☑ Async/Await.
- ☑ Extensible API.
- ☒ Syntax highlighting.
- ☒ Imba Compile Errors.
- [x] Language Support.
- [x] Imba.
- [x] TypeScript.
- [x] Code completion.
- [x] Imba.
- [x] TypeScript.
- [x] Multiline Editor.
- [x] Imba.
- [x] TypeScript.
- [x] Async/Await.
- [x] Imba.
- [x] TypeScript.
- [x] Extensible API.
- [ ] Syntax highlighting.
- [ ] Imba.
- [ ] TypeScript.
- [ ] Compile Errors.
- [ ] Imba.
- [x] TypeScript.

Development
-----
27 changes: 16 additions & 11 deletions bin/repl
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
#!/usr/bin/env node

const { Command, ImbaRepl } = require('../lib');
const { Command, ImbaRepl } = require('../dist');
const imba = require('imba');
const os = require('os');
const path = require('path');

class ReplCommand extends Command {
handle() {
const repl = new ImbaRepl('>>> ', path.join(os.homedir(), '.imba_shell_history'));
/**
* @param {string} language
*/
handle(language) {
const repl = new ImbaRepl(language, '>>> ', path.join(os.homedir(), '.imba_shell_history'));

/** load imba. */
repl.registerCallback((ctx) => {
Object.keys(imba).forEach((key) => {
if (!ctx[key]) {
ctx[key] = imba[key];
}
if (language == 'imba') {
/** load imba. */
repl.registerCallback((ctx) => {
Object.keys(imba).forEach((key) => {
if (!ctx[key]) {
ctx[key] = imba[key];
}
});
});
});
}

repl.shouldUpdate().run({ ignoreUndefined: true });
repl.shouldUpdate().run({ ignoreUndefined: true, useColors: language == 'typescript' });
}
}

2 changes: 1 addition & 1 deletion bin/runtime
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

const { Command } = require('../lib');
const { Command } = require('../dist');

class RuntimeCommand extends Command {
get isRuntime() {
154 changes: 0 additions & 154 deletions lib/Command.js

This file was deleted.

18 changes: 0 additions & 18 deletions lib/ContextHelpers.js

This file was deleted.

5 changes: 0 additions & 5 deletions lib/Error/ImbaMissingException.js

This file was deleted.

68 changes: 0 additions & 68 deletions lib/ImbaCompiler.js

This file was deleted.

Loading

0 comments on commit 4aa52ec

Please sign in to comment.