Skip to content

Commit

Permalink
feat: SB-840 Extract CRUD demo routes and utils to separate package.
Browse files Browse the repository at this point in the history
* feat: SB-840 Extract crud demo item routes to a separate package

* feat: SB-840 Extract notifications into separate package

* Add new packages to bb pipelines

* Refactor rendering and storybook utils

* Merge branch 'release/2.0.0' of bitbucket.org:apptension/saas-boilerplate-app into feature/SB-840-extract-crud-demo

* Fix typescript errors in status-dashboard


Approved-by: Michał Kleszcz
  • Loading branch information
pziemkowski committed Mar 21, 2023
1 parent 1b1606f commit 02a7a78
Show file tree
Hide file tree
Showing 185 changed files with 2,511 additions and 614 deletions.
42 changes: 42 additions & 0 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ definitions:
pnpmwebappcore: $BITBUCKET_CLONE_DIR/.pnpm-store
pnpmwebappapiclient: $BITBUCKET_CLONE_DIR/.pnpm-store
pnpmwebappcontentful: $BITBUCKET_CLONE_DIR/.pnpm-store
pnpmwebappcruddemo: $BITBUCKET_CLONE_DIR/.pnpm-store
pnpmwebappnotifications: $BITBUCKET_CLONE_DIR/.pnpm-store
pnpmworkers: $BITBUCKET_CLONE_DIR/.pnpm-store
pnpminfracore: $BITBUCKET_CLONE_DIR/.pnpm-store
pnpminfrashared: $BITBUCKET_CLONE_DIR/.pnpm-store
Expand Down Expand Up @@ -139,6 +141,46 @@ pipelines:
- pnpmwebappcontentful
- clis
- sonar
- step:
name: 'webapp-crud-demo: Lint & test'
image: atlassian/default-image:4
size: 2x
script:
- *initializeStep
- pnpm install
--include-workspace-root
--frozen-lockfile
--filter=webapp-crud-demo...
- node_modules/.bin/nx run webapp-crud-demo:lint
- node_modules/.bin/nx run webapp-crud-demo:test --watchAll=false --maxWorkers=20% --coverage
- pipe: sonarsource/sonarcloud-scan:1.4.0
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
EXTRA_ARGS: '-Dsonar.projectBaseDir=packages/webapp-libs/webapp-crud-demo'
caches:
- pnpmwebappcruddemo
- clis
- sonar
- step:
name: 'webapp-notifications: Lint & test'
image: atlassian/default-image:4
size: 2x
script:
- *initializeStep
- pnpm install
--include-workspace-root
--frozen-lockfile
--filter=webapp-notifications...
- node_modules/.bin/nx run webapp-notifications:lint
- node_modules/.bin/nx run webapp-notifications:test --watchAll=false --maxWorkers=20% --coverage
- pipe: sonarsource/sonarcloud-scan:1.4.0
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
EXTRA_ARGS: '-Dsonar.projectBaseDir=packages/webapp-libs/webapp-notifications'
caches:
- pnpmwebappnotifications
- clis
- sonar
- step:
name: 'backend: Build image & run tests'
image: atlassian/default-image:3
Expand Down
37 changes: 34 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,67 @@
"prepare": "husky install"
},
"devDependencies": {
"@babel/preset-react": "^7.14.5",
"@nrwl/devkit": "15.6.3",
"@nrwl/eslint-plugin-nx": "^15.6.3",
"@nrwl/jest": "15.5.3",
"@nrwl/js": "15.6.3",
"@nrwl/jest": "^15.6.3",
"@nrwl/linter": "15.6.3",
"@nrwl/node": "^15.6.3",
"@nrwl/nx-cloud": "^15.0.2",
"@nrwl/nx-plugin": "^15.6.3",
"@nrwl/react": "15.5.3",
"@nrwl/web": "15.5.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@sb/core": "*",
"@svgr/webpack": "^6.1.2",
"@swc-node/register": "^1.4.2",
"@swc/cli": "~0.1.55",
"@swc/core": "^1.2.173",
"@swc/helpers": "~0.4.11",
"@testing-library/react": "13.4.0",
"@types/jest": "28.1.1",
"@types/node": "16.11.7",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.9",
"@types/react-is": "17.0.3",
"@types/react-router-dom": "5.3.3",
"@types/styled-components": "5.1.26",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"babel-jest": "28.1.1",
"babel-plugin-relay": "^14.1.0",
"babel-plugin-styled-components": "1.10.7",
"env-cmd": "^10.1.0",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "npm:eslint-plugin-i@^2.26.0",
"eslint-plugin-cypress": "^2.10.3",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsx-a11y": "6.6.1",
"eslint-plugin-react": "7.31.11",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "^8.0.0",
"jest": "28.1.1",
"jest-environment-jsdom": "28.1.1",
"jsonc-eslint-parser": "^2.1.0",
"lint-staged": "^10.5.4",
"nx": "^15.4.5",
"prettier": "^2.6.2",
"react-refresh": "^0.10.0",
"react-test-renderer": "18.2.0",
"ts-jest": "28.0.5",
"ts-node": "10.9.1",
"tsconfig-paths": "^4.1.2",
"tslib": "^2.3.0",
"typescript": "~4.8.2"
"typescript": "~4.8.2",
"url-loader": "^4.1.1"
},
"dependencies": {
"react": "18.2.0",
"react-dom": "18.2.0",
"react-is": "18.2.0",
"react-router-dom": "6.4.3",
"styled-components": "5.3.6"
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
import { useEffect, useState } from 'react';

type Version = unknown;
type VersionValue = {
label: string;
value: string;
};

type Version = {
envs: Array<{
name: string;
version: string;
builtAt: string;
values: VersionValue[];
}>;
services: Record<
string,
Array<{
name: string;
version: string;
builtAt: string;
values: VersionValue[];
}>
>;
};

export const useFetchVersions = () => {
const [versions, setVersions] = useState<Version[]>([]);
const [versions, setVersions] = useState<Version>({ envs: [], services: {} });
const [isFetching, setIsFetching] = useState(false);
const [error, setError] = useState<Error | undefined>(undefined);

Expand Down
5 changes: 1 addition & 4 deletions packages/webapp-libs/webapp-api-client/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ export default {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/react/babel'] }],
},
transformIgnorePatterns: ['/node_modules/(?!(@iconify-icons|react-markdown)/)'],
transformIgnorePatterns: ['/node_modules/(?!(@iconify-icons|@sb)/)'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
moduleNameMapper: {
'react-markdown': '<rootDir>/node_modules/react-markdown/react-markdown.min.js',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageReporters: ['lcov'],
coveragePathIgnorePatterns: ['/node_modules/', '.*.svg'],
Expand Down
2 changes: 2 additions & 0 deletions packages/webapp-libs/webapp-api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@apollo/client": "^3.7.9",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.34.0",
"graphql": "^16.6.0",
"ramda": "^0.28.0",
"@storybook/react": "^6.5.16",
Expand Down Expand Up @@ -68,6 +69,7 @@
"jest-matcher-utils": "^29.4.2",
"jest-watch-typeahead": "^2.2.2",
"react": "18.2.0",
"react-hook-form": "^7.34.0",
"ramda": "^0.28.0",
"ts-jest": "28.0.5",
"msw": "^1.0.0"
Expand Down
Loading

0 comments on commit 02a7a78

Please sign in to comment.