Skip to content

Commit edba0a2

Browse files
authored
Merge pull request #703 from nature-heart-software/dev
release
2 parents 5c7b0eb + 330403a commit edba0a2

File tree

262 files changed

+9771
-12707
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+9771
-12707
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
NODE_OPTIONS: '--max_old_space_size=4096'
6969
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7070
VUE_APP_ENCRYPTION_KEY: ${{ secrets.APP_ENCRYPTION_KEY }}
71+
VITE_APP_ENCRYPTION_KEY: ${{ secrets.APP_ENCRYPTION_KEY }}
7172
with:
7273
cmd: build
7374

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ node_modules
33
/dist
44
temp
55
.parcel-cache
6+
playground
7+
*.timestamp*
68

79
# local env files
810
.env.local

.syncpackrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @ts-check
2+
3+
/** @type {import("syncpack").RcFile} */
4+
const config = {}
5+
6+
module.exports = config

.yarnrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
httpTimeout 600000
22
network-timeout 600000
3+
--add.ignore-workspace-root-check true
4+
--add.ignore-engines true
5+
--add.prefer-offline true
6+
--upgrade.ignore-workspace-root-check true
7+
--upgrade.ignore-engines true
8+
--upgrade.prefer-offline true
9+
--install.ignore-workspace-root-check true
10+
--install.ignore-engines true
11+
--install.prefer-offline true

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ COPY ./ ./
3030

3131
COPY ./lerna.json.prod ./lerna.json
3232

33-
RUN npm run build
33+
RUN yarn install
34+
35+
RUN yarn build:deps
36+
37+
RUN yarn build:app

apps/app-server/package.json

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
{
22
"name": "@apps/app-server",
3-
"private": true,
43
"version": "0.0.0",
5-
"type": "module",
6-
"scripts": {
7-
"start": "node bin/generate-exports && nodemon ./dist/main.js --start-server",
8-
"build": "node bin/generate-exports && microbundle --target=node --format=cjs --sourcemap=false",
9-
"dev": "node bin/generate-exports && microbundle --target=node --format=cjs --sourcemap=false watch"
10-
},
11-
"source": "src/main.ts",
12-
"main": "./dist/main.cjs",
13-
"module": "./dist/main.cjs",
14-
"unpkg": "./dist/main.umd.js",
15-
"types": "./dist/main.d.ts",
16-
"files": [
17-
"./dist"
18-
],
194
"dependencies": {
205
"@aws-sdk/client-cognito-identity": "^3.87.0",
216
"@aws-sdk/client-polly": "^3.87.0",
227
"@aws-sdk/credential-provider-cognito-identity": "^3.87.0",
238
"@google-cloud/text-to-speech": "^3.4.0",
249
"@types/object-hash": "^3.0.2",
25-
"axios": "^0.26.1",
10+
"axios": "^0.27.2",
2611
"body-parser": "^1.20.0",
2712
"cors": "^2.8.5",
2813
"express": "^4.17.3",
@@ -34,19 +19,33 @@
3419
"object-hash": "^3.0.0",
3520
"say": "^0.16.0",
3621
"socket.io": "^4.5.4",
37-
"uuid": "^8.3.2"
22+
"uuid": "^9.0.0"
3823
},
3924
"devDependencies": {
40-
"@packages/generate-exports": "^0.0.0",
25+
"@packages/generate-exports": "0.0.0",
4126
"@types/body-parser": "^1.19.2",
4227
"@types/cors": "^2.8.12",
4328
"@types/express": "^4.17.13",
44-
"@types/lodash": "^4.14.182",
29+
"@types/lodash": "^4.14.184",
4530
"@types/morgan": "^1.9.3",
4631
"@types/uuid": "^8.3.4",
4732
"microbundle": "^0.15.1",
4833
"nodemon": "^2.0.15",
49-
"typescript": "^4.6.4",
50-
"vite": "^3.0.0"
51-
}
34+
"typescript": "^5.4.5",
35+
"vite": "^5.2.0"
36+
},
37+
"files": [
38+
"./dist"
39+
],
40+
"main": "./dist/main.cjs",
41+
"module": "./dist/main.cjs",
42+
"private": true,
43+
"scripts": {
44+
"build": "node bin/generate-exports && microbundle --target=node --format=cjs --sourcemap=false",
45+
"dev": "node bin/generate-exports && microbundle --target=node --format=cjs --sourcemap=false watch",
46+
"start": "node bin/generate-exports && nodemon ./dist/main.js --start-server"
47+
},
48+
"source": "src/main.ts",
49+
"type": "module",
50+
"types": "./dist/main.d.ts"
5251
}

