Skip to content

Commit 22da20e

Browse files
authored
Merge pull request #151 from scenerystack/repo-sync/phet-info/default
🔄 synced file(s) with phetsims/phet-info
2 parents eb0f172 + ef13ede commit 22da20e

3 files changed

Lines changed: 62 additions & 72 deletions

File tree

docs/info-sync/alternative-input-quickstart-guide.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ Follow these steps to add support for alternative input to a simulation.
5555
See https://github.com/phetsims/phet-info/blob/main/doc/interactive-highlights-quickstart-guide.md for more
5656
information about this feature.
5757

58-
4. Sims that support alternative input also need an accessible Preferences dialog. See
59-
https://github.com/phetsims/phet-info/blob/main/doc/accessible-preferences-quickstart-guide.md for information about
60-
this.
61-
6258
## Make a Node focusable
6359

6460
Most common code UI components are already focusable. But you can make any Node focusable by using these options from

docs/info-sync/chipper-deploy.md

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* [Building standalone repositories](https://github.com/phetsims/phet-info/blob/main/deployment-info/chipper-2.0.md#building-standalone-repositories)
88
* [Building wrapper repositories](https://github.com/phetsims/phet-info/blob/main/deployment-info/chipper-2.0.md#building-standalone-repositories)
99
* [Deploying simulations](https://github.com/phetsims/phet-info/blob/main/deployment-info/chipper-2.0.md#deploying-simulations)
10+
* [Running commands in perennial](https://github.com/phetsims/phet-info/blob/main/deployment-info/chipper-2.0.md#running-commands-in-perennial)
1011
* [If working off campus, install the VPN](https://github.com/phetsims/phet-info/blob/main/deployment-info/chipper-2.0.md#if-working-off-campus-install-the-vpn)
1112
* [Configure build-local.json settings](https://github.com/phetsims/phet-info/blob/main/deployment-info/chipper-2.0.md#configure-remote-bashrc)
1213
* [Configure remote ~/.bashrc](https://github.com/phetsims/phet-info/blob/main/deployment-info/chipper-2.0.md#configure-remote-bashrc)
@@ -32,11 +33,6 @@ brands you would like to build by default).
3233
`grunt --brands=phet,phet-io` (using `--brands`) will override and build the desired brands. If any brand given like
3334
this is not supported, the build will fail out.
3435

35-
Chipper 2.0 also adds the `--debugHTML` option to builds (will build another version with the `_debug` suffix), and has
36-
the `-allHTML` option (not relevant for the phet-io brand). Additionally, it is possible to build a sim with a one-off
37-
version identifier with `--oneOff={{ONE_OFF_NAME}}`, which will be included in the version identifier. This is a build
38-
flag, and is not provided to deployment tasks.
39-
4036
# Updating supported brands
4137

4238
In each sim's package.json, it lists the brands that are supported. When a phet-io sim is instrumented, it should be
@@ -49,20 +45,16 @@ Scenery/Kite/Dot/etc. can be built as a standalone file that can be included (e.
4945
examples and documentation). Just `grunt` in the repository should do the trick, and note that there are no brands, so
5046
it does not create brand directories.
5147

52-
# Building wrapper repositories
53-
54-
Repositories like phet-io-wrapper-sonification can also be built with `grunt`, placing the files to be uploaded in the
55-
build directory.
56-
5748
# Deploying simulations
5849

5950
If you haven't run perennial commands in a while, `npm prune` and `npm update` under perennial, perennial-alias and
6051
chipper may be needed. I'll notify for any further module changes.
6152

62-
Note that all perennial commands (including those for dev/rc/production deployments) can be run from newer (as of
63-
sometime December 2017) simulations from the simulation directory. For instance, `grunt checkout-shas` now lives in
64-
perennial, but newer chipper SHAs will detect this and spawn the correct perennial grunt task. It will add
65-
a `--repo={{REPO}}` command line flag to the perennial command so that it knows which repository is the target.
53+
## Running commands in perennial
54+
55+
Note that all perennial commands (including those for dev/rc/production deployments) can be run from the simulation
56+
directory (post 12/2017). For instance, `grunt checkout-shas` now lives in perennial, and so it will add a
57+
`--repo={{REPO}}` command line flag to the perennial command so that it knows which repository is the target.
6658

6759
So, for example,
6860

@@ -76,6 +68,9 @@ will run
7668
perennial# grunt dev --repo=chains --brands=phet,phet-io
7769
```
7870

71+
You can always run these commands from perennial directly by just adding the `--repo={{REPO}}` option. Commands listed
72+
below that do not include the `--repo` option assume you are running from the simulation repo.
73+
7974
## If working off campus, install the VPN
8075

8176
- If you work exclusively on campus, this step is not required.
@@ -84,8 +79,8 @@ perennial# grunt dev --repo=chains --brands=phet,phet-io
8479

8580
## Configure build-local.json settings
8681

87-
Your default build configuration is specified in `~/.phet/build-local.json`. Describing or identifying the entries
88-
in `build-local.json` is beyond the scope of this document; ask a PhET developer for help in setting up this file. At a
82+
Your default build configuration is specified in `~/.phet/build-local.json`. Describing or identifying the entries in
83+
`build-local.json` is beyond the scope of this document; ask a PhET developer for help in setting up this file. At a
8984
minimum you will need `devUsername` and `buildServerAuthorizationCode`. A few handy keys:
9085

9186
- `buildServerNotifyEmail`: add your email to be notified on the success or failure of your builds to the build server.
@@ -124,11 +119,11 @@ Configure an RSA key, or you will be prompted multiple times for a password duri
124119

125120
- Add your public key (found in `localhost@~/.ssh/id_rsa.pub`) to `bayes@~/.ssh/authorized_keys`.
126121
- This can usually be accomplished by running `ssh-copy-id bayes`.
127-
- If you don't have `ssh-copy-id`,
128-
use `cat ~/.ssh/id_rsa.pub | ssh {{IDENTIKEY}}@bayes.colorado.edu "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"`
122+
- If you don't have `ssh-copy-id`, use
123+
`cat ~/.ssh/id_rsa.pub | ssh {{IDENTIKEY}}@bayes.colorado.edu "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"`
129124
- Change the permissions of `authorized_keys` so it is not group writable: `chmod g-w authorized_keys`
130-
- Test ssh from your local machine at least once so that you can accept the remote RSA key from bayes by
131-
running `ssh bayes`.
125+
- Test ssh from your local machine at least once so that you can accept the remote RSA key from bayes by running
126+
`ssh bayes`.
132127

133128
## Dev deployments
134129

@@ -147,33 +142,35 @@ increment the version test number (e.g. the 2 in 1.3-dev.2). For example, if the
147142

148143
## One-off deployments
149144

150-
These are like dev deployments, but should be done from a named branch (where the name does not contain any `-` or `.`
151-
characters).
145+
These are like dev deployments, but are done from a named branch that is not "main" (where the branch name does not
146+
contain any `-` or `.` characters). One-offs are useful to keep track of shas for maintenance or reproducibility, but
147+
are not a formal, versioned release.
152148

153-
Prior to branch creation, be sure to create a GitHub issue within the associated repo. Its title should be of the
154-
form `branch: {{branchName}}`, and the description should describe the purpose of the branch, expected lifetime of the
149+
Prior to branch creation, be sure to create a GitHub issue within the associated repo. Its title should be of the form
150+
`branch: {{branchName}}`, and the description should describe the purpose of the branch, expected lifetime of the
155151
branch, and links to any other relevant issues.
156152

157-
To create a branch (easily) for one-off deployments, run:
153+
To create a branch (easily) for one-off deployments run the following command from the exact SHAs that you want in your
154+
one-off. You may want to run `grunt checkout-target` first to create the one-off from a release branch instead of
155+
`main`.
158156

159157
```sh
160158
grunt create-one-off --branch={{BRANCH}}
161159
```
162160

163-
This will create the branch with the relevant name, and set up the package.json appropriately.
164-
165-
Thus a normal `grunt` will build with the one-off version from the branch. To deploy a one-off version:
161+
This will create the branch with the relevant name, and set up the package.json appropriately. Thus a normal `grunt`
162+
will build with the one-off version from the branch. To deploy a one-off version:
166163

167164
```sh
168-
grunt one-off --brands={{BRANDS}}
165+
grunt one-off --brands={{BRANDS}} --branch={{BRANCH}}
169166
```
170167

171-
from the branch.
168+
This will checkout the branch and its dependencies, and deploy using the "dev" version deployment algorithm.
172169

173170
## RC/production deployments and release branches
174171

175-
Chipper 2.0 release branches support building of all brands. The branch name will ONLY ever be of the
176-
format `{{MAJOR}}.{{MINOR}}`, e.g. `1.7`, and that branch will only support building/deploying versions that match that
172+
Chipper 2.0 release branches support building of all brands. The branch name will ONLY ever be of the format
173+
`{{MAJOR}}.{{MINOR}}`, e.g. `1.7`, and that branch will only support building/deploying versions that match that
177174
major/minor combination.
178175

179176
NOTE: Release branches are created for RCs. If you need to make a change after the first RC (but before publication),
@@ -186,14 +183,13 @@ also deploy an RC (which is typical when creating the release branch), just run
186183
prompt you whether the release branch should be created. For example, if `1.6` was the latest release branch, and you
187184
want to create `1.7` and deploy an RC, just fire off `grunt rc --branch=1.7 --brands={{BRANDS}}`.
188185

189-
If you do not want to deploy an RC when creating the release branch, instead directly
190-
do `grunt create-release --branch=1.7 --brands={{BRANDS}}` (which will handle all steps to create the new branch).
191-
Release branches should be created using either `grunt rc` or `grunt create-release`, as this sets them up with the
192-
correct package.json version and dependencies.json content.
186+
If you do not want to deploy an RC when creating the release branch, instead directly do
187+
`grunt create-release --branch=1.7 --brands={{BRANDS}}` (which will handle all steps to create the new branch). Release
188+
branches should be created using either `grunt rc` or `grunt create-release`, as this sets them up with the correct
189+
package.json version and dependencies.json content.
193190

194-
NOTE: The `--brands` you include in the command will be set as the only supported brands for the release branch in
195-
the `package.json`. NOTE: It will initialize the branch to a version of 1.0.0-rc.0, and then increment/deploy to
196-
1.0.0-rc.1.
191+
NOTE: The `--brands` you include in the command will be set as the only supported brands for the release branch in the
192+
`package.json`. NOTE: It will initialize the branch to a version of 1.0.0-rc.0, and then increment/deploy to 1.0.0-rc.1.
197193

198194
### RC/production deployment on an existing branch
199195

@@ -228,24 +224,24 @@ suite of sims in RC" section in automated-maintenance-process.md.
228224
If you want to make a change to the sim's own repo on the release branch (and no changes to other dependencies), then
229225
generally first do the following:
230226

231-
- From perennial, `grunt checkout-target --repo={{REPO}} --target={{BRANCH}}`,
232-
e.g. `grunt checkout-target --repo=chains --target=1.2`.
233-
- Apply the change to the sim's branch (either a usual commit, or by cherry-picking a change,
234-
e.g. `git cherry-pick -x {{SHA}}` in the sim repo).
227+
- From perennial, `grunt checkout-target --repo={{REPO}} --target={{BRANCH}}`, e.g.
228+
`grunt checkout-target --repo=chains --target=1.2`.
229+
- Apply the change to the sim's branch (either a usual commit, or by cherry-picking a change, e.g.
230+
`git cherry-pick -x {{SHA}}` in the sim repo).
235231
- Test it. You can `grunt` in the sim repo (the `checkout-target` above did the NPM magic for it to work)
236232
- Push the change to the sim branch (e.g. `git push origin 1.2`).
237233

238234
Otherwise if a dependency (e.g. scenery or any "common" repo) needs patching:
239235

240-
- From perennial, `grunt checkout-target --repo={{SIM}} --target={{BRANCH}}`,
241-
e.g. `grunt checkout-target --repo=chains --target=1.2`.
236+
- From perennial, `grunt checkout-target --repo={{SIM}} --target={{BRANCH}}`, e.g.
237+
`grunt checkout-target --repo=chains --target=1.2`.
242238
- Check the common repo to see if it has a branch named `{{SIM}}-{{BRANCH}}`, e.g. does scenery have a branch named
243239
chains-1.2
244240
- If it HAS the branch, ensure that the branch's HEAD commit is the same as the currently-checked-out commit. THEN
245241
checkout the branch (e.g. `git checkout chains-1.2`) in the common repo. If the commits don't match, INVESTIGATE as
246242
something went wrong before. Talk to @jonathanolson?
247-
- If there IS NO branch, create it in the common repo with `git checkout -b {{SIM}}-{{BRANCH}}`,
248-
e.g. `git checkout -b chains-1.2`
243+
- If there IS NO branch, create it in the common repo with `git checkout -b {{SIM}}-{{BRANCH}}`, e.g.
244+
`git checkout -b chains-1.2`
249245
- Apply the change to the dependency's branch (it's almost always a cherry-pick, e.g. `git cherry-pick -x {{SHA}}` in
250246
the common repo).
251247
- Test it. You can `grunt` in the sim repo (the `checkout-target` above did the NPM magic for it to work)

docs/info-sync/simulation-development-overview.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
## Overview
44

55
PhET Interactive Simulations creates free, open source educational simulations in science and math, which you can find
6-
at the PhET website. This document explains PhET’s libraries ([SceneryStack](https://scenerystack.org/), practices and patterns for developing interactive
7-
simulations in HTML5. This document is also available
8-
at https://github.com/phetsims/phet-info/blob/main/doc/phet-development-overview.md. For discussion and feedback, please
9-
visit the [SceneryStack Discussions forum](https://github.com/orgs/scenerystack/discussions).
6+
at the PhET website. PhET Interactive Simulations are created using the [SceneryStack](https://scenerystack.org/) web development libraries. This document explains the internal development process using SceneryStack libraries, and practices and patterns for developing interactive simulations in HTML5.
7+
8+
If you are developing a simulation, but are not working directly with PhET, please refer to the [SceneryStack documentation](https://scenerystack.org/learn/simulation/) for best practices developing simulations using the bundled NPM package.
9+
10+
This document is also available at https://github.com/phetsims/phet-info/blob/main/doc/phet-development-overview.md.
1011

1112

1213
<!--@formatter:off-->
@@ -106,11 +107,8 @@ cd ../${directory of the sim you are working on}
106107
npm install
107108
```
108109

109-
### Transpile TypeScript
110+
### TypeScript
110111

111-
* Change directory to the build tools: `cd chipper/`
112-
* Run the TypeScript transpiler: `grunt transpile --all --live` which starts a process that will auto-transpile
113-
when files change.
114112
* For more details about TypeScript, please
115113
see [PhET's TypeScript Quick Start Guide](https://github.com/phetsims/phet-info/blob/main/doc/typescript-quick-start.md)
116114

@@ -131,11 +129,6 @@ npm install
131129
simulations: http://localhost:8080/example-sim/build/adapted-from-phet/example-sim_en_adapted-from-phet.html (port or
132130
path may depend on your HTTP server configuration)
133131

134-
### Questions
135-
136-
* Questions should be directed to
137-
the [SceneryStack Discussions forum](https://github.com/orgs/scenerystack/discussions).
138-
139132
## Creating a New Sim
140133

141134
After checking out the dependencies and installing grunt-cli in the preceding instructions, you can create your own
@@ -157,11 +150,10 @@ simulation using the template.
157150
`grunt create-sim --repo=NAME --author=AUTHOR`
158151
For instance, if the simulation is going to be named Acceleration Lab and the author is Jane Doe, then you could put:
159152
`grunt create-sim --repo=acceleration-lab --author="Jane Doe"`
160-
6. In your simulation directory, run the transpiler watch process and specify your new repo as a target:
153+
6. In your simulation directory, run the dev-server:
161154
`cd ../acceleration-lab`
162-
`grunt output-js-project --live`
163-
7. Test the created simulation in the browser and make sure it launches. It should be a blank simulation. Write to the
164-
[SceneryStack Discussions forum](https://github.com/orgs/scenerystack/discussions) if you run into problems.
155+
`grunt dev-server`
156+
7. Test the created simulation in the browser and make sure it launches. It should be a blank simulation.
165157

166158
## Building and Testing
167159

@@ -269,10 +261,16 @@ as common dependencies are changed.
269261
The main branch of the PhET simulation and library repositories is constantly under development and not guaranteed to be
270262
stable. It is our intent that the main branch of simulations + libraries will build and run properly, but sometimes the
271263
code goes through intermediate states where errors can be introduced. On the other hand, our published simulations have
272-
been rigorously tested across 18+ platforms and are the most stable option. If you are adapting a PhET simulation, or
273-
would like to access simulation code that corresponds directly to one of our published versions, then you will need to
274-
check out specific SHA revisions in all of the appropriate repositories. Checking out these fixed, tested revisions is
275-
also important when working on a release-candidate branch of a simulation. Here are the instructions:
264+
been rigorously tested across 18+ platforms and are the most stable option.
265+
266+
If you are building a simulation from scratch using [SceneryStack](https://scenerystack.org/learn/overview),
267+
you will only need to worry about potential breaking changes when updating the NPM package to a newer version.
268+
See [SceneryStack Versioning](https://scenerystack.org/community/versioning/) for more information.
269+
270+
If you are adapting a PhET simulation, or would like to access simulation code that corresponds directly to one
271+
of our published versions, then you will need to check out specific SHA revisions in all of the appropriate repositories.
272+
Checking out these fixed, tested revisions is also important when working on a release-candidate branch of a simulation.
273+
Here are the instructions:
276274

277275
1. First, identify the version for which you want to check out the source code, for
278276
example: https://phet.colorado.edu/sims/html/area-builder/latest/area-builder_en.html

0 commit comments

Comments
 (0)