Skip to content

Commit daaa81a

Browse files
authored
Move examples to their own package (#1110)
1 parent 499fda4 commit daaa81a

18 files changed

+72
-19
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ See the READMEs of individual packages for more information.
66
## Packages
77

88
- [roslibjs](./packages/roslib/README.md)
9+
- [roslibjs examples](./packages/roslib-examples/README.md)

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@robot-web-tools/workspace",
2+
"//": "TODO: add a workspace name in the future once we have everything in a consistent namespace like @robot-web-tools/* on npm",
33
"workspaces": [
44
"packages/*"
55
]

packages/roslib-examples/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# roslib-examples
2+
3+
## Running the examples
4+
5+
Run `npm start` to view the examples in your browser.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "roslib-examples",
3+
"version": "2.0.0",
4+
"description": "Example usage of roslibjs",
5+
"keywords": [
6+
"ROS",
7+
"ros",
8+
"roslib",
9+
"roslibjs",
10+
"robot"
11+
],
12+
"homepage": "https://github.com/RobotWebTools/roslibjs#readme",
13+
"bugs": {
14+
"url": "https://github.com/RobotWebTools/roslibjs/issues"
15+
},
16+
"repository": {
17+
"type": "git",
18+
"url": "git+https://github.com/RobotWebTools/roslibjs.git"
19+
},
20+
"license": "BSD-2-Clause",
21+
"author": "Robot Webtools Team <robot-web-tools@googlegroups.com> (https://robotwebtools.github.io)",
22+
"contributors": [
23+
{
24+
"name": "Ezra Brooks",
25+
"email": "ezra@brooks.cx",
26+
"url": "https://github.com/EzraBrooks"
27+
}
28+
],
29+
"scripts": {
30+
"start": "http-server .. -o /roslib-examples/src/index.html"
31+
},
32+
"devDependencies": {
33+
"http-server": "^14.1.1"
34+
},
35+
"dependencies": {
36+
"roslib": "^2.0.0"
37+
}
38+
}

packages/roslib/examples/action_client.html renamed to packages/roslib-examples/src/action_client.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<script src="../importmap.js"></script>
5+
<script src="/roslib/importmap.js"></script>
66

77
<script type="module">
88
import * as ROSLIB from "roslib";

packages/roslib/examples/action_server.html renamed to packages/roslib-examples/src/action_server.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<script src="../importmap.js"></script>
5+
<script src="/roslib/importmap.js"></script>
66

77
<script type="module">
88
import * as ROSLIB from "roslib";
File renamed without changes.

packages/roslib/examples/math.html renamed to packages/roslib-examples/src/math.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<script src="../importmap.js"></script>
5+
<script src="/roslib/importmap.js"></script>
66

77
<script type="module">
88
import * as ROSLIB from "roslib";

packages/roslib/examples/node_simple.ts renamed to packages/roslib-examples/src/node_simple.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

33
// Connecting to ROS
4-
import * as ROSLIB from "../src/RosLib.ts";
4+
import * as ROSLIB from "roslib";
55

66
const ros = new ROSLIB.Ros({
77
url: "ws://localhost:9090",

0 commit comments

Comments
 (0)