Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
chore(main): switch over to main
Browse files Browse the repository at this point in the history
  • Loading branch information
James Singleton authored and JamesSingleton committed Sep 29, 2020
1 parent 9abc1c4 commit 1e63b32
Show file tree
Hide file tree
Showing 23 changed files with 76 additions and 79 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/integrations_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: One App Integration Tests
on:
push:
branches:
- master
- main
- prepare-release
jobs:
one-app-integration:
Expand Down Expand Up @@ -54,5 +54,3 @@ jobs:
run: heroku container:release web -a ${{ secrets.HEROKU_APP_ID }}
- name: Run Integration Tests on Heroku
run: ONE_DANGEROUSLY_SKIP_ONE_APP_IMAGE_BUILD=true npm run test:integration -- --remote-one-app-environment=${{ secrets.HEROKU_APP_URL }}


2 changes: 1 addition & 1 deletion .github/workflows/pull_request_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
body: 'This is an auto-generated pull request for One App release changes. Please review this PR and merge it for a release to be initiated. Please close this PR to stop a release from being initiated.'
labels: release,automated pr,skip-release-drafter
branch: prepare-release
base: master
base: main
2 changes: 1 addition & 1 deletion .github/workflows/release_drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release Drafter
on:
push:
branches:
- master
- main

jobs:
update_release_draft:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tagging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
types:
- closed
branches:
- master
- main
jobs:
tagging-release:
name: Tagging release
runs-on: ubuntu-latest
if: github.event.pull_request.merged && github.head_ref == 'prepare-release' && github.base_ref == 'master'
if: github.event.pull_request.merged && github.head_ref == 'prepare-release' && github.base_ref == 'main'
steps:
- uses: actions/checkout@v2
- name: get commit message
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ To auto fix eslint rule failures that are autofixable run `npm run test:lint --

### Opening the PR

* [Fork the One App repository](https://github.com/americanexpress/one-app/fork), open a PR to `master`, and follow the guidelines outlined in this document.
* [Fork the One App repository](https://github.com/americanexpress/one-app/fork), open a PR to `main`, and follow the guidelines outlined in this document.

### Pull Request Guidelines

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[one-app-bundler]: https://github.com/americanexpress/one-app-cli/tree/master/packages/one-app-bundler
[one-app-bundler]: https://github.com/americanexpress/one-app-cli/tree/main/packages/one-app-bundler
[React]: http://reactjs.org/

<h1 align="center">
<img src='https://github.com/americanexpress/one-app/raw/master/one-app.png' alt="One App - One Amex" width='50%'/>
<img src='https://github.com/americanexpress/one-app/raw/main/one-app.png' alt="One App - One Amex" width='50%'/>
</h1>

![One App Docker Release](https://github.com/americanexpress/one-app/workflows/One%20App%20Docker%20Release/badge.svg)
Expand Down Expand Up @@ -47,7 +47,7 @@ Want to get paid for your contributions to `one-app`?

### Quick Start

#### Build a Module with [generator-one-app-module](https://github.com/americanexpress/one-app-cli/tree/master/packages/generator-one-app-module)
#### Build a Module with [generator-one-app-module](https://github.com/americanexpress/one-app-cli/tree/main/packages/generator-one-app-module)

The easiest way to do this is via [`npx`](https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner) (comes with `npm` versions 5.2.0 and above). Run the following command in the directory you want your module to live:

Expand All @@ -56,7 +56,7 @@ export NODE_ENV=development
npx -p yo -p @americanexpress/generator-one-app-module -- yo @americanexpress/one-app-module
```

