Skip to content

Commit

Permalink
Merge branch 'master' into 2515-delete-old-code-thats-not-necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed Feb 1, 2025
2 parents bf69192 + 3a128a4 commit 34a91e5
Show file tree
Hide file tree
Showing 65 changed files with 65,864 additions and 7,512 deletions.
12 changes: 7 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
const util = require('util')
const chalk = require('chalk')
const crypto = require('crypto')
const { exec, fork } = require('child_process')
const { exec, execSync, fork } = require('child_process')
const execP = util.promisify(exec)
const { readdir, cp, mkdir, access, rm, copyFile, readFile } = require('fs/promises')
const fs = require('fs')
Expand Down Expand Up @@ -84,6 +84,9 @@ if (!process.env.DB_PATH) {
module.exports = (grunt) => {
require('load-grunt-tasks')(grunt)

const GI_GIT_VERSION = process.env.CI ? process.env.GI_VERSION : execSync('git describe --dirty').toString('utf8').trim()
Object.assign(process.env, { GI_GIT_VERSION })

// Ensure API_PORT and API_URL envars are defined and available to subprocesses.
;(function defineApiEnvars () {
const API_PORT = Number.parseInt(grunt.option('port') ?? process.env.API_PORT ?? '8000', 10)
Expand Down Expand Up @@ -220,6 +223,7 @@ module.exports = (grunt) => {
'process.env.CI': `'${CI}'`,
'process.env.CONTRACTS_VERSION': `'${CONTRACTS_VERSION}'`,
'process.env.GI_VERSION': `'${GI_VERSION}'`,
'process.env.GI_GIT_VERSION': `'${GI_GIT_VERSION}'`,
'process.env.LIGHTWEIGHT_CLIENT': `'${LIGHTWEIGHT_CLIENT}'`,
'process.env.MAX_EVENTS_AFTER': `'${MAX_EVENTS_AFTER}'`,
'process.env.NODE_ENV': `'${NODE_ENV}'`,
Expand All @@ -229,7 +233,6 @@ module.exports = (grunt) => {
},
external: ['crypto', '*.eot', '*.ttf', '*.woff', '*.woff2'],
format: 'esm',
incremental: true,
loader: {
'.eot': 'file',
'.ttf': 'file',
Expand All @@ -242,8 +245,7 @@ module.exports = (grunt) => {
outdir: distJS,
sourcemap: true,
// Warning: split mode has still a few issues. See https://github.com/okTurtles/group-income/pull/1196
splitting: !grunt.option('no-chunks'),
watch: false // Not using esbuild's own watch mode since it involves polling.
splitting: !grunt.option('no-chunks')
},
// Native options used when building the main entry point.
main: {
Expand All @@ -257,7 +259,7 @@ module.exports = (grunt) => {
}
esbuildOptionBags.contracts = {
...pick(clone(esbuildOptionBags.default), [
'define', 'bundle', 'watch', 'incremental'
'define', 'bundle'
]),
// format: 'esm',
format: 'iife',
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,28 @@ grunt dev --tunnel
> $ ssh -R 80:localhost:8000 [email protected]
> ```
Build the app for distribution
Pin a new version of contracts:
```bash
grunt deploy
$ NODE_ENV=production grunt pin:0.1.0
```
Clean up files in `dist/`
Build the app for distribution:

```bash
$ git tag -u <email> v1.1.0 # create the tag before calling grunt deploy
$ NODE_ENV=production grunt deploy
$ tar cfz gi-v1.1.0.tgz dist
# Debug build is the same except without NODE_ENV var
```

Clean up files in `dist/`:

```bash
grunt clean
```

Run tests.
Run tests:

**NOTE: You may need to first install Cypress using `./node_modules/.bin/cypress install`**

Expand Down
Loading

0 comments on commit 34a91e5

Please sign in to comment.