Skip to content

Commit

Permalink
Merge branch 'develop' into feat/CORL-2885-accessibility-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeaty committed Sep 5, 2023
2 parents 718e568 + 01d556e commit 11d3083
Show file tree
Hide file tree
Showing 3,524 changed files with 109,004 additions and 1,340 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
68 changes: 47 additions & 21 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,56 +50,82 @@ jobs:
-
name: Install npm 8
run: npm i -g [email protected] --registry=https://registry.npmjs.org
# -
# name: npm Lockfile Version (client)
# uses: mansona/npm-lockfile-version@v1
# with:
# entryPoint: ./client
# version: 2
# -
# name: npm Lockfile Version (common)
# uses: mansona/npm-lockfile-version@v1
# with:
# entryPoint: ./common
# version: 2
# -
# name: npm Lockfile Version (server)
# uses: mansona/npm-lockfile-version@v1
# with:
# entryPoint: ./server
# version: 2
-
name: npm Lockfile Version
uses: mansona/npm-lockfile-version@v1
name: Cache Dependencies
id: cache-client
uses: actions/cache@v3
with:
version: 2
path: ./client/node_modules
key: modules-client-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
-
name: Cache Dependencies
id: cache
id: cache-common
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
path: ./common/node_modules
key: modules-common-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
-
name: Cache Dependencies
id: cache-server
uses: actions/cache@v3
with:
path: ./server/node_modules
key: modules-server-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
-
name: npm ci
run: npm ci
run: sh scripts/npm-ci.sh
-
name: Generate schemas and types
run: npm run generate
run: sh scripts/generate.sh
-
name: Lint Source Code
run: npm run lint
-
name: Lint Markdown
run: |
npm run doctoc
git diff --exit-code
run: sh scripts/lint.sh
-
name: Lint Versions
run: npx @coralproject/package-version-lint
run: |
cd client
npx @coralproject/package-version-lint
-
name: Run Server Unit Tests
run: npm run test:server -- --ci --runInBand --reporters=default --reporters=jest-junit
run: cd server && npm run test:server -- --ci --runInBand --reporters=default --reporters=jest-junit
-
name: Run Client Stream Unit Tests
run: npm run test:client:stream -- --ci --runInBand --reporters=default --reporters=jest-junit
run: cd client && npm run test:client:stream -- --ci --runInBand --reporters=default --reporters=jest-junit
-
name: Run Client Admin Unit Tests
run: npm run test:client:admin -- --ci --runInBand --reporters=default --reporters=jest-junit
run: cd client && npm run test:client:admin -- --ci --runInBand --reporters=default --reporters=jest-junit
-
name: Run Client Other Unit Tests
run: npm run test:client:other -- --ci --runInBand --reporters=default --reporters=jest-junit
run: cd client && npm run test:client:other -- --ci --runInBand --reporters=default --reporters=jest-junit
-
name: Build
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: npm run build
run: sh scripts/build.sh
-
name: Verify Bundle Size
run: ./node_modules/.bin/bundlesize --enable-github-checks
run: cd client && ./node_modules/.bin/bundlesize --enable-github-checks
# Build tag push the image after a merge to develop
-
name: Build, Tag, Push
Expand Down
57 changes: 40 additions & 17 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,58 +58,81 @@ jobs:
-
name: Install npm 8
run: npm i -g [email protected] --registry=https://registry.npmjs.org
- name: npm Lockfile Version
uses: mansona/npm-lockfile-version@v1
# - name: npm Lockfile Version
# uses: mansona/npm-lockfile-version@v1
# with:
# version: 2
-
name: Cache Dependencies
id: cache-client
uses: actions/cache@v3
with:
version: 2
path: ./client/node_modules
key: modules-client-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
-
name: Cache Dependencies
id: cache
id: cache-common
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
path: ./common/node_modules
key: modules-common-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
-
name: Cache Dependencies
id: cache-server
uses: actions/cache@v3
with:
path: ./server/node_modules
key: modules-server-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
-
name: npm ci
run: npm ci
run: sh scripts/npm-ci.sh
-
name: Generate schemas and types
run: npm run generate
run: sh scripts/generate.sh
-
name: Lint Source Code
run: npm run lint
run: sh scripts/lint.sh
-
name: Lint Markdown
run: |
cd client
npm run doctoc
git diff --exit-code
-
name: Lint Versions
run: npx @coralproject/package-version-lint
run: |
cd client
npx @coralproject/package-version-lint
-
name: Run Server Unit Tests
run: npm run test:server -- --ci --runInBand --reporters=default --reporters=jest-junit
run: cd server && npm run test:server -- --ci --runInBand --reporters=default --reporters=jest-junit
-
name: Run Client Stream Unit Tests
run: npm run test:client:stream -- --ci --runInBand --reporters=default --reporters=jest-junit
run: cd client && npm run test:client:stream -- --ci --runInBand --reporters=default --reporters=jest-junit
-
name: Run Client Admin Unit Tests
run: npm run test:client:admin -- --ci --runInBand --reporters=default --reporters=jest-junit
run: cd client && npm run test:client:admin -- --ci --runInBand --reporters=default --reporters=jest-junit
-
name: Run Client Other Unit Tests
run: npm run test:client:other -- --ci --runInBand --reporters=default --reporters=jest-junit
run: cd client && npm run test:client:other -- --ci --runInBand --reporters=default --reporters=jest-junit
-
name: Build
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: npm run build
run: sh scripts/build.sh
-
name: Verify Bundle Size
run: ./node_modules/.bin/bundlesize --enable-github-checks
run: cd client && ./node_modules/.bin/bundlesize --enable-github-checks
-
name: Verify Release Version
run: npx @coralproject/package-version-lint --expect ${RC_TAG/#v}
run: |
cd client
npx @coralproject/package-version-lint --expect ${RC_TAG/#v}
cd ../server
npx @coralproject/package-version-lint --expect ${RC_TAG/#v}
-
name: Create the Pre-Tag Names
run: |
Expand Down
19 changes: 1 addition & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
# don't include the dependancies
node_modules

# don't include any logs
npm-debug.log*

# don't include any yarn files
yarn-error.log
yarn.lock

# don't include any OS/editor files
.env
.idea/
.vs
.docz
.next
*.swp
*.DS_STORE

# don't include any generated files
dist
*.css.d.ts
__generated__
persisted-queries.json
docs/out
*.DS_STORE
17 changes: 11 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"*.css": "postcss"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
".vs": true,
"**/.DS_Store": true,
".vs": true
"**/.git": false,
"**/.hg": true,
"**/.svn": true,
"**/CVS": true
},
"tslint.enable": false,
"eslint.validate": [
Expand Down Expand Up @@ -54,5 +54,10 @@
"search.exclude": {
"package-lock.json": true
},
"debug.node.autoAttach": "off"
"debug.node.autoAttach": "off",
"eslint.workingDirectories": [
"./client/",
"./server/",
"./common/",
]
}
37 changes: 33 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,39 @@ USER node
RUN git config --global url."https://github.com/".insteadOf ssh://[email protected]/ && \
git config --global url."https://".insteadOf ssh://

# Install build static assets and clear caches.
RUN npm ci && \
# Initialize sub packages
RUN cd config && npm ci && \
cd ../common && npm ci && \
cd ../client && npm ci && \
cd ../server && npm ci && \
cd ..

# Generate schema types for common/ to use
RUN cd server && \
npm run generate && \
cd ..

# Build config, prune static assets
RUN cd config && \
npm run build && \
cd ..

# Build common, prune static assets
RUN cd common && \
npm run build && \
cd ..

# Build client, prune static assets
RUN cd client && \
npm run build && \
npm prune --production && \
cd ..

# Install, build server, prune static assets
RUN cd server && \
npm run build && \
npm prune --production
npm prune --production && \
cd ..

# Setup the environment
ENV NODE_ENV production
Expand All @@ -40,4 +69,4 @@ EXPOSE 5000

# Run the node process directly instead of using `npm run start`:
# SEE: https://github.com/nodejs/docker-node/blob/a2eb9f80b0fd224503ee2678867096c9e19a51c2/docs/BestPractices.md#cmd
CMD ["node", "dist/index.js"]
CMD ["node", "server/dist/index.js"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,13 @@ If you are interested in contributing to Coral, check out our [Contributor's Gui
## License

Coral is [Apache-2.0 licensed](LICENSE).

## Versioning

If you're packaging a release of Coral, there is a convenient script to update the version numbers for all the child projects in the mono-repo.

The below script will run `npm version x.y.z` against all the child repositories so you don't have to manually update them by hand!

```
sh scripts/version.sh MAJOR.MINOR.VERSION // i.e. 8.5.0
```
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

sh scripts/build.sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# don't include the dependancies
node_modules

# don't include any logs
npm-debug.log*

# don't include any yarn files
yarn-error.log
yarn.lock

# don't include any OS/editor files
.env
.idea/
.vs
.docz
.next
*.swp
*.DS_STORE

# don't include any generated files
dist
*.css.d.ts
__generated__
persisted-queries.json
docs/out
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions client/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* This is a project wide babel configuration.
* https://babeljs.io/docs/en/config-files#project-wide-configuration
*/

// Note: If Webpack env is set, we are building for the client.

const plugins =
process.env.WEBPACK === "true"
? [
"use-lodash-es",
"lodash",
[
"@babel/plugin-transform-runtime",
{
absoluteRuntime: true,
corejs: 3,
helpers: true,
regenerator: true,
useESModules: true,
version: "^7.10.3",
},
],
]
: [];

const environment =
process.env.WEBPACK === "true"
? { modules: false }
: { targets: { node: "current" }, modules: "commonjs" };

module.exports = {
babelrcRoots: ["./src/core/client/*", "../common/src/*"],
plugins,
presets: [["@babel/env", environment]],
sourceType: "unambiguous",
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions client/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
projects: ["<rootDir>/jest/client.config.js"],
};
File renamed without changes.
Loading

0 comments on commit 11d3083

Please sign in to comment.