feat: use workspace to manager projects#11
Conversation
930812c to
02b2fa2
Compare
|
oh lol I was just pulling the branch when you force-pushed. lmk when you think you're done making changes and I'll take a look. Thanks for making this update! I'm being too lazy 😭 fyi don't worry too much about any failing check; probably need to update action to denoland/setup-deno@v2; I can verify manually, and then I'll play around with fixing the gh action and make a release. |
02b2fa2 to
492c87d
Compare
492c87d to
8953dc4
Compare
8e5df09 to
652be13
Compare
all is done.. but seems there is a problem, that main.ts won't work with the workspace.. seems this pr should change to draft.. I will investigate more.. |
|
seems the workspace system in deno is such a drama.. only with the deno.json, esbuild won't know what it is relaying on.. |
|
I will ask the people of deno first then I can know how to fix this thing |
|
Ohhhhhhhhhh I remember this actually; the latest deno esbuild plugin doesn't support workspaces properly I think. I am currently using a different plugin with another project, but it's not public. mmmmm lemme try and summarize 1 sec |
|
https://github.com/twosaturdayscode/esbuild-deno-plugin My other project looks something like this (intentionally using esbuild 0.24.x, just because 0.25 makes changes that break import type { Format } from 'npm:esbuild@^0.24.2'
import * as esbuild from 'npm:esbuild@^0.24.2'
import { denoPlugins } from 'jsr:@duesabati/esbuild-deno-plugin@^0.2.6'
import { solidPlugin } from 'esbuild-plugin-solid'
import { resolve } from '@std/path'
const [denoResolver, denoLoader] = [...denoPlugins({
configPath: resolve('../deno.json'),
})]
const options: esbuild.BuildOptions = {
plugins: [],
entryPoints: [{ in: './index.tsx', out: './index' }],
outdir: './dist',
bundle: true,
platform: 'browser',
format: 'esm' as Format,
treeShaking: true,
}
options.plugins = [
denoResolver,
solidPlugin({ solid: { moduleName: 'npm:solid-js/web' } }),
denoLoader,
]
const ctx = await esbuild.context(options)
const { host, port } = await ctx.serve({
fallback: './index.html',
host: '127.0.0.1',
port: 2200,
servedir: './',
})
console.log(`Serving at http://${host}:${port}`) |
but problem is that when we inside the folder of subproject , there is no place to mark they are using workspace.. I do not know how deno do that thing... But if we just pass the deno.json of subproject to esbuild , it won't know that it is a subproject I think.. so seems it is a hard thing.. |
|
I think probably the directory structure ends up look like this, where |
|
Ohhhhhh wait I see what you mean; because we're exporting the build script, workspace context breaks. hmmmm maybe using workspaces right now is kinda borked for that specific usecase. I wonder if we could have user pass reference to |
but seems it does not work.. even it reads the top deno.jsonc, it cannot know the lib path |
f77d5e2 to
0a257a5
Compare
|
Hmmm gonna go to sleep now, but if you haven't figured it out, I'll take a look in a day or two when I find some free time. To clarify, though, it looks like this pr is just implementing workspaces into bext, but I'm guessing the reason for the pr is that the build script isn't working when bext is integrated into a deno workspaces project (ala one bext-run project, and another sibling library)? Or is that something separate that is not explored here? |
|
Added in #12. Thanks for your help! |
No description provided.