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

Future - Move all code into a code directory #18759

Merged
merged 48 commits into from
Jul 26, 2022

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Jul 21, 2022

Move all the code in the monorepo to a sub-directory called code.

Why?

We do this because we plan to be able to work on repros inside the monorepo.
We want to be able to quickly spawn a repro-template, link it up with the monorepo packages, and work on it / test it.
This spawned template should not inherit anything from the monorepo other than the packages in the monorepo itself; the instance should be as self-sufficient as can be.

Some examples of what we try to avoid:

  • spawn a vue example in the monorepo, it could find JSX types from @types/react, because it's installed in the monorepo for various things. This can cause major conflicts.
  • spawn a template that is missing a dependency, it could work in the monorepo, because the missing dependency might be present in the monorepo, and thus not warn us of this problem.

So the idea is to move everything code related to code and keep docs, media(should probably move this out?) and scripts in the root.

Right now there is no package.json or node_modules in the root of the project. This is very much intended!
Though, I have to think about how to invoke scripts from the root.

Todo

  • Update documentation on how everything work, where things are.
  • Add a system so commands can be run from the project root. Perhaps: ultra-runner
  • Cleanup dependencies in /scripts and /code, I think there's a lot of overlap here.
  • Cleanup scripts-field in both /scripts and /code, I think /scripts/package.json needs none.
  • Ensure linting works in editors, in both /code and /scripts.
  • ? Move the .yarn to the root to a custom directory, so it's not picked up by default, but can be shared between /scripts and /code.

@ndelangen ndelangen self-assigned this Jul 21, 2022
@ndelangen ndelangen added the maintenance User-facing maintenance tasks label Jul 23, 2022
Base automatically changed from future/base to next July 25, 2022 10:37
@ndelangen ndelangen requested review from tmeasday, yannbf and shilman and removed request for yannbf July 25, 2022 15:04
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

WFM!

# Conflicts:
#	.vscode/launch.json
#	CONTRIBUTING.old.md
#	code/lib/cli/tsconfig.json
#	scripts/tsconfig.json
@ndelangen ndelangen merged commit 441338a into next Jul 26, 2022
@ndelangen ndelangen deleted the future/move-code-into-directory branch July 26, 2022 07:08
@Dschungelabenteuer
Copy link
Member

Dschungelabenteuer commented Jul 27, 2022

Just in case this was not intended, this brings a tiny problem with some links in the Storybook UI:

Some of them explicitly target the next branch, e.g.
image

The above link points at https://github.com/storybookjs/storybook/blob/next/addons/interactions/README.md which is now a broken link since this was merged into the next branch. This very example was fixed by editing the link so that it leads to the Storybook docs. However, since there has not been any release including these link fixes, I still get 404'd :D

Now, if this was not ignored on purpose, is it even important? I mean:

  • People aware of this structure change can handle this and manually fix the URL
  • and others still can make a quick search!

Note
Some of these "hard links" are still used on other repositories of the Storybook organization (e.g. on @storybook/jest)

@ndelangen
Copy link
Member Author

The link should be fixed in the next alpha release.

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

Successfully merging this pull request may close these issues.

3 participants