RCL App Development Process

Development Workflow

Problem:

Needed changes are identified for an app, but the changes involve both the app and dependencies (RCLs) used by the app.

Solution:

  1. Based on the issue description make up a feature name for the solution. This name will be used to create a “feature” branch in all the affected repos as well as a “solution” folder name locally. The convention for the branch name is the word “feature” followed by one’s initials or moniker, followed by the issue number, followed by a one or two word description, all of which are delimited by dashes. For example, suppose the issue is about tooltips and the issue is #22. Then the branch name might be feature-cn-22-tooltips.

  2. Create a local folder for the solution that matches the branch name. Let’s call this the solution folder.

  3. Clone all the repositories needed into the solution folder.

  4. Create the feature branch in the repos before you make changes:


$ git checkout -b feature-cn-22-tooltips

  1. In the below, italicized steps are not done by developer.

  2. For RCLs:

    • Make changes to code, Styleguidist, etc.

    • Update Cypress tests as needed

    • Commit and push changes

    • Create a PR, which creates a preview for QA

    • Once QA signs off, change pipeline to “in review”

    • Once reviews are completed and all comments resolved, merge code, publish RCL to NPM with new version

    • Delete the feature branch

  3. For App:

    • Source dependent RCLs locally (I don’t know how to do this)

    • Make changes to code

    • Update Cypress tests as needed

    • Commit and push changes

    • Wait for dependencies to be republished

    • Update package.json with new dependency version and update (yarn install)

    • Create a PR, which creates a preview for QA

    • Once QA signs off, change pipeline to “in review”

    • Once reviews are completed and all comments resolved, publish app

    • Delete the feature branch

Using YALC
To install and see help:

$ yarn global add yalc
$ yalc help
yalc [command] [options] [package1 [package2...]]

Commands:
  publish        Publish package in yalc local repo
  installations  Work with installations file: show/clean
  push           Publish package in yalc local repo and push to all
                 installations
  add            Add package from yalc repo to the project
  link           Link package from yalc repo to the project
  update         Update packages from yalc repo
  remove         Remove packages from the project
  retreat        Remove packages from project, but leave in lock file (to be
                 restored later)
  check          Check package.json for yalc packages
  dir            Show yalc system directory

Options:
  --help  Show help                                                    [boolean]

In RCL:

$ yalc publish

NOTE: this command runs prepublishOnly script.

To see where the “local repo” is:

$ yalc dir
C:\Users\mando\AppData\Local\Yalc

To use the locally sourced RCL, go to the app (or other RCL):

$ yalc link markdown-translatable
Package markdown-translatable@1.0.0-rc.1+05065799 linked ==> C:\Users\mando\Projects\bugfix-mandolyte-120-oq-highlight\tc-create-app\node_modules\markdown-translatable.

To confirm linkage:

$ cd node_modules/
$ ls -al | grep markdown-translatable
lrwxrwxrwx 1 mando 197611    100 Jun 26 07:44 markdown-translatable -> /c/Users/mando/Projects/bugfix-mandolyte-120-oq-highlight/tc-create-app/.yalc/markdown-translatable/

Or to see all linked modules: ls -al | grep ^l

Note that the “link” command copies from the “local repo” to a subdirectory “.yalc” in the app folder. Thus, add these two entries to “.gitignore”

/.yalc
yalc.lock

Then yarn start as usual to launch the app. If start is already running, then it will detect the new link sources and recompile.

Workflow

  1. make changes to RCL
  2. yalc publish(this builds and puts the app into the local store)
  3. in using APP or RCL, yalc link yourRclName (this copies from the local store to .yalc and make it linkable in node_modules). Once copied, you can simply use yalc update to update to any published changes.
  4. if yarn start is running it will auto rebuild; otherwise run yarn start

Consider:

  • adding role of person who performs the step
  • adding examples of how to perform the stop (for the rote parts at least); such as:
    • the git command needed
    • the buttons on github to click.
  • rationale or reasoning behind the step

Development Workflow

Problem:

Needed changes are identified for an app, but the changes involve both the app and dependencies (RCLs) used by the app.

Solution:

  1. Based on the issue description make up a feature name for the solution. This name will be used to create a “feature” branch in all the affected repos as well as a “solution” folder name locally. The convention for the branch name is the word “feature” followed by one’s initials or moniker, followed by the issue number, followed by a one or two word description, all of which are delimited by dashes. For example, suppose the issue is about tooltips and the issue is #22. Then the branch name might be feature-cn-22-tooltips.
  2. Create a local folder for the solution that matches the branch name. Let’s call this the solution folder.
  3. Clone all the repositories needed into the solution folder.
  4. Create the feature branch in the repos before you make changes:
$ git checkout -b feature-cn-22-tooltips

In the below, italicized steps are not done by developer.

  1. For RCLs:

    • Make changes to code, Styleguidist, etc.
    • Update Cypress tests as needed
    • Commit and push changes
    • Create a PR, which creates a preview, courtesy of netlify
    • Connect the issue with the PR (inside the PR issue)
    • The PR will be in the “in review” lane of Zenhub
    • Once reviewed and resolved, the PR will be moved to the QA RCL lane
    • Once reviews are completed and all comments resolved, merge code to master branch, publish RCL to NPM with new version
    • Delete the feature branch – this may happen automatically??
  2. For App:

    • Source RCLs locally using the package yalc (see info below).
    • Make changes to code
    • Update Cypress tests as needed
    • Wait for dependent RCLs to be re-published
    • Update package.json with new version of dependencies if needed (from above RCLs)
    • Commit and push changes to the feature/bugfix branch (similar to above)
    • Create PR and connect to issue
    • This will generate a “preview” link, courtesy of netlify
    • It will now be in the “in review” lane of Zenhub
    • After review is completed/resolved, move to PR to “QA integration” lane in Zenhub
    • Once reviews are completed and all comments resolved, publish app
    • Delete the feature branch

That’s an interesting topic. I just read this article by Cleveroad about app development process, and I think it explains very well all the details. Check it out.