Skip to content

Commit

Permalink
NV 3673 add cli mvp test suite (#5547)
Browse files Browse the repository at this point in the history
* refactor(echo-cli,echo-sdk): relocate to monorepo

* Merge remote-tracking branch 'origin/next' into NV-3670/relocate-echo-packages-to-the-monorepo

* fix: lock file conflict

* feat: test pipeline

* feat: lock file conflict

* fix: spell and eslint command

* fix: spell disable block

* fix: jest export

* test: fix sdk tests

* feat: remove insecure domain

* fix: update c spell comment

* test(wip): initial addition of test suite

* test(wip): initial addition of test suite

* fix: update c spell comment

* test(wip): ignore console warnings

* test(wip): try without cspell ignore

* test(wip): disable cspell

* fix: update c spell comment

* fix: update c spell comment

* feat: create reusable logo

* refactor: remove redundant code

* fix(next-cli): studio npm hoist packages

* feat(cli-next): add cli tests suit

* fix(cli-next): remove redundant code after next merge

---------

Co-authored-by: ainouzgali <[email protected]>
  • Loading branch information
djabarovgeorge and ainouzgali authored May 12, 2024
1 parent 5e2dd95 commit 7f888d0
Show file tree
Hide file tree
Showing 33 changed files with 1,351 additions and 2,997 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
auto-install-peers=true
strict-peer-dependencies=false
fetch-retry-maxtimeout=10000

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"prepare": "husky install",
"publish": "lerna publish from-package",
"setup:project": "npx --yes [email protected] i && node scripts/setup-env-files.js && pnpm build",
"clean": "lerna clean --yes && npm run prebuild",
"clean": "lerna clean --yes && npm run prebuild && rimraf node_modules",
"commit": "cz",
"nx": "nx",
"lint-staged": "lint-staged",
Expand Down
1 change: 0 additions & 1 deletion packages/cli-next/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,
coverageProvider: 'v8',
preset: 'ts-jest',
Expand Down
10 changes: 7 additions & 3 deletions packages/cli-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
"start": "pnpm start:dev",
"test": "jest",
"lint": "eslint src --ext .ts",
"lint:fix":"eslint src --ext .ts --fix",
"lint:fix": "eslint src --ext .ts --fix",
"start:sync": "cross-env NODE_ENV=development TZ=UTC nodemon sync --backend-url=http://localhost:3000 --echo-url=http://localhost:4000/api --api-key=9185a6719c99faa9142b08c94e3b65ca",
"start:dev": "cross-env NODE_ENV=development NOVU_EMBED_PATH=http://127.0.0.1:4701/embed.umd.min.js NOVU_API_ADDRESS=http://127.0.0.1:3000 NOVU_CLIENT_LOGIN=http://127.0.0.1:4200/auth/login CLI_SEGMENT_WRITE_KEY=GdQ594CEBj4pU6RFldDOjKJwZjxZOsIj TZ=UTC nodemon echo",
"start:dev:echo": "cross-env NODE_ENV=test CLI_SEGMENT_WRITE_KEY=GdQ594CEBj4pU6RFldDOjKJwZjxZOsIj TZ=UTC nodemon echo",
"start:dev:sync": "cross-env NODE_ENV=development TZ=UTC nodemon sync --backend-url=http://localhost:3000 --echo-url=http://localhost:4000/api --api-key=9185a6719c99faa9142b08c94e3b65ca",
"start:test": "cross-env NODE_ENV=test PORT=1336 TZ=UTC nodemon init",
"start:debug": "cross-env TZ=UTC nodemon --config nodemon-debug.json",
"start:prod": "cross-env TZ=UTC node dist/index.js",
Expand All @@ -32,13 +34,12 @@
"devDependencies": {
"@types/configstore": "^5.0.1",
"@types/inquirer": "^8.2.0",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.12",
"@types/mocha": "10.0.2",
"eslint-config-adjunct": "^4.13.0",
"ncp": "^2.0.0",
"nodemon": "^3.0.1",
"rimraf": "^5.0.5",
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"ts-node": "~10.9.1",
Expand All @@ -61,5 +62,8 @@
"jwt-decode": "^3.1.2",
"open": "^8.4.2",
"uuid": "^9.0.0"
},
"peerDependencies": {
"next": "14.1.0"
}
}
17 changes: 0 additions & 17 deletions packages/cli-next/src/api/api.service.ts

This file was deleted.

17 changes: 0 additions & 17 deletions packages/cli-next/src/api/auth.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/cli-next/src/api/environment.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/cli-next/src/api/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/cli-next/src/api/notification-groups.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/cli-next/src/api/notification-templates.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/cli-next/src/api/organization.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/cli-next/src/client/cli.client.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/cli-next/src/client/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import chalk from 'chalk';
import gradient from 'gradient-string';

const { createServer } = require('http');
const { parse } = require('url');
const next = require('next');
const getPort = require('get-port');
import * as process from 'process';
import open from 'open';
import { logo } from './constants';

import { logo } from '../constants';

export const showWelcomeScreen = (): void => {
const textGradient = gradient('#0099F7', '#ff3432');
Expand All @@ -22,7 +22,7 @@ export const showWelcomeScreen = (): void => {
/* eslint-enable no-console */
};

export async function startStudio(anonymousId: string, requestedPort = 2022) {
export async function echo(anonymousId: string, requestedPort = 2022) {
await showWelcomeScreen();
const dev = false;
const hostname = 'localhost';
Expand Down
3 changes: 2 additions & 1 deletion packages/cli-next/src/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './init';
export * from './sync';
export * from './echo';
191 changes: 0 additions & 191 deletions packages/cli-next/src/commands/init.consts.ts

This file was deleted.

Loading

0 comments on commit 7f888d0

Please sign in to comment.