Studio replacing Lab

I’m confused (and somewhat frustrated). Since the codeberg+gitpod is still a problem, I figured I should move everything I have developed so far for devon to a fresh branch in a fresh fork on github. Did that, added the devon design back in, copied all the source files in it.
Tried to start the lab. Ah, there is no more lab. Okay, studio it is. run npx @freesewing/studio, followed by cd /workspace/freesewing/studio and npm run start. Some time later, and I have studio on port 3000. But no devon design. I can do npm run add, but that just gives me a new devon in a different folder, with only a box.

How am I supposed to develop? How can I see what I’m developing? What am I doing wrong?

Going by what Joost previously wrote:

For people who like to work in our monorepo. You can not currently run a studio instance from the monorepo. But it is on my todo list…

I think it means that that current workflow would be:

  1. Start the standalone npx @freesewing/studio environment,
  2. Add a new Devon design in it,
  3. Copy your previously-existing Devon files into the new Devon folder, and
  4. Continue your design and coding work in the standalone environment.

Eventually, after the design work is finished, you would need to copy back the Devon files back into your repository to do the Codeberg PR.

Also, I haven’t yet updated to v4, but have you tried yarn org (or npx org) to run the whole freesewing.org environment? Is that no longer working in v4?

That was the late-v3 way to develop in the monorepo. I’m not sure if it’s still valid in v4.

I did run the whole org, but I didn’t see the devon design anywhere. But I also didn’t try to just reference it on the url.

Perhaps yarn new or yarn reconfigure needs to be run to get the correct files created/edited?

To add a design to org, you need to do some manual changes. This is currently not well documented/automated.

You could look at the changes in my Sabrina pr to find them, but if you’re stuck I think I could also try to list them. Add Sabrina, a sports bra pattern · 7d0d732463 - freesewing/freesewing - Codeberg.org

Adding a new design to the studio is easy, but I think all the recent fixes aren’t in the studio yet. So the inspect view and so on are all kinda broken. I can’t really recommend using it yet.

I apologize for the frustration Wouter, which is entirely on me.

The stand-alone setup with the new studio is working fine. But, you would have to manually copy iver your files to contribute them.

Inside the monorepo, you can run the entire org site, but it would take some manual fiddling to ensure the design shows up.

A frictionless way to work inside the monorepo on a new design is not currently available. I will bump it in my priority list now that I know it’s causing grief for you.

In the meanwhile, if you want to work on a fork with v3 code, that’s ok. I will help bringing it into v4 as there are no rea changes for designs, only some differences in how we handle metadata.

I can work with the new design in the ‘extra’ folder. It was just confusing because it seemed to disrupt the flow towards a merge into the mono.

Apparently, the fork I made from the main branch on GitHub has some issues. I can’t select individual parts. So I’ll just keep working in my old branch.

The recent fixes (like for selecting parts and the inspect view) are all in the develop branch. So you should prefer that over the older main branch, at least until things stabilize. Using your old branch is of course also okay.

I have to pick whatever is available on GitHub, since my development environment (gitpod) doesn’t seem to support codeberg. So I’m stuck with developing in v3 for now.

I have no experience with GitPod or alternatives, but if you have a git client somewhere, you could pull the current codeberg main branch locally, push it to GitHub and then continue to work on GitHub with the up-to-date code. (And to publish the finished code to Codeberg, you would do the reverse.)

But maybe we could do alternatives, like set up a public github or gitlab mirror of the repository.

I think the real solution is for me to find an alternative development environment. Gitpod was very convenient, but I can connect it to codeberg. It allowed me to be completely device independent, and just press a button on a webpage, and in some minutes my local vscode would pop up where I left it. A simple yarn lab and I’m off.

I have a little update on this: I have integrated studio in our monorepo. You can run it there with:

npm run studio

That is in the root folder. If you are in sites/studio run:

npm run start

like any site. (note that you need to have at least once run npm run kickstart)

This studio setup is mostly — but not entirely — equivalent to the stand alone environment.
The main difference is how we manage the add new design flow.

In the stand-along studio, new designs get added to the local studio, and it combines all designs from the FreeSewing collection as well as your local designs.

In the monorepo, adding a new design adds it to the collection, and there is no concept of your own local designs.

Please note that under the hood, there’s a bunch of changes. We no longer use config/software and instead rely on the designs’ about.json file. The collection package, the useDesign hook, and all other files that need to are also now auto-generated by npm run reconfigure. Auto-generated files are also kept out of the repo.

The npm run add script can also be used to add a new plugin.

Give that there’s a bunch of change, there may very well be rough edges. I also have no idea how this will behave on windows, and zero interest in finding out. But I welcome all feedback.

@wouter.vdub Having never used GitPod myself, I assumed it would just work because it is all git under the hood. Seems they do not support it, so that’s unfortunate.

I asked around a bit, and it seems this could be an alternative: https://coder.com/

I’m a little spread thin right now to look into it, but if you feel inclined, I would like to know whether this could be something that would bring you back to development nirvana.

Given that it is open source, we could potentially run our own FreeSewing instance. Perhaps not for everyone (because we’re not made of money) but you could certainly be one of the users.

2 Likes

There was probably an unintended change with the studio changes: #280 - [bug]: Recent studio changes broke pattern plugins - freesewing/freesewing - Codeberg.org

This broke your svg-attr plugin fix again, for example, since the plugin is now missing a name and won’t be loaded because of that. It also broke my path-utils-plugin.

Thanks!

I’ll have a look at coder. I’m also looking at the new version of gitpod, for which I first had to start an AWS subscription. Like you, a bit strapped for time now, but I will report later.

Thanks for the change in studio!

I’m thinking of using the terms “standalone studio development environment” and “monorepo studio development environment” in our documentation. Or, perhaps “standalone development studio” and “monorepo development studio”. Or, perhaps with the word “repository” instead of “monorepo”.

Edit: added: Or, perhaps “standalone studio” and “in-repository studio” or “repository-based studio”.

@jonathan_haas I’ve fixed the plugin issue. Sorry about that, I’m deploying it now. Good reminder we should setup CI again to run some tests since I clearly can’t be trusted to do it myself :wink:

@Benjamin_F Can we just use studio and provide context? Like, most of the time it doesn’t really matter does it? Only when choosing which way to go.
Not to second guess you, just thinking out loud :slight_smile:

@wouter.vdub FYI: I did setup a machine to hook into that new Gitpod thing, but still couldn’t see way forward to get that to work with codeberg.

1 Like

@joost I’ll try to use the “studio” terminology, adding an initial definition to explain that the studio is our development environment.

Regarding removing the “standalone” and “repository” wording, it all depends on how similar the studio experience is running npx @freesewing/studio vs. cd sites/studio && npm run start. (I haven’t tried either yet.) The tutorials were written at a time when npx @freesewing/new-design provided a significantly different experience compared to yarn lab, and different wording was used to make each experience clearer. If the studio experience is essentially the same standalone vs. via-repository then the extra wording might not be needed.

After running npm run kickstart and cd sites/studio && npm run start, I’m getting 34 compilation errors. Each error is a module parse error in a different file, similar to:

ERROR in ./node_modules/@freesewing/react/components/Account/Apikeys.mjs 95:8
Module parse failed: Unexpected token (95:8)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|       setLoadingStatus([
|         true,
>         <LoadingProgress val={i} max={count} msg="Removing API keys" key="linter" />,
|       ])
|     }