Skip to content

Commit

Permalink
Merge pull request #41 from wednesday-solutions/staging
Browse files Browse the repository at this point in the history
Staging -> master
  • Loading branch information
poojesh-ws authored Mar 14, 2023
2 parents 684f380 + 4d433db commit b5301b4
Show file tree
Hide file tree
Showing 14 changed files with 489 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SPACEX_URL=https://api.spacex.land/graphql/
SPACEX_URL=https://spacex-production.up.railway.app/graphql/
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SPACEX_URL=https://api.spacex.land/graphql/
SPACEX_URL=https://spacex-production.up.railway.app/graphql/
2 changes: 1 addition & 1 deletion .env.local
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SPACEX_URL=https://api.spacex.land/graphql/
SPACEX_URL=https://spacex-production.up.railway.app/graphql/
1 change: 1 addition & 0 deletions .github/workflows/cd-alpha-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
cd "$GITHUB_WORKSPACE"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config user.name "$GITHUB_ACTOR"
git pull
npm version prerelease --preid=alpha
git push
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cd-beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
cd "$GITHUB_WORKSPACE"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config user.name "$GITHUB_ACTOR"
git pull
npm version prerelease --preid=beta
git push
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cd-latest-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
cd "$GITHUB_WORKSPACE"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config user.name "$GITHUB_ACTOR"
git pull
npm version patch
git push
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand Down
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</p>

<p>
An enterprise react template application showcasing - Testing strategies, Global state management, middleware support, a network layer, component library integration, localization, PWA support, route configuration, lazy loading, and Continuous integration & deployment.
An enterprise electron template application showcasing - Testing strategies, Global state management, middleware support, a network layer, component library integration, localization, PWA support, route configuration, lazy loading, and Continuous integration & deployment.
</p>

---
Expand All @@ -33,7 +33,7 @@ An enterprise react template application showcasing - Testing strategies, Global

</div>

