chore: cleanup package.json

This commit is contained in:
Audric Ackermann 2022-08-26 11:35:19 +10:00
parent 56ee7fe7ac
commit d50413ce7c
7 changed files with 38 additions and 48 deletions

View File

@ -61,7 +61,7 @@ jobs:
run: yarn install --frozen-lockfile --network-timeout 600000 --force
- name: Generate and concat files
run: yarn generate && yarn transpile
run: yarn build-everything
- name: Lint Files
# no need to lint files on all platforms. Just do it once on the quicker one

View File

@ -58,7 +58,7 @@ jobs:
run: yarn install --frozen-lockfile --network-timeout 600000 --force
- name: Generate and concat files
run: yarn generate && yarn transpile
run: yarn build-everything
- name: Lint Files
# no need to lint files on all platforms. Just do it once on the quicker one

View File

@ -58,7 +58,7 @@ jobs:
run: yarn install --frozen-lockfile --network-timeout 600000 --force
- name: Generate and concat files
run: yarn generate && yarn transpile
run: yarn build-everything
- name: Lint Files
# no need to lint files on all platforms. Just do it once on the quicker one

View File

@ -66,7 +66,7 @@ nvm install # install the current node version used in this project
nvm use # use the current node version used in this project
npm install -g yarn # install yarn globally for this node version
yarn install --frozen-lockfile # install all dependecies of this project
yarn grunt # transpile and assemble files
yarn build-everything # transpile and assemble files
yarn start-prod # start the app on production mode (currently this is the only one supported)
```
@ -116,7 +116,7 @@ nvm install # install the current node version used in this project
nvm use # use the current node version used in this project
npm install -g yarn # install yarn globally for this node version
yarn install --frozen-lockfile # install all dependecies of this project
yarn grunt # transpile and assemble files
yarn build-everything # transpile and assemble files
yarn start-prod # start the app on production mode (currently this is the only one supported)
```
@ -125,20 +125,21 @@ yarn start-prod # start the app on production mode (currently this is the only o
### Commands
The `rpm` package is required for running the build-release script. Run the appropriate command to install the `rpm` package:
```sh
sudo pacman -S rpm # Arch
```
```sh
sudo apt install rpm # Ubuntu/Debian
```
Run the following to build the binaries for your specific system OS.
```
npm install yarn --no-save
yarn install --frozen-lockfile
yarn generate
yarn build-everything
yarn build-release
```

View File

@ -60,10 +60,9 @@ git clone https://github.com/oxen-io/session-desktop.git
cd session-desktop
npm install --global yarn # (only if you dont already have `yarn`)
yarn install --frozen-lockfile # Install and build dependencies (this will take a while)
yarn grunt # Generate final JS and CSS assets
yarn icon-gen # Generate full set of icons for Electron
yarn build-everything
yarn test # A good idea to make sure tests run first
yarn start # Start Session!
yarn start-prod # Start Session!
```
You'll need to restart the application regularly to see your changes, as there
@ -72,14 +71,10 @@ is no automatic restart mechanism. Alternatively, keep the developer tools open
<kbd>Cmd</kbd> + <kbd>R</kbd> (macOS) or <kbd>Ctrl</kbd> + <kbd>R</kbd>
(Windows & Linux).
Also, note that the assets loaded by the application are not necessarily the same files
youre touching. You may not see your changes until you run `yarn grunt` on the
command-line like you did during setup. You can make it easier on yourself by generating
the latest built assets when you change a file. Run this in its own terminal instance
while you make changes:
```
yarn grunt dev # runs until you stop it, re-generating built assets on file changes
yarn build-everything:watch # runs until you stop it, re-generating built assets on file changes
# Once this command is waiting for changes, you will need to run in another terminal `yarn parcel-util-worker` to fix the "exports undefined" error on start.
# If you do change the sass while this command is running, it won't pick it up. You need to either run `yarn sass` or have `yarn sass:watch` running in a separate terminal.
```
## Multiple instances
@ -93,8 +88,6 @@ directory from `%appData%/Session` to `%appData%/Session-{environment}-{instance
There are a few scripts which you can use:
```
yarn start - Start development
MULTI=1 yarn start - Start second instance of development
yarn start-prod - Start production but in development mode
MULTI=1 yarn start-prod - Start another instance of production
```
@ -103,7 +96,7 @@ For more than 2 clients, you may run the above command with `NODE_APP_INSTANCE`
For example, running:
```
NODE_APP_INSTANCE=alice yarn start
NODE_APP_INSTANCE=alice yarn start-prod
```
Will run the development environment with the `alice` instance and thus create a seperate storage profile.
@ -188,6 +181,6 @@ see how they did things.
You can build a production binary by running the following:
```
yarn generate
yarn build-everything
yarn build-release
```

View File

@ -3,14 +3,6 @@
module.exports = grunt => {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
exec: {
transpile: {
cmd: 'yarn transpile',
},
'build-protobuf': {
cmd: 'yarn build-protobuf',
},
},
gitinfo: {}, // to be populated by grunt gitinfo
});
@ -45,5 +37,5 @@ module.exports = grunt => {
});
grunt.registerTask('date', ['gitinfo']);
grunt.registerTask('default', ['exec:build-protobuf', 'exec:transpile', 'date', 'getCommitHash']);
grunt.registerTask('default', ['date', 'getCommitHash']);
};