apps/app-server/src/plugins/speech-apis/el.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const plugin: Izabela.Server.Plugin = ({ app }) => {
1818
const {
1919
data: { voices },
2020
} = await api.get('/voices', {
21+
params: {
22+
show_legacy: true,
23+
},
2124
headers: {
2225
'xi-api-key': apiKey,
2326
},

apps/app-server/src/plugins/speech-apis/gc.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import { RequestHandler } from 'express'
22
import axios from 'axios'
33
import { handleError } from '../../utils/requests'
44
import path from 'path'
5-
import izabelaServer from '../../server'
65
import { v4 as uuid } from 'uuid'
76
import fs from 'fs'
87
import util from 'util'
98

10-
const plugin: Izabela.Server.Plugin = ({ app }) => {
9+
const plugin: Izabela.Server.Plugin = ({ app, config }) => {
1110
const listVoicesHandler: RequestHandler = async (
1211
{
1312
body: {
@@ -37,10 +36,7 @@ const plugin: Izabela.Server.Plugin = ({ app }) => {
3736
},
3837
res,
3938
) => {
40-
const outputFile = path.join(
41-
izabelaServer.getConfig().tempPath,
42-
uuid() + '.mp3',
43-
)
39+
const outputFile = path.join(config?.tempPath || '', uuid() + '.wav')
4440
try {
4541
fs.mkdirSync(path.parse(outputFile).dir, { recursive: true })
4642
fs.writeFileSync(outputFile, '')
@@ -58,7 +54,7 @@ const plugin: Izabela.Server.Plugin = ({ app }) => {
5854

5955
res.writeHead(200, {
6056
'Content-Length': total,
61-
'Content-Type': 'audio/mp3',
57+
'Content-Type': 'audio/wav',
6258
})
6359
const stream = fs.createReadStream(outputFile).pipe(res)
6460
stream.on('finish', () => {

apps/app-server/src/plugins/speech-apis/ma.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { RequestHandler } from 'express'
22
import axios from 'axios'
33
import { handleError } from '../../utils/requests'
44
import path from 'path'
5-
import izabelaServer from '../../server'
65
import { v4 as uuid } from 'uuid'
76
import fs from 'fs'
87
import {
@@ -13,7 +12,7 @@ import {
1312
} from 'microsoft-cognitiveservices-speech-sdk'
1413
import util from 'util'
1514

16-
const plugin: Izabela.Server.Plugin = ({ app }) => {
15+
const plugin: Izabela.Server.Plugin = ({ app, config }) => {
1716
const listVoicesHandler: RequestHandler = async (
1817
{
1918
body: {
@@ -46,10 +45,7 @@ const plugin: Izabela.Server.Plugin = ({ app }) => {
4645
},
4746
res,
4847
) => {
49-
const outputFile = path.join(
50-
izabelaServer.getConfig().tempPath,
51-
uuid() + '.mp3',
52-
)
48+
const outputFile = path.join(config?.tempPath || '', uuid() + '.mp3')
5349
try {
5450
fs.mkdirSync(path.parse(outputFile).dir, { recursive: true })
5551
fs.writeFileSync(outputFile, '')

apps/app-server/src/plugins/speech-apis/say.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import { RequestHandler } from 'express'
22
import say from 'say'
33
import { handleError } from '../../utils/requests'
44
import path from 'path'
5-
import izabelaServer from '../../server'
65
import { v4 as uuid } from 'uuid'
76
import fs from 'fs'
87

9-
const plugin: Izabela.Server.Plugin = ({ app }) => {
8+
const plugin: Izabela.Server.Plugin = ({ app, config }) => {
109
const listVoicesHandler: RequestHandler = async (_, res) => {
1110
// @ts-ignore
1211
try {
@@ -32,10 +31,7 @@ const plugin: Izabela.Server.Plugin = ({ app }) => {
3231
},
3332
res,
3433
) => {
35-
const outputFile = path.join(
36-
izabelaServer.getConfig().tempPath,
37-
uuid() + '.mp3',
38-
)
34+
const outputFile = path.join(config?.tempPath || '', uuid() + '.mp3')
3935
try {
4036
fs.mkdirSync(path.parse(outputFile).dir, { recursive: true })
4137
fs.writeFileSync(outputFile, '')

apps/app-server/src/plugins/speech-apis/ud.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { RequestHandler } from 'express'
22
import { handleError } from '../../utils/requests'
3-
import izabelaServer from '../../server'
43
import { v4 as uuid } from 'uuid'
54
import fs from 'fs'
65
import util from 'util'
76
import path from 'path'
87
import axios, { AxiosResponse } from 'axios'
98

10-
const plugin: Izabela.Server.Plugin = ({ app }) => {
9+
const plugin: Izabela.Server.Plugin = ({ app, config }) => {
1110
const listVoicesHandler: RequestHandler = async (
1211
{ body: { payload: { mode } = { mode: 'tts-all' } } },
1312
res,
@@ -35,10 +34,7 @@ const plugin: Izabela.Server.Plugin = ({ app }) => {
3534
},
3635
res,
3736
) => {
38-
const outputFile = path.join(
39-
izabelaServer.getConfig().tempPath,
40-
uuid() + '.mp3',
41-
)
37+
const outputFile = path.join(config?.tempPath || '', uuid() + '.mp3')
4238
try {
4339
fs.mkdirSync(path.parse(outputFile).dir, { recursive: true })
4440
fs.writeFileSync(outputFile, '')

apps/app-server/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import bodyParser from 'body-parser'
33
import cors from 'cors'
44
import logger from 'morgan'
55
import path from 'path'
6-
import { defaultsDeep } from 'lodash'
6+
import defaultsDeep from 'lodash/defaultsDeep'
77
import * as plugins from './plugins'
88
import websocket from './websocket'
99

apps/app-server/tsconfig.json

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
11
{
2-
"compilerOptions": {
3-
"target": "ESNext",
4-
"useDefineForClassFields": true,
5-
"module": "ESNext",
6-
"lib": ["ESNext", "DOM"],
7-
"moduleResolution": "Node",
8-
"strict": true,
9-
"sourceMap": true,
10-
"resolveJsonModule": true,
11-
"isolatedModules": true,
12-
"esModuleInterop": true,
13-
"noEmit": true,
14-
"noUnusedLocals": true,
15-
"noUnusedParameters": true,
16-
"noImplicitReturns": true,
17-
"skipLibCheck": true
18-
},
2+
"extends": "../../tsconfig.base.json",
193
"include": ["src"]
204
}

apps/app/.browserslistrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

apps/app/.editorconfig

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/app/.env

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
VUE_APP_ENCRYPTION_KEY=
2-
VUE_APP_SERVER_PORT=7070
3-
VUE_APP_SERVER_WS_PORT=7071
1+
VITE_ENCRYPTION_KEY=
2+
VITE_SERVER_PORT=7070
3+
VITE_SERVER_WS_PORT=7071
4+
VITE_ELECTRON_NODE_INTEGRATION=0

apps/app/.eslintrc.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

apps/app/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ pnpm-debug.log*
2525
*.njsproj
2626
*.sln
2727
*.sw?
28-
/dist_electron/
28+
dist_electron
29+
dist-electron

apps/app/babel.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

apps/app/config/storybook/main.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

apps/app/config/storybook/preview.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/app/cypress.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/app/electron-builder.config.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* @see https://www.electron.build/configuration/configuration
3+
*/
4+
const path = require('path')
5+
const fs = require('fs')
6+
const pkg = require('./package.json')
7+
8+
function getElectronVersion() {
9+
const electronPath = require.resolve('electron')
10+
11+
const data = fs.readFileSync(path.join(electronPath, '..', 'package.json'))
12+
const version = JSON.parse(data.toString())?.version
13+
return version
14+
}
15+
16+
/**
17+
* @type {import('electron-builder').Configuration}
18+
* @see https://www.electron.build/configuration/configuration
19+
*/
20+
module.exports = {
21+
$schema:
22+
'https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json',
23+
asar: true,
24+
productName: pkg.productName,
25+
directories: {
26+
output: 'dist_electron',
27+
},
28+
files: ['dist', 'dist-electron'],
29+
nsis: {
30+
oneClick: true,
31+
perMachine: false,
32+
allowToChangeInstallationDirectory: false,
33+
deleteAppDataOnUninstall: false,
34+
},
35+
appId: 'com.nhs.izabela',
36+
generateUpdatesFilesForAllChannels: true,
37+
// eslint-disable-next-line no-template-curly-in-string
38+
artifactName: '${name}-setup-${version}-${os}.${ext}',
39+
publish: ['github'],
40+
electronVersion: getElectronVersion(),
41+
extraFiles: ['./resources/**'],
42+
}

0 commit comments

Comments
 (0)