ericclemmons / polydev

Faster, route-centric development for Node.js apps with built-in Hot Module Replacement.
282 stars 6 forks source link

Switch to Lerna #21

Closed ericclemmons closed 5 years ago

ericclemmons commented 5 years ago

This would resolve #14

ericclemmons commented 5 years ago

https://github.com/lerna/lerna#getting-started

diff --git a/lerna.json b/lerna.json
new file mode 100644
index 0000000..4000003
--- /dev/null
+++ b/lerna.json
@@ -0,0 +1,8 @@
+{
+  "npmClient": "yarn",
+  "packages": [
+    "packages/*"
+  ],
+  "version": "1.2.0",
+  "useWorkspaces": true
+}
diff --git a/package.json b/package.json
index e1c7f43..e705ccb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,7 @@
 {
   "private": true,
   "scripts": {
+    "install": "lerna bootstrap",
     "postinstall": "yarn workspace polydev link",
     "dev": "DEBUG=polydev polydev -r ts-node/register",
     "dev:server": "DEBUG=polydev node server",
@@ -10,5 +11,10 @@
     "start": "NODE_ENV=production polydev",
     "start:server": "NODE_ENV=production node server"
   },
-  "workspaces": ["packages/*"]
+  "workspaces": [
+    "packages/*"
+  ],
+  "devDependencies": {
+    "lerna": "^3.10.7"
+  }
 }
ericclemmons commented 5 years ago

Interesting enough, lerna bootstrap skips recursive execution of yarn install 👍

ericclemmons commented 5 years ago

Adding yarn clean, because I like lerna to be largely an implementation detail.

ericclemmons commented 5 years ago

Trying out https://github.com/lerna/lerna-changelog now:

yarn add lerna-changelog --dev -W
ericclemmons commented 5 years ago

Getting errors with git describe because I have no tags yet.

https://stackoverflow.com/questions/4404172/how-to-tag-an-older-commit-in-git

ericclemmons commented 5 years ago

Babel is good as an example

https://github.com/babel/babel/blob/master/lerna.json

ericclemmons commented 5 years ago

I give up. https://changebot.app/preview/ericclemmons/polydev is much better.

All that's missing is a way of generating it from the CLI or cURLing it.

ericclemmons commented 5 years ago

But still, publishing isn't working how I want it.