Skip to content

Commit 5361fa9

Browse files
authored
fix: usage instructions for testing, and package.json for publishing (#43)
1 parent d9b5c08 commit 5361fa9

File tree

3 files changed

+47
-20
lines changed

3 files changed

+47
-20
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,35 @@ There is also an [existing keyboard navigation plugin](https://www.npmjs.com/pac
1010
a finalized version of keyboard navigation eventually lives. But for now, this
1111
is where experimentation will be done.
1212

13+
## Testing in your app
14+
15+
### Installation
16+
17+
#### Yarn
18+
19+
```
20+
yarn add @blockly/keyboard-experiment
21+
```
22+
23+
#### npm
24+
25+
```
26+
npm install @blockly/keyboard-experiment --save
27+
```
28+
29+
### Usage
30+
31+
```js
32+
import * as Blockly from 'blockly';
33+
import {KeyboardNavigation} from '@blockly/keyboard-experiment';
34+
// Inject Blockly.
35+
const workspace = Blockly.inject('blocklyDiv', {
36+
toolbox: toolboxCategories,
37+
});
38+
// Initialize plugin.
39+
const keyboardNav = new KeyboardNavigation(workspace);
40+
```
41+
1342
## Contributing
1443

1544
To learn more about contributing to this project, see the [contributing page](https://github.com/google/blockly-keyboard-experimentation/blob/main/CONTRIBUTING.md).

package-lock.json

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222
"blockly-plugin",
2323
"keyboard-experiment"
2424
],
25-
"homepage": "TODO",
25+
"homepage": "https://github.com/google/blockly-keyboard-experimentation#readme",
2626
"bugs": {
27-
"url": "TODO"
27+
"url": "https://github.com/google/blockly-keyboard-experimentation/issues"
2828
},
2929
"repository": {
3030
"type": "git",
31-
"url": "TODO",
32-
"directory": "keyboard-experiment"
31+
"url": "git+https://github.com/google/blockly-keyboard-experimentation.git"
3332
},
3433
"license": "Apache-2.0",
3534
"directories": {
@@ -42,7 +41,7 @@
4241
],
4342
"devDependencies": {
4443
"@blockly/dev-scripts": "^4.0.1",
45-
"@blockly/field-colour": "^5.0.4",
44+
"@blockly/field-colour": "^5.0.7",
4645
"@eslint/eslintrc": "^2.1.2",
4746
"@eslint/js": "^8.49.0",
4847
"@types/p5": "^1.7.6",
@@ -55,6 +54,7 @@
5554
"eslint-plugin-jsdoc": "^46.8.2",
5655
"globals": "^15.4.0",
5756
"html-webpack-plugin": "^5.6.0",
57+
"p5": "^1.10.0",
5858
"prettier": "^3.3.1",
5959
"ts-loader": "^9.5.1",
6060
"typescript": "^5.4.5"
@@ -68,8 +68,5 @@
6868
},
6969
"eslintConfig": {
7070
"extends": "@blockly/eslint-config"
71-
},
72-
"dependencies": {
73-
"p5": "^1.9.4"
7471
}
7572
}

0 commit comments

Comments
 (0)