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

[cli] merge all pull file creation into one path #544

Merged
merged 4 commits into from
Nov 26, 2024
Merged

[cli] merge all pull file creation into one path #544

merged 4 commits into from
Nov 26, 2024

Conversation

stopachka
Copy link
Contributor

@stopachka stopachka commented Nov 26, 2024

Context

Previously, we had a separate flow, where if you used init and chose to create an app, we would make some empty files for you.

However, those files had a few issues:

  1. The default state was filled with data that wasn't actually in the production app. This felt a bit confusing
  2. There wasn't much explanation. For example, the rules file just had some example rules, but nothing more

We also had unique behavior when pulling an app:

  1. If there were no perms in an app, we would not create a perms file

This PR

Now, whether you 'create' an app or not, we will go through the same pull flow.

In this new pull flow, we detect:

  1. If the schema does not have any entities defined, we add a comment explaining what they are
  2. If the schema does not have links defined, we add a comment explaining what they are
  3. If the perms are empty, we still make a perms file, but add a little description

Coming up

I still have more to do, to make these files look better (i.schema instead of graph for schema, intellisense for perms, comparing previous files). But, we'll get to it soon 🔥


CleanShot 2024-11-25 at 17 03 50@2x CleanShot 2024-11-25 at 17 04 07@2x CleanShot 2024-11-25 at 17 04 21@2x

@dwwoelfel @nezaj

Copy link

View Vercel preview at instant-www-js-pret2-jsv.vercel.app.

@stopachka stopachka changed the title [cli] remove handleCreatedApp [cli] merge all pull file creation into one path Nov 26, 2024
@@ -564,29 +567,32 @@ async function promptImportAppOrCreateApp() {
if (!ok) return { ok: false };
return await promptCreateApp();
}

apps.sort((a, b) => +new Date(b.created_at) - +new Date(a.created_at));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small change, so including here:

Sorting apps by created at desc, so your newly created apps show first

Copy link
Contributor

@dwwoelfel dwwoelfel left a comment

Choose a reason for hiding this comment

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

Much improved!

@stopachka stopachka merged commit cdf6300 into main Nov 26, 2024
26 checks passed
@stopachka stopachka deleted the pret2 branch November 26, 2024 03:13
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.

2 participants