Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize #1: {P,}NPM Workspace-ify obsidian-{calendar-plugin, calendar-ui, daily-notes-interface} for saner continuing dev #366

Open
wants to merge 94 commits into
base: master
Choose a base branch
from

Conversation

donaldguy
Copy link

@donaldguy donaldguy commented Jun 15, 2024

I started (i.e. spent all Wednesday night) working with the 2.0-beta stuff but decided to jump back to start with what works (then maybe look to re-base over whats worth keeping).

Note: for now pulled the pin on obsidian back to 0.12.0 (and not further as 0.11.X makes this version of tsc angry)

Herein find 2-4 actual logical changes:

  1. [8f381cf] = git subtree add --prefix=packages/daily-notes-api https://github.com/liamcain/obsidian-daily-notes-interface 97f4c8e47c1dffeed640f2cdc96fe7849edec532 (i.e. v0.9.0 ; .1 - .4 to follow as makes sense)

  2. [b26fb15] = git subtree add --prefix=packages/ui https://github.com/liamcain/obsidian-calendar-ui.git 03ceecbf6d88ef260dadf223ee5e483d98d24ffc (i.e. 0.3.12)

    Both of those could be squashed down if you support premise but not pulling over full histories

  3. [aa3543d] = rip out Yarn v1 in favor of dealer's choice of:

    • NPM > 7.0 (tested w/ 10.8.1)
    • PNPM 9.3.0 ;

    pointedly things which support workspaces of packages. (I started on using Yarn >= 2 (berry) but honestly, I don't see a point unless you have strong Meta-loyalty)

  4. [b9e7c53] = make sufficient to get started1: A) clone repo (into .obsidian/plugins of a vault) & B) npm install (or pnpm install)

    • reconfigure the obsidian-daily-notes-interface build to just use tsc to emit dist/mjs/*.js with corresponding .ts.ds and .ts.d.maps
      • this better satisfies an otherwise angry local-linked build of -ui
      • have the rollup (still) translate that into a mapped but un-typed bundle.cjs set as main for the holdouts, if any
    • put build (and rollup) prepare hooks on the two sub-packages

More commits to follow

Footnotes

  1. generate a working main.js equivalent to current published plugin (1.5.10)

liamcain and others added 27 commits February 19, 2021 22:29
* Also properly parse weekly formats with D{1,4}

* Bump dependencies
… them (liamcain#10)

* Properly check that periodic notes' settings are enabled before using them

* Bump version 0.7.5

* Fix linting
* Use xor when parsing week dates with month day

* Remove test.only
* Fix path join function

* add tests; bump version
* Fix path join function

* fix yarnlock
* Add math to templates

* add default format for math

* Bump version

* Add quarters

* use feature version
* Add math to weekly notes

* bump deps
…ffc'

git-subtree-dir: packages/ui
git-subtree-mainline: ef3f269
git-subtree-split: 03ceecb
…c96fe7849edec532'

git-subtree-dir: packages/daily-notes-api
git-subtree-mainline: b26fb15
git-subtree-split: 97f4c8e
This seems to work same as 1.5.10 [after clone into `.obsidian/plugins` and `npm install` OR `pnpm install` ]

(the final rollup "claims" it doesn't know where to find "obsidian-daily-notes-interface" at the typescript stage; [adding a moduleResolution: node to tsconfig surprisingly no help], but everything ends up in the output main.js)

Note: pins back down to 0.12.0 of obsidian-api
@donaldguy donaldguy changed the title Modernize #1: Workspace-ify obsidian-{calendar-plugin, calendar-ui, daily-notes-interface} for saner continuing dev Modernize #1: {P,}NPM Workspace-ify obsidian-{calendar-plugin, calendar-ui, daily-notes-interface} for saner continuing dev Jun 15, 2024
package.json Outdated
"scripts": {
"lint": "svelte-check && eslint . --ext .ts",
"build": "npm run lint && rollup -c",
"postinstall": "npm run build --workspace=packages/daily-notes-api && npm run build --workspace=packages/ui",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outmoded/removed by next commit in favor of package-local prepares

Comment on lines +24 to +25
"obsidian-calendar-ui": "*",
"obsidian-daily-notes-interface": "*",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm provides the concept of a "workspace:^" pin but as far as I can tell vanilla npm wants you to keep your tracking "normal"; its a matter of style imo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants