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

[FIX] frontend commands updated to start with 'yarn' #8083

Closed
wants to merge 1 commit into from

Conversation

Hitarthsheth07
Copy link
Contributor

FIX #8082

@FelixMalfait
Copy link
Member

Good feedback thanks for taking the time to contribute!
We actually recommend npx nx and not yarn nx, would you ming updating?
Also you could add: npx nx graphql:generate twenty-front --configuration=metadata which is also useful

Also in backend commands, would you mind adding something like this?

Migrations

For objects in Core/Metadata schemas (TypeORM)

npx nx typeorm twenty-server  -- migration:generate src/database/typeorm/metadata/migrations/nameOfYourMigration -d src/database/typeorm/metadata/metadata.datasource.ts # replace by core data source if necessary

For Workspace objects (TwentyORM)

There are no migrations files, migration are generated automatically for each workspace, stored in the database, and applied with this command

yarn command:prod workspace:sync-metadata -f

Note for you / not to be added: yes we use yarn for this one because it's used in the prod environment where there are no dev dependencies / no npx

Thanks a lot!

@Hitarthsheth07
Copy link
Contributor Author

Hitarthsheth07 commented Oct 26, 2024

Good feedback thanks for taking the time to contribute!

We actually recommend npx nx and not yarn nx, would you ming updating?

Also you could add: npx nx graphql:generate twenty-front --configuration=metadata which is also useful

Also in backend commands, would you mind adding something like this?

Migrations

For objects in Core/Metadata schemas (TypeORM)


npx nx typeorm twenty-server  -- migration:generate src/database/typeorm/metadata/migrations/nameOfYourMigration -d src/database/typeorm/metadata/metadata.datasource.ts # replace by core data source if necessary



For Workspace objects (TwentyORM)

There are no migrations files, migration are generated automatically for each workspace, stored in the database, and applied with this command


yarn command:prod workspace:sync-metadata -f

Note for you / not to be added: yes we use yarn for this one because it's used in the prod environment where there are no dev dependencies / no npx

Thanks a lot!

Sure would absolutely do that.

Also, there is a problem in windows wsl local setup that doesn't reflects the code changes while working on them.

I am working on that will create a PR here once that solved. As

@FelixMalfait
Copy link
Member

Thank you @Hitarthsheth07!

@Hitarthsheth07
Copy link
Contributor Author

Hitarthsheth07 commented Oct 28, 2024

Thank you @Hitarthsheth07!

Heyy @FelixMalfait

Do you think we should add a note/step in windows(WSL) setup that you have to clone when inside wsl and in the /home directory (adding the repo in other dir may give error while installing node modules).

I cloned the project on windows and setup redis, postgres on linux. It still works but takes 10-15 mims just to boot up and updates in code are not reflected.

The command to initiate postgres DB:

psql postgres -c "CREATE DATABASE "default";" -c "CREATE DATABASE test;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;"

You need to run this as a 'postgres' user

sudo -u postgres psql -c "CREATE DATABASE "default";" -c "CREATE DATABASE test;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;

Or else it gives error in WSL.

@FelixMalfait
Copy link
Member

@Hitarthsheth07 yes that makes sense, please also add it to the Linux tab. Thanks!

Sorry for the slow loading time, not sure we can fix that easily. We are using Mac in the core team and it boots in a few seconds :/

@charlesBochet
Copy link
Member

I would actually recommend the following format:
npx nx run {project}:{command} --parameter

For instance: npx nx run twenty-server:workspace:sync-metadata -f. I don't remember exactly but there was non working edge case with npx nx workpace:sync-metadata twenty-server -f

@Hitarthsheth07
Copy link
Contributor Author

I would actually recommend the following format: npx nx run {project}:{command} --parameter

For instance: npx nx run twenty-server:workspace:sync-metadata -f. I don't remember exactly but there was non working edge case with npx nx workpace:sync-metadata twenty-server -f

Which command should be changed to this format. Are you referring to yarn command:prod workspace:sync-metadata -f

So as per your given format it would be
yarn twenty-server command:prod workspace:sync-metadata -f is that correct?

@FelixMalfait
Copy link
Member

Closing this one since you opened #8161 (ideally you can stay on the same PR, no need to open a new one thanks!)

@Hitarthsheth07 Hitarthsheth07 deleted the patch-1 branch October 31, 2024 22:39
@BOHEUS BOHEUS mentioned this pull request Nov 2, 2024
FelixMalfait pushed a commit that referenced this pull request Nov 3, 2024
Related to #8082

Created this PR on purpose after both #8083 and #8161 were closed and
respective branches were deleted by the author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frontend commands must start with 'yarn' instead of 'nx'
3 participants