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

[DRAFT] experiment to move source files in client to "src" folder #1408

Closed
wants to merge 12 commits into from

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Jul 29, 2020

Issue #, if available:
Attempt to fix #1306

Description of changes:
experiment to move source files in client to "src" folder

If tried in future, following shell script commands would be helpful (to run from clients and protocol_tests folders):

ls -d */ | xargs -I {} bash -c "cd '{}' && mkdir src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv commands src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv protocols src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv models src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv *.ts src"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/runtimeConfig\./src\/runtimeConfig./g' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i '/\"remove-js\"/d' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i '/\"remove-maps\"/d' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/ && npm run remove-js && npm run remove-maps//g' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/\"outDir\"/\"rootDir\": \"src\",\\n    \"outDir\"/g' tsconfig.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/.\/package/..\/package/g' src/runtimeConfig*.ts"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i '1s/^/\/\/ @ts-ignore\n/' src/runtimeConfig.ts"

Left WIP after finding out solution to 'package.json' is not under 'rootDir' in https://stackoverflow.com/questions/55753163 which would add more TSConfig files.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

trivikr added 12 commits July 29, 2020 20:41
ls -d */ | xargs -I {} bash -c "cd '{}' && mkdir src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv commands src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv protocols src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv models src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv *.ts src"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/runtimeConfig\./src\/runtimeConfig./g' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i '/\"remove-js\"/d' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i '/\"remove-maps\"/d' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/ && npm run remove-js && npm run remove-maps//g' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/\"outDir\"/\"rootDir\": \"src\",\\n    \"outDir\"/g' tsconfig.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/.\/package/..\/package/g' src/runtimeConfig*.ts"
'rootDir' is expected to contain all source files.
ls -d */ | xargs -I {} bash -c "cd '{}' && mkdir src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv commands src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv protocols src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv models src"
ls -d */ | xargs -I {} bash -c "cd '{}' && mv *.ts src"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/runtimeConfig\./src\/runtimeConfig./g' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i '/\"remove-js\"/d' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i '/\"remove-maps\"/d' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/ && npm run remove-js && npm run remove-maps//g' package.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/\"outDir\"/\"rootDir\": \"src\",\\n    \"outDir\"/g' tsconfig.json"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i 's/.\/package/..\/package/g' src/runtimeConfig*.ts"
ls -d */ | xargs -I {} bash -c "cd '{}' && sed -i '1s/^/\/\/ @ts-ignore\n/' src/runtimeConfig.ts"
@trivikr trivikr marked this pull request as draft July 29, 2020 22:46
@trivikr trivikr closed this Jul 29, 2020
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2021
@trivikr trivikr deleted the clients-src-folder branch August 26, 2022 02:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move source files to "src" folder in clients
1 participant