Skip to content

Commit 634a6d4

Browse files
author
ShMcK
authored
Merge pull request #2 from ShMcK/feature/treeview
Migrate to xstate as app skeleton
2 parents b402b71 + f8c527e commit 634a6d4

37 files changed

+738
-339
lines changed

.vscode/settings.json

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"source.fixAll": true,
1717
},
1818
"tslint.enable": true,
19-
"tslint.jsEnable": true,
2019
"[javascript]": {
2120
"editor.formatOnSave": true
2221
},

TODO.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Todos
2+
- add to scripts when url fixed
3+
4+
```
5+
"postinstall": "node ./node_modules/vscode/bin/install",
6+
```

package-lock.json

+29-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+12-44
Original file line numberDiff line numberDiff line change
@@ -11,68 +11,36 @@
1111
],
1212
"publisher": "Shawn McKay <[email protected]>",
1313
"activationEvents": [
14-
"onCommand:coderoad.tutorial_load"
14+
"onCommand:coderoad.start"
1515
],
1616
"main": "./out/extension.js",
1717
"contributes": {
1818
"commands": [
1919
{
20-
"command": "coderoad.tutorial_setup",
21-
"title": "Tutorial Setup",
22-
"category": "CodeRoad"
23-
},
24-
{
25-
"command": "coderoad.tutorial_load",
26-
"title": "Load Tutorial",
27-
"category": "CodeRoad"
28-
},
29-
{
30-
"command": "coderoad.test_run",
31-
"title": "Run Test",
32-
"category": "CodeRoad"
33-
},
34-
{
35-
"command": "coderoad.solution_load",
36-
"title": "Load Solution",
20+
"command": "coderoad.start",
21+
"title": "Start",
3722
"category": "CodeRoad"
3823
}
39-
],
40-
"viewsContainers": {
41-
"activitybar": [
42-
{
43-
"id": "coderoad-tutorial",
44-
"title": "CodeRoad Tutorial",
45-
"icon": "resources/icons/icon.svg"
46-
}
47-
]
48-
},
49-
"views": {
50-
"coderoad-tutorial": [
51-
{
52-
"id": "tutorial-summary",
53-
"name": "Summary"
54-
},
55-
{
56-
"id": "tutorial-steps",
57-
"name": "Instructions"
58-
}
59-
]
60-
}
24+
]
6125
},
6226
"scripts": {
6327
"vscode:prepublish": "npm run compile",
28+
"machine": "node ./out/state/index.js",
6429
"compile": "tsc -p ./",
6530
"watch": "tsc -watch -p ./",
6631
"postinstall": "node ./node_modules/vscode/bin/install",
6732
"test": "npm run compile && node ./node_modules/vscode/bin/test"
6833
},
6934
"devDependencies": {
70-
"@types/mocha": "^2.2.42",
71-
"@types/node": "^10.12.21",
35+
"@types/mocha": "^5.2.7",
36+
"@types/node": "^12.0.4",
7237
"prettier": "^1.17.1",
73-
"tslint": "^5.12.1",
38+
"tslint": "^5.17.0",
7439
"tslint-config-prettier": "^1.18.0",
75-
"typescript": "^3.3.1",
40+
"typescript": "^3.5.1",
7641
"vscode": "^1.1.28"
42+
},
43+
"dependencies": {
44+
"xstate": "^4.6.0"
7745
}
7846
}

src/commands/index.ts

-30
This file was deleted.

src/commands/tutorialLoad.ts

-130
This file was deleted.
File renamed without changes.

src/editor/commands/index.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import * as vscode from 'vscode'
2+
import start from './start'
3+
4+
// import runTest from './runTest'
5+
// import loadSolution from './loadSolution'
6+
// import quit from './quit'
7+
8+
const COMMANDS = {
9+
// TUTORIAL_SETUP: 'coderoad.tutorial_setup',
10+
START: 'coderoad.start',
11+
// RUN_TEST: 'coderoad.test_run',
12+
// LOAD_SOLUTION: 'coderoad.solution_load',
13+
// QUIT: 'coderoad.quit',
14+
}
15+
16+
17+
export default (context: vscode.ExtensionContext): void => {
18+
const commands = {
19+
[COMMANDS.START]: async function startCommand(): Promise<void> {
20+
return start(context)
21+
},
22+
// [COMMANDS.RUN_TEST]: runTest,
23+
// [COMMANDS.LOAD_SOLUTION]: loadSolution,
24+
// [COMMANDS.QUIT]: () => quit(context.subscriptions),
25+
}
26+
27+
for (const cmd in commands) {
28+
const command: vscode.Disposable = vscode.commands.registerCommand(cmd, commands[cmd])
29+
context.subscriptions.push(command)
30+
}
31+
}

0 commit comments

Comments
 (0)