This will use the [One App Module Generator](https://github.com/americanexpress/one-app-cli/tree/master/packages/generator-one-app-module) to generate a basic One App module.
This will use the [One App Module Generator](https://github.com/americanexpress/one-app-cli/tree/main/packages/generator-one-app-module) to generate a basic One App module.

#### Clone and Install One App

Expand Down Expand Up @@ -120,11 +120,11 @@ It is possible for your application to consist of only the root module, however

For a module to act as the root module the only requirements are:

- Returns a React component bundled with [one-app-bundler](https://github.com/americanexpress/one-app-cli/tree/master/packages/one-app-bundler).
- Returns a React component bundled with [one-app-bundler](https://github.com/americanexpress/one-app-cli/tree/main/packages/one-app-bundler).
- Provides a valid [content security policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) though the [appConfig](./docs/api/modules/App-Configuration.md) static.

**📘 More Information**
* Root Module example: [frank-lloyd-root](https://github.com/americanexpress/one-app/blob/master/prod-sample/sample-modules/frank-lloyd-root/0.0.0/src/components/FrankLloydRoot.jsx)
* Root Module example: [frank-lloyd-root](https://github.com/americanexpress/one-app/blob/main/prod-sample/sample-modules/frank-lloyd-root/0.0.0/src/components/FrankLloydRoot.jsx)
* [App Configuration in your Root Module](./docs/api/modules/App-Configuration.md)
* [What are Holocron Modules?](./docs/api/README.md)
* [Useful Local Development Commands / Options](./docs/recipes/Running-Existing-App-Locally.md)
Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Releases can be triggered in two ways:

## Automated release process

1. An automated pull request will be raised every Wednesday at 16:00 UTC, from a `prepare-release` branch to master. This uses [pull_request_release workflow](.github/workflows/pull_request_release.yml) and updates the [package.json](package.json), [package-lock.json](package-lock.json), [one-app-statics package.json](one-app-statics/package.json) and runs `npm run release:changelog` to generate the changelog. Behind the scene it uses [standard-version](https://github.com/conventional-changelog/standard-version) to update these file versions and [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli) to generate the changelog. The commit message will be in the following format `chore(release): X.X.X` . You can update this pull request to remove or add any new changes.
1. An automated pull request will be raised every Wednesday at 16:00 UTC, from a `prepare-release` branch to main. This uses [pull_request_release workflow](.github/workflows/pull_request_release.yml) and updates the [package.json](package.json), [package-lock.json](package-lock.json), [one-app-statics package.json](one-app-statics/package.json) and runs `npm run release:changelog` to generate the changelog. Behind the scene it uses [standard-version](https://github.com/conventional-changelog/standard-version) to update these file versions and [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog/tree/main/packages/conventional-changelog-cli) to generate the changelog. The commit message will be in the following format `chore(release): X.X.X` . You can update this pull request to remove or add any new changes.
2. Once a pull request is reviewed, merge the pull request and please ensure that the commit message is updated to follow this pattern

``` bash
Expand Down Expand Up @@ -47,7 +47,7 @@ This process can be used to make ad hoc releases outside of wednesday release cy

1. Run `npm run release` locally within your branch, this would update [package.json](package.json), [package-lock.json](package-lock.json)and [one-app-statics package.json](one-app-statics/package.json) with the new version to be released.
2. Run `npm run release:changelog` to generate and update the changelog.
3. Commit using the `chore(release): X.X.X` message format and push your changes to the branch `prepare-release`, then create a pull request to master.
3. Commit using the `chore(release): X.X.X` message format and push your changes to the branch `prepare-release`, then create a pull request to main.
4. When the changes are merged and reviewed. The same process from [step 3](#automated-release-process) above will be followed.

## FAQs
Expand Down
2 changes: 1 addition & 1 deletion docs/api/modules/App-Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ if (!global.BROWSER) {

The `csp` static `String` should be a valid [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) for your application which will be passed on to the HTML markup rendered by the Browser.

> We recommend using something like [content-security-policy-builder](https://www.npmjs.com/package/content-security-policy-builder) to create your CSP string. This is set up automatically when you use the [One App module generator](https://github.com/americanexpress/one-app-cli/tree/master/packages/generator-one-app-module).
> We recommend using something like [content-security-policy-builder](https://www.npmjs.com/package/content-security-policy-builder) to create your CSP string. This is set up automatically when you use the [One App module generator](https://github.com/americanexpress/one-app-cli/tree/main/packages/generator-one-app-module).
You'll still want the ability to run One App and serve modules locally without running into CSP errors. When `NODE_ENV=development`, One App will dynamically add both your computer's IP address and `localhost` to the root module's CSP. Please note that the `script-src` and `connect-src` directives must already be defined in your CSP in order for this to work properly.

Expand Down
4 changes: 2 additions & 2 deletions docs/api/modules/Internationalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ the locale directory with filenames using the [BCP-47](https://tools.ietf.org/ht

## Locale Structure

Following the below structure will allow [`one-app-locale-bundler`](https://github.com/americanexpress/one-app-cli/tree/master/packages/one-app-locale-bundler) to correctly
Following the below structure will allow [`one-app-locale-bundler`](https://github.com/americanexpress/one-app-cli/tree/main/packages/one-app-locale-bundler) to correctly
bundle your locale files.

Module Root:
Expand Down Expand Up @@ -67,7 +67,7 @@ Example `en-US.json`:

### Environment Specific Data

[`one-app-locale-bundler`](https://github.com/americanexpress/one-app-cli/tree/master/packages/one-app-locale-bundler) also allows your module to provide environment
[`one-app-locale-bundler`](https://github.com/americanexpress/one-app-cli/tree/main/packages/one-app-locale-bundler) also allows your module to provide environment
specific data. Currently One App supports three different environments;
production, qa and integration (development).

Expand Down
4 changes: 2 additions & 2 deletions docs/api/modules/Loading-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ When [Holocron Modules](#modules) are composed and loaded on the Server and Clie

> `Module.loadModuleData` has been relocated to [`Module.holocron.loadModuleData`](#moduleholocronloadmoduledata)
<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/one-app@master/docs/api/modules/App-Configuration.md" id="createSsrFetch" parentHeaderLevel="1" start-->
<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/one-app@main/docs/api/modules/App-Configuration.md" id="createSsrFetch" parentHeaderLevel="1" start-->

## `Module.appConfig.createSsrFetch`

Expand All @@ -27,7 +27,7 @@ Please see [`createSsrFetch`](./App-Configuration.md#createssrfetch) in the [App

## Holocron Module Configuration

Please see the [Holocron Module Configuration](https://github.com/americanexpress/holocron/blob/master/packages/holocron/docs/api/README.md#holocron-module-configuration) from the Holocron API Docs for more information about other properties.
Please see the [Holocron Module Configuration](https://github.com/americanexpress/holocron/blob/main/packages/holocron/docs/api/README.md#holocron-module-configuration) from the Holocron API Docs for more information about other properties.

### `Module.holocron.loadModuleData`

Expand Down
20 changes: 10 additions & 10 deletions docs/api/modules/Loading-Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

In either the Server or the Browser, there are two methods to select and load specific [Holocron Modules](../README.md#modules):
* Use Routes defined in the [child routes configuration](./Routing.md#routing) to match a URL path to a Holocron Module.
* Use dispatch-able methods in the [Holocron API](https://github.com/americanexpress/holocron/blob/master/packages/holocron/docs/api/README.md) to load Holocron Modules and render their contents with a React Component.
* Use dispatch-able methods in the [Holocron API](https://github.com/americanexpress/holocron/blob/main/packages/holocron/docs/api/README.md) to load Holocron Modules and render their contents with a React Component.

Both methods are described in the following.

Expand All @@ -24,49 +24,49 @@ Both methods are described in the following.
A parent Module may add the `ModuleRoute` routing component to the [`childRoutes` Module Lifecycle Hook](./Routing.md) to load a child Module dynamically on the server or browser when matching a route path. Once the Module is loaded, it is injected as a JSX element into the `children` prop of the parent Module.

<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@master/packages/holocron-module-route/README.md" id="ModuleRoute" parentHeadingLevel="2" start-->
<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@main/packages/holocron-module-route/README.md" id="ModuleRoute" parentHeadingLevel="2" start-->

### `ModuleRoute`

Similar to One App Router's `<Route>` with an additional prop, `moduleName`, [`ModuleRoute`](https://github.com/americanexpress/holocron/tree/master/packages/holocron-module-route#moduleroute) loads
Similar to One App Router's `<Route>` with an additional prop, `moduleName`, [`ModuleRoute`](https://github.com/americanexpress/holocron/tree/main/packages/holocron-module-route#moduleroute) loads
a Holocron Module when the URL matches the given path.

```js
<ModuleRoute path="/home" module-name="my-module" />;
```

Please see [`ModuleRoute`](https://github.com/americanexpress/holocron/tree/master/packages/holocron-module-route#-usage) in the Holocron Module Route API.
Please see [`ModuleRoute`](https://github.com/americanexpress/holocron/tree/main/packages/holocron-module-route#-usage) in the Holocron Module Route API.

<!--ONE-DOCS end-->

## Dispatch and Render

We may use the [Holocron Module Configuration] to dispatch Holocron Redux Actions. Using the `loadModuleData` function we dispatch `composeModules` to retrieve a child Module bundle (e.g. `mymodule.browser.js`) and pass React `props` to it. Once loaded, a parent Module may add the `RenderModule` React Component into their JSX to render loaded Holocron Modules.

<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@master/packages/holocron/docs/api/README.md" id="RenderModule" parentHeadingLevel="2" start-->
<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@main/packages/holocron/docs/api/README.md" id="RenderModule" parentHeadingLevel="2" start-->

### `RenderModule`

Please see [`RenderModule`](https://github.com/americanexpress/holocron/blob/master/packages/holocron/docs/api/README.md#rendermodule) in the Holocron API.
Please see [`RenderModule`](https://github.com/americanexpress/holocron/blob/main/packages/holocron/docs/api/README.md#rendermodule) in the Holocron API.

<!--ONE-DOCS end-->

<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@master/packages/holocron/docs/api/README.md" id="Module.holocron" parentHeaderLevel="2" start-->
<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@main/packages/holocron/docs/api/README.md" id="Module.holocron" parentHeaderLevel="2" start-->

### `Module.holocron`

Please see [Holocron Module Configuration] in the Holocron API.

<!--ONE-DOCS end-->

<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@master/packages/holocron/docs/api/README.md" id="composeModules" parentHeadingLevel="2" start-->
<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@main/packages/holocron/docs/api/README.md" id="composeModules" parentHeadingLevel="2" start-->

### `composeModules`

Please see [`composeModules`](https://github.com/americanexpress/holocron/blob/master/packages/holocron/docs/api/README.md#composemodules) in the Holocron API.
Please see [`composeModules`](https://github.com/americanexpress/holocron/blob/main/packages/holocron/docs/api/README.md#composemodules) in the Holocron API.

<!--ONE-DOCS end-->

[☝️ Return To Top](#loading-modules)

[Holocron Module Configuration]: https://github.com/americanexpress/holocron/blob/master/packages/holocron/docs/api/README.md#holocron-module-configuration
[Holocron Module Configuration]: https://github.com/americanexpress/holocron/blob/main/packages/holocron/docs/api/README.md#holocron-module-configuration
16 changes: 8 additions & 8 deletions docs/api/modules/Routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ uplifted to work with React@^17, for its client and server side routing.
The primary component of One App Router. It keeps the UI and URL in sync.
This is used internally within One App and should **not** be used within One App modules.

Please see One App Router's [API docs](https://github.com/americanexpress/one-app-router/blob/master/docs/README.md#router) for more information.
Please see One App Router's [API docs](https://github.com/americanexpress/one-app-router/blob/main/docs/README.md#router) for more information.

## `Route`

`<Route>` is used to define the mapping between a path and component. For use with One App this must be defined
within `childRoutes` defined on a module.

Please see One App Router's [Route API docs](https://github.com/americanexpress/one-app-router/blob/master/docs/README.md#route) for more information.
Please see One App Router's [Route API docs](https://github.com/americanexpress/one-app-router/blob/main/docs/README.md#route) for more information.

<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@master/packages/holocron-module-route/README.md" id="childRoutes" parentHeadingLevel="1" start-->
<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@main/packages/holocron-module-route/README.md" id="childRoutes" parentHeadingLevel="1" start-->

## `childRoutes`

Expand All @@ -46,22 +46,22 @@ const MyModule = () => { /* jsx */ };
MyModule.childRoutes = <ModuleRoute path="/" />;
```

Please see [One App Router](https://github.com/americanexpress/one-app-router/blob/master/docs/README.md#childroutes) for more information.
Please see [One App Router](https://github.com/americanexpress/one-app-router/blob/main/docs/README.md#childroutes) for more information.

<!--ONE-DOCS end-->

## `Link`

`<Link>` enables users to navigate around your application.

Please see One App Router's [Link API docs](https://github.com/americanexpress/one-app-router/blob/master/docs/README.md#link) for more information.
Please see One App Router's [Link API docs](https://github.com/americanexpress/one-app-router/blob/main/docs/README.md#link) for more information.

## `onEnter`

Both `Route` and `ModuleRoute` accept an `onEnter` hook which is called before the component or module gets
rendered.

Please see One App Router's [`onEnter` API](https://github.com/americanexpress/one-app-router/blob/master/docs/README.md#onenternextstate-replace-callback) for more information.
Please see One App Router's [`onEnter` API](https://github.com/americanexpress/one-app-router/blob/main/docs/README.md#onenternextstate-replace-callback) for more information.

## `onEnterRouteHook`

Expand All @@ -77,9 +77,9 @@ MyModule.onEnterRouteHook = (nextState, replace, callback) => {
};
```

<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@master/packages/holocron-module-route/README.md" id="ModuleRoute" parentHeadingLevel="1" start-->
<!--ONE-DOCS path="https://cdn.jsdelivr.net/gh/americanexpress/holocron@main/packages/holocron-module-route/README.md" id="ModuleRoute" parentHeadingLevel="1" start-->

Please see the [Holocron Module Route docs](https://github.com/americanexpress/holocron/tree/master/packages/holocron-module-route#onenterroutehook) for information.
Please see the [Holocron Module Route docs](https://github.com/americanexpress/holocron/tree/main/packages/holocron-module-route#onenterroutehook) for information.

## ModuleRoute

Expand Down
Loading

0 comments on commit 1e63b32

Please sign in to comment.