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

Saving files locally in both yaml and json format. #904

Merged
merged 15 commits into from
Nov 15, 2024
Merged

Conversation

TayyabAsghar
Copy link
Contributor

Describe your changes

Screenshots [Optional]

Issue ticket number and link

Closes #

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added tests
  • I have added a changeset pnpm changeset add
  • I have added example usage in the kitchen sink app

Copy link

changeset-bot bot commented Nov 11, 2024

🦋 Changeset detected

Latest commit: c6db596

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@ensembleui/js-commons Patch
@ensembleui/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@evshi evshi left a comment

Choose a reason for hiding this comment

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

This is not what we discussed. Please make changes such that:

  1. The global hidden ensemble folder keeps track of which apps exist on the local file system and where to find them, i.e. the paths
  2. The app metadata is stored in the same folder as the YAML sub directories.

Do not flatten the code organization into generic files, e.g. enums, utilities, constants. Keep code organized in vertical modules that correspond to a specific function, e.g. local - node, dto - models, firebase - cloud

packages/js-commons/src/constants.ts Outdated Show resolved Hide resolved
packages/js-commons/src/dto.ts Outdated Show resolved Hide resolved
packages/js-commons/src/enums.ts Outdated Show resolved Hide resolved
packages/js-commons/src/dto.ts Outdated Show resolved Hide resolved
packages/js-commons/src/firebase.ts Outdated Show resolved Hide resolved
packages/js-commons/src/local-files.ts Outdated Show resolved Hide resolved
packages/js-commons/src/transporter.ts Outdated Show resolved Hide resolved
packages/js-commons/src/local-files.ts Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Nov 12, 2024

Visit the preview URL for this PR (updated for commit c6db596):

https://react-kitchen-sink-dev--pr904-tayyab-local-files-926y0bfw.web.app

(expires Fri, 22 Nov 2024 23:23:51 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6267897ade2ba783b6db70a53a60fc3946d625e9

Copy link
Contributor

@evshi evshi left a comment

Choose a reason for hiding this comment

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

Still needs quite a bit of work.

packages/js-commons/src/transporter.ts Outdated Show resolved Hide resolved
packages/js-commons/src/local-files.ts Outdated Show resolved Hide resolved
packages/js-commons/src/local-files.ts Outdated Show resolved Hide resolved

const getYamlFolderPath = async (
appId: string,
yamlFolder: string,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for? Since the app can be anywhere on the local FS I don't see the point of adding another path here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since app can be anywhere on the FS this is the global metadata file to keep track of yaml folder on the fs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then what is the difference between YAMLFolder and GlobalFolder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea was in the future users could update the path of App Yaml files from the web studio if they had moved the app from anywhere. This Yaml Folder path will act as a fallback path if they accidentally remove the Yaml Filepath to save the app data again.

packages/js-commons/src/local-files.ts Outdated Show resolved Hide resolved
@evshi evshi merged commit 0a37d2b into main Nov 15, 2024
3 checks passed
@evshi evshi deleted the tayyab/local-files branch November 15, 2024 23:29
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