View File

@ -45,12 +45,27 @@
"jpeg-js": "^0.4.4"
},
"scripts": {
"postinstall": "yarn patch-package && yarn electron-builder install-app-deps && yarn rebuild-curve25519-js",
"start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod$MULTI electron .",
"grunt": "yarn clean-transpile && yarn sass && grunt",
"generate": "yarn grunt --force",
"build-everything": "yarn clean && yarn protobuf && grunt && yarn sass && tsc && yarn parcel-util-worker",
"build-everything:watch": "yarn clean && yarn protobuf && grunt && yarn sass && yarn parcel-util-worker && tsc -w",
"protobuf": "pbjs --target static-module --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js --force-long",
"sass": "rimraf 'stylesheets/dist/' && parcel build --target sass --no-autoinstall --no-cache",
"sass:watch": "rimraf 'stylesheets/dist/' && parcel watch --target sass --no-autoinstall --no-cache",
"parcel-util-worker": "rimraf ts/webworker/workers/util.worker.js && parcel build --target util-worker --no-autoinstall --no-cache",
"clean": "rimraf 'ts/**/*.js' 'ts/*.js' 'ts/*.js.map' 'ts/**/*.js.map' && rimraf tsconfig.tsbuildinfo;",
"lint-full": "yarn format-full && eslint . && tslint --format stylish --project .",
"format-full": "prettier --list-different --write \"*.{css,js,json,scss,ts,tsx}\" \"./**/*.{css,js,json,scss,ts,tsx}\"",
"integration-test": "npx playwright test",
"integration-test-snapshots": "npx playwright test -g 'profile picture' --update-snapshots",
"test": "mocha -r jsdom-global/register --recursive --exit --timeout 10000 \"./ts/test/**/*_test.js\"",
"coverage": "nyc --reporter=html mocha -r jsdom-global/register --recursive --exit --timeout 10000 \"./ts/test/**/*_test.js\"",
"build-release": "run-script-os",
"build-release-non-linux": "yarn sass && yarn generate && cross-env SIGNAL_ENV=production electron-builder --config.extraMetadata.environment=production --publish=never --config.directories.output=release",
"build-release-non-linux": "yarn build-everything && cross-env SIGNAL_ENV=production electron-builder --config.extraMetadata.environment=production --publish=never --config.directories.output=release",
"build-release:win32": "yarn build-release-non-linux",
"build-release:macos": "yarn build-release-non-linux",
"build-release:linux": "yarn sedtoDeb; yarn build-release-non-linux && yarn sedtoAppImage && yarn build-release-non-linux && yarn sedtoDeb",
@ -60,22 +75,11 @@
"build-release-publish:macos": "yarn build-release-publish-non-linux",
"build-release-publish:linux": "yarn sedtoDeb; yarn build-release-publish-non-linux && yarn sedtoAppImage && yarn build-release-publish-non-linux && yarn sedtoDeb",
"appImage": "yarn sedtoAppImage; yarn build-release-non-linux; yarn sedtoDeb",
"build-protobuf": "pbjs --target static-module --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js --force-long",
"test": "mocha -r jsdom-global/register --recursive --exit --timeout 10000 \"./ts/test/**/*_test.js\"",
"coverage": "nyc --reporter=html mocha -r jsdom-global/register --recursive --exit --timeout 10000 \"./ts/test/**/*_test.js\"",
"lint-full": "yarn format-full && eslint . && tslint --format stylish --project .",
"format-full": "prettier --list-different --write \"*.{css,js,json,scss,ts,tsx}\" \"./**/*.{css,js,json,scss,ts,tsx}\"",
"transpile": "yarn tsc && yarn parcel-util-worker && yarn sass",
"transpile:watch": "yarn grunt --force; tsc -w",
"integration-test": "npx playwright test",
"integration-test-snapshots": "npx playwright test -g 'profile picture' --update-snapshots",
"clean-transpile": "rimraf 'ts/**/*.js' 'ts/*.js' 'ts/*.js.map' 'ts/**/*.js.map' && rimraf tsconfig.tsbuildinfo;",
"ready": "yarn grunt && yarn lint-full && yarn test",
"sedtoAppImage": "sed -i 's/\"target\": \\[\"deb\", \"rpm\", \"freebsd\"\\]/\"target\": \"AppImage\"/g' package.json",
"sedtoDeb": "sed -i 's/\"target\": \"AppImage\"/\"target\": \\[\"deb\", \"rpm\", \"freebsd\"\\]/g' package.json",
"sass": "rimraf 'stylesheets/dist/' && parcel build --target sass --no-autoinstall --no-cache",
"sass:watch": "rimraf 'stylesheets/dist/' && parcel watch --target sass --no-autoinstall --no-cache",
"parcel-util-worker": "rimraf ts/webworker/workers/util.worker.js && parcel build --target util-worker --no-autoinstall --no-cache",
"ready": "yarn build-everything && yarn lint-full && yarn test",
"postinstall": "yarn patch-package && yarn electron-builder install-app-deps && yarn rebuild-curve25519-js",
"rebuild-curve25519-js": "cd node_modules/curve25519-js && yarn install && yarn build && cd ../../"
},
"dependencies": {