![React GraphQL TS Template CD](https://github.com/wednesday-solutions/react-graphql-ts-template/workflows/React%20GraphQL%20TypeScript%20Template%20CD/badge.svg)
![ELECTRON REACT TS Template CD](https://github.com/wednesday-solutions/react-graphql-ts-template/workflows/React%20GraphQL%20TypeScript%20Template%20CD/badge.svg)

<div>
<img src='./badges/badge-statements.svg' height="20"/>
Expand All @@ -48,10 +48,20 @@ An enterprise react template application showcasing - Testing strategies, Global

- Install dependencies using `yarn install`

- Start the dev server using `yarn start`
- Start the electron dev server using `yarn run electron:start`

- Package the app for production using `yarn run electron:package`

- Go through the other scripts in `package.json`

## Electron Configuration

- Electron configuration using [main.js](https://www.electronjs.org/docs/latest/tutorial/examples)

Take a look at the following files

- [main/main.js](main/main.js)

## TypeScript Configuration

- Typescript Configuration using [tsconfig.json](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)
Expand Down Expand Up @@ -189,6 +199,20 @@ An enterprise react template application showcasing - Testing strategies, Global
- [.github/workflows/ci.yml](.github/workflows/ci.yml)
- [.github/workflows/cd.yml](.github/workflows/cd.yml)

## Auto release

- Each push into `dev` branch will produce a alpha release
- Each push into `staging` branch will produce a beta release
- Each push into `master` branch will produce a prod release

These releases will also have the respective packaged electron app in it assets.

Take a look at the following files

- [.github/workflows/cd-alpha-release.yml](.github/workflows/cd-alpha-release.yml)
- [.github/workflows/cd-beta-release.yml](.github/workflows/cd-beta-release.yml)
- [.github/workflows/cd-latest-release.yml](.github/workflows/cd-latest-release.yml)

## Testing using @testing-library/react

- Testing is done using the @testing-library/react.
Expand Down Expand Up @@ -265,13 +289,3 @@ Where `type` is one of the following:
Where `flags` is an optional comma-separated list of one or more of the following (must be surrounded in square brackets):
- `breaking`: alters `type` to be a breaking change
And `category` can be anything of your choice. If you use a type not found in the list (but it still follows the same format of the message), it'll be grouped under `other`.

## Auto release

- Each push into `qa` branch will produce a beta release
- Each push into `master` branch will produce a prod release

Take a look at the following files

- [.github/workflows/beta-release.yml](.github/workflows/beta-release.yml)
- [.github/workflows/prod-release.yml](.github/workflows/prod-release.yml)
8 changes: 5 additions & 3 deletions app/components/Siderbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ const SidebarWrapper = styled.div`
const SidebarDrawer = styled(Drawer)`
&& {
.ant-drawer-body {
padding: ${(props) => props.theme.headerHeight} 0 0 0;
background-color: ${colors.primary};
width: ${(props) => props.theme.sidebarWidth};
text-align: center;
}
.ant-drawer-header {
border-bottom: 1px solid ${colors.primary};
background-color: ${colors.primary};
}
.ant-drawer-close {
top: 1rem;
padding-top: 1rem;
}
}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ exports[`<HomeContainer /> tests should render and match the snapshot 1`] = `
class="HomeContainer__ButtonBox-sc-1ly6omb-3 gSuRgZ"
>
<button
class="ant-btn"
class="ant-btn ant-btn-default"
data-testid="clear-sort"
disabled=""
type="button"
Expand Down
2 changes: 1 addition & 1 deletion app/utils/graphqlUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import camelCase from 'lodash-es/camelCase';
import { mapKeysDeep } from '.';

export const client = new ApolloClient({
uri: 'https://api.spacex.land/graphql',
uri: 'https://spacex-production.up.railway.app/graphql/',
cache: new InMemoryCache()
});

Expand Down
3 changes: 2 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module.exports = {
'@babel/plugin-syntax-optional-chaining',
'styled-components',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import'
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-runtime'
],
env: {
production: {
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-graphql-ts-template",
"version": "1.0.8",
"version": "1.0.9-beta.0",
"description": "A React Typescript GraphQL application",
"repository": {
"type": "git",
Expand Down Expand Up @@ -57,9 +57,10 @@
"build-storybook": "export ENVIRONMENT_NAME=production && build-storybook",
"initialize": "git checkout --orphan temp-branch && git add -A && git commit -m 'Initial commit' && git branch -D master && git branch -m master",
"generate": "react-generate",
"electron:dev": "export ENVIRONMENT_NAME=local && concurrently -c green.bold,blue.bold,white.bold -n WEBPACK,TYPESCRIPT,ELECTRON \"cross-env NODE_ENV=development node server\" \"yarn tsc:watch\" \"wait-on http://localhost:3000 && cross-env NODE_ENV=development electron .\"",
"electron:dev": "export ENVIRONMENT_NAME=local && concurrently -k -c green.bold,blue.bold,white.bold -n WEBPACK,TYPESCRIPT,ELECTRON \"cross-env NODE_ENV=development node server\" \"yarn tsc:watch\" \"wait-on http://localhost:3000 && cross-env NODE_ENV=development electron .\"",
"electron:prod": "yarn run build && concurrently -c gree.bold,blue.bold -n WEBPACK,ELECTRON \"yarn run start:prod\" \"wait-on http://localhost:3000 && cross-env NODE_ENV=development electron .\"",
"electron:build": "yarn run build && electron-builder"
"electron:build": "yarn run build && electron-builder",
"electron:package": "yarn run electron-builder -- --publish always --win --mac --linux"
},
"browserslist": [
"last 2 versions",
Expand Down Expand Up @@ -199,6 +200,7 @@
"@babel/plugin-transform-modules-commonjs": "7.14.5",
"@babel/plugin-transform-react-constant-elements": "7.14.5",
"@babel/plugin-transform-react-inline-elements": "7.14.5",
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.16.7",
Expand Down
Loading

0 comments on commit b5301b4

Please sign in to comment.