Agoric / dapp-agoric-basics

This is a simple app for the Agoric smart contract platform.
0 stars 3 forks source link

chore: migrate dapp-offer-up history to dapp-agoric-basics (WIP) #3

Closed dckc closed 7 months ago

dckc commented 7 months ago

I wonder about having this repository subsume https://github.com/Agoric/dapp-offer-up .

For the 4-panel dapp, we can either use a different ui/ directory and more files under contract/... but that doesn't expose the 2 things via yarn create @agoric/dapp .... So perhaps the 4-panel thing should be a separate branch: --dapp-branch offer-up vs --dapp-branch basics.

Meanwhile, dapp-offer-up has a significant issues list and some pending PRs. So renaming it to dapp-agoric-basics is probably better than this approach.

LuqiPan commented 7 months ago

Hey @dckc, following the discussions in the extended docs revamp standup this morning, would it make sense if I just work on polishing this PR and get it merged in?

My planned course of actions:

  1. switch the mentions of offer-up in this repo to agoric-basics
  2. remove the UI code and test for now while the goals for UI are being planned and focus on contract code first
dckc commented 7 months ago

finishing this would be one way to do it, but I don't know that the history adds much value.

I suggest we start this app just like creating your dapp section of Getting Started tells our audience to create theirs:

yarn create @agoric/dapp --dapp-template dapp-offer-up dapp-agoric-basics

remove the UI code and test for now while the goals for UI are being planned and focus on contract code first

I don't object, but I don't see why we would remove it. We'll want tests for the dapp-agoric-basics UI, right?

0xpatrickdev commented 7 months ago

but I don't know that the history adds much value

Agree. Maybe we make this change (or something like it) upstream to provide more info in the initial commit message?

diff --git a/packages/agoric-cli/src/init.js b/packages/agoric-cli/src/init.js
index e2e3a0b51..95c28f095 100644
--- a/packages/agoric-cli/src/init.js
+++ b/packages/agoric-cli/src/init.js
@@ -50,6 +50,9 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
     throw Error('cannot clone');
   }

+  const commitHash = await pspawn('git', ['rev-parse', 'HEAD'], {
+    cwd: DIR,
+  });
   await pspawn('rm', ['-rf', '.git'], { cwd: DIR });
   await pspawn('git', ['init'], { cwd: DIR });

@@ -78,7 +81,11 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
   await pspawn('git', ['add', '.'], { cwd: DIR });
   await pspawn(
     'git',
-    ['commit', '-m', `chore: agoric init ${DIR}\n\nImported from ${dappURL}`],
+    [
+      'commit',
+      '-m',
+      `chore: agoric init ${DIR}\n\nImported from ${dappURL}\nCommit: ${commitHash}`,
+    ],
     {
       cwd: DIR,
     }
dckc commented 7 months ago

That seems like a reasonable enhancement to the agoric cli, but to make use of it in yarn create ... involves waiting for it to get into a release.

Adding more info to the initial commit is a fine idea, and we can do that with git commit --amend and no waiting, right?

dckc commented 7 months ago

btw... the history would be of value if we're actually merging dapp-offer-up and dapp-agoric-basics into one app. But (a) I don't think I have convinced the team on that one, and (b) in that case, it would make more sense to just rename the dapp-offer-up repo.

dckc commented 7 months ago

obsolete in favor of #6