refactor: Update import statements for CommonUI to use Common/UI

This commit is contained in:
Simon Larsen
2024-08-07 16:14:31 -06:00
parent 3eb6f4da5f
commit 86e5a33bd9
40 changed files with 47 additions and 85 deletions

View File

@@ -1,22 +0,0 @@
name: Common Server Test
on:
pull_request:
push:
branches-ignore:
- 'hotfix-*' # excludes hotfix branches
- 'release'
jobs:
test:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: cd Common && npm install
- run: cd CommonServer && bash test-setup.sh
- run: export $(grep -v '^#' config.env | xargs) && cd CommonServer && rm -rf build && npm run test

View File

@@ -17,5 +17,6 @@ jobs:
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
with: with:
node-version: 18.3.0 node-version: 18.3.0
- run: cd Common/Tests && bash test-setup.sh
- run: cd Common && npm install && npm run test - run: cd Common && npm install && npm run test

View File

@@ -51,6 +51,3 @@ licenses/*
certifications/* certifications/*
ApiReference/public/assets/* ApiReference/public/assets/*
JavaScriptSDK/src/cli/server-monitor/out/scripts/prettify/* JavaScriptSDK/src/cli/server-monitor/out/scripts/prettify/*
CommonServer/Tests/TestingUtils/__mocks__/Stripe.mock.ts

4
.vscode/launch.json vendored
View File

@@ -218,12 +218,12 @@
"autoAttachChildProcesses": true "autoAttachChildProcesses": true
}, },
{ {
"name": "CommonServer: Debug Tests", "name": "Common: Debug Tests",
"type": "node", "type": "node",
"restart": true, "restart": true,
"autoAttachChildProcesses": true, "autoAttachChildProcesses": true,
"request": "launch", "request": "launch",
"cwd": "${workspaceRoot}/CommonServer", "cwd": "${workspaceRoot}/Common",
"runtimeExecutable": "npm", "runtimeExecutable": "npm",
"runtimeArgs": [ "runtimeArgs": [
"run-script", "run-script",

View File

@@ -9,7 +9,7 @@
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"css-loader": "^6.11.0", "css-loader": "^6.11.0",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"express": "^4.19.2", "express": "^4.19.2",

View File

@@ -27,7 +27,6 @@
}, },
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"css-loader": "^6.11.0", "css-loader": "^6.11.0",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"express": "^4.19.2", "express": "^4.19.2",

View File

@@ -9,7 +9,7 @@
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"react": "^18.3.1", "react": "^18.3.1",

View File

@@ -5,7 +5,6 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"react": "^18.3.1", "react": "^18.3.1",

View File

@@ -1,5 +1,5 @@
{ {
"watch": ["./","../Common", "../CommonServer", "../Model"], "watch": ["./","../Common"],
"ext": "ts,json,tsx,env,js,jsx,hbs", "ext": "ts,json,tsx,env,js,jsx,hbs",
"ignore": [ "ignore": [
"greenlock.d/*" "greenlock.d/*"

1
App/package-lock.json generated
View File

@@ -11,7 +11,6 @@
"dependencies": { "dependencies": {
"@sendgrid/mail": "^8.1.0", "@sendgrid/mail": "^8.1.0",
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.9", "ejs": "^3.1.9",
"handlebars": "^4.7.8", "handlebars": "^4.7.8",
"nodemailer": "^6.9.7", "nodemailer": "^6.9.7",

View File

@@ -19,7 +19,7 @@
"@sendgrid/mail": "^8.1.0", "@sendgrid/mail": "^8.1.0",
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.9", "ejs": "^3.1.9",
"handlebars": "^4.7.8", "handlebars": "^4.7.8",
"nodemailer": "^6.9.7", "nodemailer": "^6.9.7",

View File

@@ -12,7 +12,7 @@ if (Env === AppEnvironment.Development || Env === AppEnvironment.Test) {
path: "../Common/.env", path: "../Common/.env",
}); });
dotenv.config({ dotenv.config({
path: "../CommonServer/.env", path: "../Common/Server/.env",
}); });
dotenv.config({ dotenv.config({
path: "./.env", path: "./.env",

View File

@@ -1,5 +1,5 @@
import "../../../Server/Utils/Environment"; import "../../../Server/Utils/Environment";
// Env vars are actually changed in CommonServer/test-setup.sh // Env vars are actually changed in Common/Server/test-setup.sh
process.env["NODE_ENV"] = "test"; process.env["NODE_ENV"] = "test";

View File

@@ -1,9 +1,7 @@
{ {
"watch": [ "watch": [
"./", "./",
"../Common", "../Common"
"../CommonServer",
"../Model"
], ],
"ext": "ts,json,tsx,env,js,jsx,hbs", "ext": "ts,json,tsx,env,js,jsx,hbs",
"exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts"

View File

@@ -11,7 +11,7 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"Model": "file:../Model", "Model": "file:../Model",
"openai": "^4.52.5", "openai": "^4.52.5",

View File

@@ -17,7 +17,6 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"openai": "^4.52.5", "openai": "^4.52.5",
"ts-node": "^10.9.1" "ts-node": "^10.9.1"

View File

@@ -11,7 +11,7 @@
"@stripe/react-stripe-js": "^1.15.0", "@stripe/react-stripe-js": "^1.15.0",
"@stripe/stripe-js": "^1.44.1", "@stripe/stripe-js": "^1.44.1",
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"react": "^18.3.1", "react": "^18.3.1",

View File

@@ -32,7 +32,6 @@
"@stripe/stripe-js": "^1.44.1", "@stripe/stripe-js": "^1.44.1",
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"react": "^18.3.1", "react": "^18.3.1",

View File

@@ -1,5 +1,5 @@
{ {
"watch": ["./","../Common", "../CommonServer", "../Model"], "watch": ["./","../Common"],
"ext": "ts,json,tsx,env,js,jsx,hbs", "ext": "ts,json,tsx,env,js,jsx,hbs",
"exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts"
} }

View File

@@ -10,7 +10,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"Model": "file:../Model", "Model": "file:../Model",
"protobufjs": "^7.3.2", "protobufjs": "^7.3.2",

View File

@@ -17,7 +17,6 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"protobufjs": "^7.3.2", "protobufjs": "^7.3.2",
"ts-node": "^10.9.1" "ts-node": "^10.9.1"

View File

@@ -1,5 +1,5 @@
{ {
"watch": ["./","../Common", "../CommonServer", "../Model"], "watch": ["./","../Common"],
"ext": "ts,json,tsx,env,js,jsx,hbs", "ext": "ts,json,tsx,env,js,jsx,hbs",
"exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts"
} }

View File

@@ -11,7 +11,7 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ts-node": "^10.9.1" "ts-node": "^10.9.1"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -17,7 +17,6 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ts-node": "^10.9.1" "ts-node": "^10.9.1"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -10,7 +10,6 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ts-node": "^10.9.1" "ts-node": "^10.9.1"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -14,7 +14,7 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ts-node": "^10.9.1" "ts-node": "^10.9.1"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -1,5 +1,5 @@
{ {
"watch": ["./","../Common", "../CommonServer", "../Model"], "watch": ["./","../Common"],
"ext": "ts,json,tsx,env,js,jsx,hbs", "ext": "ts,json,tsx,env,js,jsx,hbs",
"exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts"
} }

View File

@@ -12,7 +12,6 @@
"@types/ping": "^0.4.4", "@types/ping": "^0.4.4",
"axios": "^1.7.2", "axios": "^1.7.2",
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"ping": "^0.4.4", "ping": "^0.4.4",
"playwright": "^1.45.1", "playwright": "^1.45.1",

View File

@@ -21,7 +21,7 @@
"axios": "^1.7.2", "axios": "^1.7.2",
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"ping": "^0.4.4", "ping": "^0.4.4",
"playwright": "1.45.1", "playwright": "1.45.1",

View File

@@ -11,7 +11,6 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"ts-node": "^10.9.2" "ts-node": "^10.9.2"
}, },

View File

@@ -8,7 +8,7 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"ts-node": "^10.9.2" "ts-node": "^10.9.2"
}, },

View File

@@ -9,7 +9,6 @@
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"css-loader": "^6.11.0", "css-loader": "^6.11.0",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"express": "^4.19.2", "express": "^4.19.2",

View File

@@ -29,7 +29,7 @@
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"css-loader": "^6.11.0", "css-loader": "^6.11.0",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"express": "^4.19.2", "express": "^4.19.2",

View File

@@ -1,5 +1,5 @@
{ {
"watch": ["./","../Common", "../CommonServer", "../Model"], "watch": ["./","../Common"],
"ext": "ts,json,tsx,env,js,jsx,hbs", "ext": "ts,json,tsx,env,js,jsx,hbs",
"exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts"
} }

View File

@@ -10,7 +10,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"ts-node": "^10.9.1" "ts-node": "^10.9.1"
}, },

View File

@@ -17,7 +17,6 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"Common": "file:../Common", "Common": "file:../Common",
"CommonServer": "file:../CommonServer",
"ejs": "^3.1.10", "ejs": "^3.1.10",
"ts-node": "^10.9.1" "ts-node": "^10.9.1"
}, },

View File

@@ -57,9 +57,9 @@ services:
- /usr/src/app/dev-env - /usr/src/app/dev-env
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
build: build:
network: host network: host
@@ -80,9 +80,9 @@ services:
- /usr/src/app/dev-env - /usr/src/app/dev-env
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
build: build:
network: host network: host
@@ -104,9 +104,9 @@ services:
- /usr/src/app/dev-env - /usr/src/app/dev-env
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
build: build:
network: host network: host
@@ -127,9 +127,9 @@ services:
- /usr/src/app/dev-env - /usr/src/app/dev-env
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
build: build:
network: host network: host
@@ -144,9 +144,9 @@ services:
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
extends: extends:
file: ./docker-compose.base.yml file: ./docker-compose.base.yml
@@ -167,9 +167,9 @@ services:
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
extends: extends:
file: ./docker-compose.base.yml file: ./docker-compose.base.yml
@@ -189,9 +189,9 @@ services:
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
extends: extends:
file: ./docker-compose.base.yml file: ./docker-compose.base.yml
@@ -210,9 +210,9 @@ services:
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
extends: extends:
file: ./docker-compose.base.yml file: ./docker-compose.base.yml
@@ -231,9 +231,9 @@ services:
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
ports: ports:
- '9974:9229' # Debugging port. - '9974:9229' # Debugging port.
@@ -252,9 +252,9 @@ services:
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
ports: ports:
- '9932:9229' # Debugging port. - '9932:9229' # Debugging port.
@@ -314,9 +314,9 @@ services:
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/ - /usr/src/app/node_modules/
- ./Common:/usr/src/Common - ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- /usr/src/Common/node_modules/ - /usr/src/Common/node_modules/
- /usr/src/CommonServer/node_modules/
ports: ports:
- '9985:9229' # Debugging port. - '9985:9229' # Debugging port.

View File

@@ -5,4 +5,4 @@ export DATABASE_HOST=$DATABASE_MIGRATIONS_HOST
export DATABASE_PORT=$DATABASE_MIGRATIONS_PORT export DATABASE_PORT=$DATABASE_MIGRATIONS_PORT
sudo npm i -g ts-node sudo npm i -g ts-node
npx typeorm-ts-node-esm migration:run --dataSource=./CommonServer/Infrastructure/PostgresConfig.ts npx typeorm-ts-node-esm migration:run --dataSource=./Common/Server/Infrastructure/PostgresConfig.ts

View File

@@ -70,7 +70,7 @@
"deploy-test": "kubectl config use-context oneuptime-test && helm upgrade oneuptime ./HelmChart/Public/oneuptime -f ./HelmChart/Public/oneuptime/values.yaml -f ./HelmChart/Values/test.values.yaml", "deploy-test": "kubectl config use-context oneuptime-test && helm upgrade oneuptime ./HelmChart/Public/oneuptime -f ./HelmChart/Public/oneuptime/values.yaml -f ./HelmChart/Values/test.values.yaml",
"template-deploy-test": "kubectl config use-context oneuptime-test && helm template oneuptime ./HelmChart/Public/oneuptime -f ./HelmChart/Public/oneuptime/values.yaml -f ./HelmChart/Values/test.values.yaml --debug", "template-deploy-test": "kubectl config use-context oneuptime-test && helm template oneuptime ./HelmChart/Public/oneuptime -f ./HelmChart/Public/oneuptime/values.yaml -f ./HelmChart/Values/test.values.yaml --debug",
"deploy-prod": "kubectl config use-context oneuptime-prod && helm upgrade oneuptime ./HelmChart/Public/oneuptime -f ./HelmChart/Public/oneuptime/values.yaml -f ./HelmChart/Values/prod.values.yaml", "deploy-prod": "kubectl config use-context oneuptime-prod && helm upgrade oneuptime ./HelmChart/Public/oneuptime -f ./HelmChart/Public/oneuptime/values.yaml -f ./HelmChart/Values/prod.values.yaml",
"generate-postgres-migration": "export $(grep -v '^#' config.env | xargs) && node --require ts-node/register ./node_modules/typeorm/cli.js migration:generate ./CommonServer/Infrastructure/Postgres/SchemaMigrations/MigrationName -d ./CommonServer/Infrastructure/Postgres/LocalMigrationGenerationDataSource.ts" "generate-postgres-migration": "export $(grep -v '^#' config.env | xargs) && node --require ts-node/register ./node_modules/typeorm/cli.js migration:generate ./Common/Server/Infrastructure/Postgres/SchemaMigrations/MigrationName -d ./Common/Server/Infrastructure/Postgres/LocalMigrationGenerationDataSource.ts"
}, },
"repository": { "repository": {
"type": "git", "type": "git",