Skip to content

Commit

Permalink
Merge pull request #4349 from coralproject/develop
Browse files Browse the repository at this point in the history
8.5.1
  • Loading branch information
tessalt authored Sep 14, 2023
2 parents 7536231 + 106f9a6 commit e5c72eb
Show file tree
Hide file tree
Showing 3,525 changed files with 109,028 additions and 1,340 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
23 changes: 22 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
# tests are not run in the docker container.
__tests__
**/__tests__
**/coverage
coverage

# we won't use the .git folder in production.
.git
.github

# don't include the dependancies
node_modules
**/node_modules

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

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

# don't include any OS/editor files
.env
**/.env
.idea/
.vs
.vscode

.docz
**/.docz

*.swp
**/*.swp

*.DS_STORE
*.DS_Store
**/*.DS_STORE
**/*.DS_Store

# don't include any generated files
dist
**/dist

*.css.d.ts
**/*.css.d.ts

__generated__
docs/.next
**/__generated__

**/.next
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/",
]
}
38 changes: 35 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,42 @@ 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 && \
npm prune --production
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 && \
cd ..

# Set working directory within server folder
WORKDIR /usr/src/app/server

# Setup the environment
ENV NODE_ENV production
Expand Down
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.
Loading

0 comments on commit e5c72eb

Please sign in to comment.