-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8530 from Agoric/mfig-create-dapp
feat(create-dapp): `npm create @agoric/dapp ...` uses `agoric init`
- Loading branch information
Showing
13 changed files
with
225 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
}, | ||
"files": [ | ||
"src", | ||
"tools", | ||
"exported.js" | ||
], | ||
"scripts": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
.vagrant | ||
/dapps | ||
|
||
# emacs and vim | ||
*~ | ||
[._]*.sw[a-p] | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
.idea/ | ||
|
||
# dist files | ||
/dist | ||
|
||
# generated integration-test files | ||
integration-test/.cache | ||
integration-test/bundles | ||
integration-test/transform-tests/output | ||
|
||
# generated Sphinx/ReadTheDocs files | ||
/docs/build/ | ||
/demo | ||
t[0-9]* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.vagrant | ||
|
||
# Demo | ||
demo | ||
dapps | ||
|
||
# scripts | ||
scripts | ||
|
||
# test | ||
test | ||
|
||
# Travis CI | ||
.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Create Agoric Dapp | ||
|
||
To make a new Agoric Dapp in the `foo` subdirectory, you can use: | ||
|
||
``` | ||
$ yarn create @agoric/dapp foo | ||
``` | ||
|
||
or: | ||
|
||
``` | ||
$ npm create @agoric/dapp foo | ||
``` | ||
|
||
or: | ||
|
||
``` | ||
$ pnpm create @agoric/dapp foo | ||
``` | ||
|
||
Each of the above commands are shorthand for installing the `agoric` package, then running `agoric init foo`. | ||
|
||
Please see the [Getting Started website](https://agoric.com/documentation/getting-started/) for information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// This file can contain .js-specific Typescript compiler config. | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": [ | ||
"src/**/*.js", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"name": "@agoric/create-dapp", | ||
"version": "0.1.0", | ||
"description": "Create an Agoric Javascript smart contract application", | ||
"type": "module", | ||
"bin": { | ||
"create-dapp": "src/create-dapp.js" | ||
}, | ||
"files": [ | ||
"src" | ||
], | ||
"scripts": { | ||
"build": "exit 0", | ||
"test": "ava", | ||
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js", | ||
"test:xs": "exit 0", | ||
"lint-fix": "yarn lint:eslint --fix", | ||
"lint": "run-s --continue-on-error lint:*", | ||
"lint:types": "tsc -p jsconfig.json", | ||
"lint:eslint": "eslint ." | ||
}, | ||
"devDependencies": { | ||
"ava": "^5.2.0", | ||
"c8": "^7.13.0", | ||
"dd-trace": "^3.3.0" | ||
}, | ||
"dependencies": { | ||
"agoric": "^0.21.2-u12.0" | ||
}, | ||
"keywords": [], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Agoric/agoric-sdk" | ||
}, | ||
"author": "Agoric", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/Agoric/agoric/agoric-sdk" | ||
}, | ||
"homepage": "https://github.com/Agoric/agoric-sdk#readme", | ||
"ava": { | ||
"files": [ | ||
"test/**/test-*.js" | ||
], | ||
"timeout": "2m", | ||
"workerThreads": false | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#! /usr/bin/env node | ||
/* global process */ | ||
import { spawnSync } from 'child_process'; | ||
import { createRequire } from 'module'; | ||
|
||
const require = createRequire(import.meta.url); | ||
|
||
const agoricCli = require.resolve('.bin/agoric'); | ||
|
||
const proc = spawnSync(agoricCli, ['init', ...process.argv.slice(2)], { | ||
stdio: 'inherit', | ||
}); | ||
|
||
if (proc.status === null) { | ||
throw proc.error; | ||
} | ||
process.exit(proc.status); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import test from 'ava'; | ||
import { spawnSync } from 'child_process'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const binname = fileURLToPath( | ||
new URL('../src/create-dapp.js', import.meta.url), | ||
); | ||
|
||
test('sanity', async t => { | ||
await null; | ||
const myMain = args => { | ||
return spawnSync(binname, args, { stdio: 'ignore' }).status; | ||
}; | ||
|
||
t.is(await myMain(['--help']), 0, '--help exits zero'); | ||
t.is(await myMain(['--version']), 0, '--version exits zero'); | ||
t.is(await myMain(['--zorgar']), 1, 'unknown flag fails'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters