r4ai / remark-callout

A remark plugin to add obsidian style callouts to markdown
https://r4ai.github.io/remark-callout/
MIT License
4 stars 1 forks source link

package configuration issues #131

Closed eikowagenknecht closed 1 month ago

eikowagenknecht commented 1 month ago

Something seems funky with the package config (or I'm doing something wrong),

bun run check in main dir

Running bun run check in the main dir leads to currently 15 files of the website directory being reformatted.

image

bun run build in main dir

bun run build also fails for me:

PS C:\Entwicklung\repos\r4ai-remark-callout> bun run build                                                                                                           
$ turbo build
• Packages in scope: @r4ai/remark-callout, nextjs, website
• Running build in 3 packages
• Remote caching disabled
@r4ai/remark-callout:build: cache hit, replaying logs 07209e52ab184a16
@r4ai/remark-callout:build: $ rimraf dist && tsc -p tsconfig.build.json
website:build: cache miss, executing d8e9c4370d2aa4bb
nextjs:build: cache miss, executing 0c5dc5d5e7516d73
website:build: $ astro build
nextjs:build: $ next build
website:build: Error: Cannot find package 'C:\Entwicklung\repos\r4ai-remark-callout\packages\website\node_modules\astro\node_modules\@astrojs\markdown-remark\node_modules\remark-smartypants\node_modules\retext\node_modules\retext-latin\node_modules\parse-latin\node_modules\unist-util-modify-children\package.json' imported from C:\Entwicklung\repos\r4ai-remark-callout\packages\website\node_modules\astro\node_modules\@astrojs\markdown-remark\node_modules\remark-smartypants\node_modules\retext\node_modules\retext-latin\node_modules\parse-latin\lib\plugin\merge-initial-word-symbol.js
website:build: Did you mean to import unist-util-modify-children/index.js?
website:build:     at legacyMainResolve (node:internal/modules/esm/resolve:214:26)
website:build:     at packageResolve (node:internal/modules/esm/resolve:840:14)
website:build:     at moduleResolve (node:internal/modules/esm/resolve:910:20)
website:build:     at defaultResolve (node:internal/modules/esm/resolve:1130:11)
website:build:     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
website:build:     at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
website:build:     at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
website:build:     at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
website:build:     at link (node:internal/modules/esm/module_job:84:36) {
website:build:   code: 'ERR_MODULE_NOT_FOUND'
website:build: }
website:build: error: script "build" exited with code 1
website:build: ERROR: command finished with error: command (C:\Entwicklung\repos\r4ai-remark-callout\packages\website) C:\Users\mail\.bun\bin\bun.exe run build exited (1)
website#build: command (C:\Entwicklung\repos\r4ai-remark-callout\packages\website) C:\Users\mail\.bun\bin\bun.exe run build exited (1)

 Tasks:    1 successful, 3 total
Cached:    1 cached, 3 total
  Time:    517ms
Failed:    website#build

 ERROR  run failed: command  exited (1)
error: script "build" exited with code 1

It also fails when I run bun run build in packages\website, just like bun run dev etc. also fail.

bun run prepare in main dir

Husky now uses husky instead of the deprecated husky install

readme commands

The readme mentions running bun run test --ui, but that seems to not exist:

PS C:\Entwicklung\repos\r4ai-remark-callout> bun run test --ui
$ turbo test --ui
 ERROR  unexpected argument '--ui' found

  tip: to pass '--ui' as a value, use '-- --ui'

Usage: turbo.exe <--cache-dir <CACHE_DIR>|--cache-workers <CACHE_WORKERS>|--concurrency <CONCURRENCY>|--continue|--dry-run [<DRY_RUN>]|--single-package|--force [<FORCE>]|--framework-inference [<BOOL>]|--global-deps <GLOBAL_DEPS>|--graph [<GRAPH>]|--env-mode [<ENV_MODE>]|--filter <FILTER>|--scope <SCOPE>|--ignore <IGNORE>|--since <SINCE>|--include-dependencies|--no-deps|--no-cache|--daemon|--no-daemon|--output-logs <OUTPUT_LOGS>|--log-order <LOG_ORDER>|--only|--parallel|--pkg-inference-root <PKG_INFERENCE_ROOT>|--profile <PROFILE>|--anon-profile <ANON_PROFILE>|--remote-only [<BOOL>]|--remote-cache-read-only [<BOOL>]|--summarize [<SUMMARIZE>]|--log-prefix <LOG_PREFIX>|TASKS|PASS_THROUGH_ARGS|--experimental-space-id <EXPERIMENTAL_SPACE_ID>>

For more information, try '--help'.

error: script "test" exited with code 1
r4ai commented 1 month ago

Below, I will list the solutions for each.

I am a bit busy now, so I might not be able to address this for 1-2 weeks. However, PRs are always welcome.

I apologize for the inconvenience, and thank you for reporting the issues.

eikowagenknecht commented 1 month ago

bun run check

bun run build

r4ai commented 1 month ago
eikowagenknecht commented 1 month ago

Unfortunately for .astro files, currently "only the frontmatter portion of the file is supported."

For my own astro project I go with

  "scripts": {
    "build": "pnpm prebuild && astro check && astro build",
    "format": "prettier --write .",
    "lint": "tsc --noEmit && biome check --write ./src && prettier --write ./src",
  },

  "devDependencies": {
    "@biomejs/biome": "1.8.3",
    "prettier": "3.3.3",
    "prettier-plugin-astro": "0.14.1",
    "prettier-plugin-tailwindcss": "0.6.5",
  }

I have no experience with monorepos, though.

I hope biome can one day replace everything, but it seems that's not ready yet.

r4ai commented 1 month ago

It would be a good idea to use Prettier and Biome for the website, but only use Biome for the packages/remark-callout. This can be achieved by creating check and check:write scripts in each packages, and execute these with Turborepo (similar to how the test script is currently executed).

r4ai commented 1 month ago

I have fixed the issues as described below, so I'll close this issue. If there are any problems, please feel free to mention me.

Thank you for reporting the issues.

eikowagenknecht commented 1 month ago

Thanks. Good choice going with lefthook. I use it for my projects as well.