Skip to content

Commit f5606fb

Browse files
committed
feat(index): first cut
1 parent 1f6aecd commit f5606fb

9 files changed

+2115
-33
lines changed

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# New Repo
1+
# Bundle Source
22

3-
This repository should be a compilation of everything that a new
4-
Agoric repo should have, including ESLint settings, prettier settings,
5-
package.json dependencies and scripts, licenses, sample tests, CircleCI config, and
6-
VSCode testing config.
3+
This package creates source bundles from ES Modules, compatible with Agoric contracts and SwingSet vats.
74

8-
See [SETUP-DELETEME](SETUP-DELETEME.md) for starting steps.
5+
To bundle your sources:
6+
7+
```js
8+
import makeSourceBundle from '@agoric/bundle-source';
9+
10+
const { moduleFormat, source, sourceMap } = bundleSource(`${__dirname}/../path/to/toplevel`);
11+
```

demo/dir1/encourage.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const message = `You're great!`;
2+
export const encourage = nick => `Hey ${nick}! ${message}`;

demo/dir1/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import harden from '@agoric/harden';
2+
import { encourage } from './encourage';
3+
4+
export default function makeEncourager() {
5+
return harden({
6+
encourage,
7+
});
8+
};

0 commit comments

Comments
 (0)