-
Notifications
You must be signed in to change notification settings - Fork 10
Add gh-pages notes to readme, and rearrange for a Developer focus. #408
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
Open
cat5inthecradle
wants to merge
3
commits into
main
Choose a base branch
from
darin/readme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,58 @@ We have measured over one million unique [completions](https://twitter.com/codeo | |
|
|
||
|  | ||
|
|
||
| # Development | ||
|
|
||
| ## GitHub Pages Deployment | ||
|
|
||
| The project automatically deploys to GitHub Pages on pushes to `main`. The deployment workflow: | ||
| - Runs tests and builds the project (`yarn test && yarn build`) | ||
| - Copies public assets to dist folder | ||
| - Deploys to `gh-pages` branch using GitHub Actions | ||
| - View the deployed activity at https://code-dot-org.github.io/ml-activities/ | ||
|
|
||
| ## Getting started | ||
|
|
||
| Steps to get up and running: | ||
|
|
||
| ``` | ||
| git clone [email protected]:code-dot-org/ml-activities.git | ||
| cd ml-activities | ||
| nvm install | ||
| nvm use | ||
| npm install -g yarn | ||
| yarn | ||
| yarn start | ||
| ``` | ||
|
|
||
| At this point the app will be running at [http://localhost:8080](http://localhost:8080) with live-reloading on file changes. | ||
|
|
||
| [](https://gitpod.io/#https://github.com/code-dot-org/ml-activities) | ||
|
|
||
| ## Integration with local [code-dot-org repo](https://github.com/code-dot-org/code-dot-org) | ||
|
|
||
| Similar to https://github.com/code-dot-org/dance-party, ml-activities is built from a small repo as an app which is then used by the code.org dashboard to run individual levels in a script. | ||
|
|
||
| If you want to make changes locally in ml-activities and have them show up in your apps build, do the following: | ||
|
|
||
| - In the ml-activities root directory `yarn link` | ||
| - In the code-dot-org apps/ directory `yarn link @code-dot-org/ml-activities` | ||
| This will set up a symlink in apps/node_modules/@code-dot-org to point at your local changes. Run `yarn build` in ml-activities, and then the code-dot-org apps build should pick up the changes (generated in ml-activities' `dist/`) next time it occurs (including in already-running `yarn start` build in code-dot-org). | ||
| - Note that ml-activities' `yarn start` can be left running when `yarn build` is run. But a new invocation of `yarn start` will intentionally clear the `dist/` directory populated by `yarn build` to ensure we don't have outdated assets left in it. | ||
| - If you want to go back to using the published module, in the code-dot-org apps/ directory run `yarn unlink @code-dot-org/ml-activities`. You'll be given additional instructions on how to force the module to be rebuilt after that. | ||
|
|
||
| ## Publishing a new version | ||
|
|
||
| First, ensure you have the `main` branch checked out locally, and that it's up to date. | ||
|
|
||
| To publish a new version, the following command should work: | ||
| ``` | ||
| npm version 0.0.29 | ||
| ``` | ||
| With `0.0.29` replaced by the new version number that should be published. | ||
|
|
||
| Note: make sure you are logged into `npm` first. If not, the command may fail with a misleading `E404` error. You can see if you're logged in with `npm whoami`, and if not logged in, can can use `npm login`. | ||
|
|
||
| # Design notes | ||
|
|
||
| ## Modes | ||
|
|
@@ -141,55 +193,6 @@ The full functionality of this app is enabled when hosted by https://studio.code | |
|
|
||
| If Google Analytics is available on the page, the app generates a synthetic page view for each scene, allowing for an understanding of usage and duration of each scene in the script. | ||
|
|
||
| # Additional information | ||
|
|
||
| ## Common operations | ||
|
|
||
| The documentation for common operations for **AI Lab** is comprehensive and should apply to this project too: https://github.com/code-dot-org/ml-playground#common-operations | ||
|
|
||
|
|
||
| ## Getting started | ||
|
|
||
| Steps to get up and running: | ||
|
|
||
| ``` | ||
| git clone [email protected]:code-dot-org/ml-activities.git | ||
| cd ml-activities | ||
| nvm install | ||
| nvm use | ||
| npm install -g yarn | ||
| yarn | ||
| yarn start | ||
| ``` | ||
|
|
||
| At this point the app will be running at [http://localhost:8080](http://localhost:8080) with live-reloading on file changes. | ||
|
|
||
| [](https://gitpod.io/#https://github.com/code-dot-org/ml-activities) | ||
|
|
||
| ### Integration with local [code-dot-org repo](https://github.com/code-dot-org/code-dot-org) | ||
|
|
||
| Similar to https://github.com/code-dot-org/dance-party, ml-activities is built from a small repo as an app which is then used by the code.org dashboard to run individual levels in a script. | ||
|
|
||
| If you want to make changes locally in ml-activities and have them show up in your apps build, do the following: | ||
|
|
||
| - In the ml-activities root directory `yarn link` | ||
| - In the code-dot-org apps/ directory `yarn link @code-dot-org/ml-activities` | ||
| This will set up a symlink in apps/node_modules/@code-dot-org to point at your local changes. Run `yarn build` in ml-activities, and then the code-dot-org apps build should pick up the changes (generated in ml-activities' `dist/`) next time it occurs (including in already-running `yarn start` build in code-dot-org). | ||
| - Note that ml-activities' `yarn start` can be left running when `yarn build` is run. But a new invocation of `yarn start` will intentionally clear the `dist/` directory populated by `yarn build` to ensure we don't have outdated assets left in it. | ||
| - If you want to go back to using the published module, in the code-dot-org apps/ directory run `yarn unlink @code-dot-org/ml-activities`. You'll be given additional instructions on how to force the module to be rebuilt after that. | ||
|
|
||
| ### Publishing a new version | ||
|
|
||
| First, ensure you have the `main` branch checked out locally, and that it's up to date. | ||
|
|
||
| To publish a new version, the following command should work: | ||
| ``` | ||
| npm version 0.0.29 | ||
| ``` | ||
| With `0.0.29` replaced by the new version number that should be published. | ||
|
|
||
| Note: make sure you are logged into `npm` first. If not, the command may fail with a misleading `E404` error. You can see if you're logged in with `npm whoami`, and if not logged in, can can use `npm login`. | ||
|
|
||
| ## Adding new fish components | ||
| All fish components live in `public/images/fish` in their respective folders (eg bodies live in `body/`). Despite the fact that the fish face right in most of the tutorial, they are built as if they face left in order to simplify the math for the anchor points. This means that all components should be oriented as if the fish is facing left, which might require flopping any new assets. After adding the assets, they will need to be added to `src/utils/fishData.js`. `bin/determineKnnData.js` will output some of the lines that will be needed in `fishData`. | ||
|
|
||
|
|
@@ -203,7 +206,7 @@ Bodies need an anchor point for the body then all of the other components, relat | |
| ### Dorsal fin | ||
| Some dorsal fins define an x-adjustment to shift the anchor point. This is useful for dorsal fins that might look odd is not positioned correctly (eg symmetical). | ||
|
|
||
| ## I18n | ||
| ## Internationalization (I18n) | ||
| By default, this tutorial is in English. The strings live at i18n/oceans.json and should not be moved without corresponding changes to the I18n pipeline in `code-dot-org`. Translations can be passed into the app using the `i18n` param. If any translations are missing, the English string will be used as a default. This also means that adding a new string is safe and does not require any further steps. | ||
|
|
||
| ## Machine Learning algorithms | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.