Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/update packages #1467

Merged
merged 9 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,27 @@ jobs:
working-directory: example/

- name: Pull docker images
run: docker-compose pull
Copy link
Contributor Author

@awesthouse awesthouse Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/orgs/community/discussions/116610#discussioncomment-8997411

Might be a better solution for this, but this does the trick. Looks like this has been broken for a while now + this will hopefully fix our healthcheck that has never worked

run: docker compose pull
working-directory: example/

- name: Run docker images
env:
ENVIRONMENT: CI
run: docker-compose up -d
run: docker compose up -d
working-directory: example/

- name: Capture output DMSS version
id: capture_dmss_version
run: |
docker-compose exec -t dmss cat src/version.txt > dmss_version.txt
docker compose exec -t dmss cat src/version.txt > dmss_version.txt
dmss_version=$(tail -n 1 dmss_version.txt)
echo "dmss_version=$dmss_version" >> "$GITHUB_OUTPUT"
working-directory: example/

- name: Capture job-api version
id: capture_job_version
run: |
docker-compose exec -t job-api cat version.txt > job_version.txt
docker compose exec -t job-api cat version.txt > job_version.txt
job_version=$(tail -n 1 job_version.txt)
echo "job_version=$job_version" >> "$GITHUB_OUTPUT"
working-directory: example/
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
rev: "v0.1.0"
hooks:
- id: biome-check
additional_dependencies: [ "@biomejs/biome@1.4.1" ]
additional_dependencies: [ "@biomejs/biome@1.9.4" ]

- repo: local
hooks:
Expand Down
7 changes: 2 additions & 5 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"files": {
"ignore": [
"packages/dm-core/src/services/api/configs/**",
Expand All @@ -18,7 +18,7 @@
"indentWidth": 2,
"jsxQuoteStyle": "single",
"quoteStyle": "single",
"trailingComma": "es5"
"trailingCommas": "es5"
}
},
"json": {
Expand All @@ -37,9 +37,6 @@
],
"enabled": true,
"rules": {
"nursery": {
"noUnusedImports": "error"
},
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/plugin-form-Nested.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page, expect, test } from '@playwright/test'
import { type Page, expect, test } from '@playwright/test'

test.describe.configure({ mode: 'serial' })

Expand Down
6 changes: 4 additions & 2 deletions e2e/tests/plugin-view_selector-car_garage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ test('View selector - car garage', async ({ page }) => {
page.getByRole('tab', { name: 'car Dimensions' })
).toBeVisible()

await page.getByTestId('form-text-widget-Next control date').last()
await page
.getByTestId('form-text-widget-Next control date')
.last()

.fill('2025-06-31')
.fill('2025-06-31')
await page.getByRole('button', { name: 'Submit' }).click()
await expect(page.getByRole('alert')).toHaveText(['Document updated'])
await page
Expand Down
8 changes: 2 additions & 6 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "../tsconfig.json",
"include": [
"tests"
],
"exclude": [
"node_modules"
]
"include": ["tests"],
"exclude": ["node_modules"]
}
54 changes: 25 additions & 29 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@development-framework/dm-core": "^1.3.3",
"@development-framework/dm-core-plugins": "^1.3.3",
"plotly.js": "^2.18.2",
"@development-framework/dm-core": "^1.46.0",
"@development-framework/dm-core-plugins": "^1.57.0",
"plotly.js": "^2.35.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-oauth2-code-pkce": "^1.10.1",
"react-oauth2-code-pkce": "^1.22.2",
"react-plotly.js": "^2.6.0",
"react-router-dom": "^6.21.2",
"react-toastify": "9.1.3",
"styled-components": "^5.3.11",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.0.0"
"react-router-dom": "^7.0.2",
"react-toastify": "10.0.6",
"styled-components": "^6.1.13",
"ts-node": "^10.9.2",
"tsconfig-paths-webpack-plugin": "^4.2.0"
},
"devDependencies": {
"@biomejs/biome": "1.4.1",
"@types/node": "^20.10.0",
"@types/react": "^18.2.8",
"@types/react-dom": "^18.2.7",
"@types/react-plotly.js": "^2.6.0",
"@biomejs/biome": "1.9.4",
"@types/node": "^20.10.2",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@types/react-plotly.js": "^2.6.3",
"@types/react-router-dom": "^5.3.3",
"@types/styled-components": "^5.1.26",
"@vitejs/plugin-react-swc": "^3.3.2",
"serve": "14.2.1",
"typescript": "^5.2.2",
"vite": "^5.0.0",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.2.1",
"vitest": "^0.34.6"
"@types/styled-components": "^5.1.34",
"@vitejs/plugin-react-swc": "^3.7.2",
"serve": "14.2.4",
"typescript": "^5.7.2",
"vite": "^6.0.3",
"vite-plugin-checker": "^0.8.0",
"vite-plugin-svgr": "^4.3.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8"
},
"scripts": {
"start": "vite",
"build": "vite build -d",
"lint": "biome lint . --apply",
"lint": "biome lint . --write",
"preview": "vite preview",
"serve": "serve -s dist -p 3000 --no-clipboard",
"test": "vitest",
Expand All @@ -45,11 +45,7 @@
"remove-symlinks": "for package in ../packages/*/; do echo $package && rm -rf dist && cd ../example; done"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"production": [">0.2%", "not dead", "not op_mini all"],
"development": [
"last 1 chrome version",
"last 1 firefox version",
Expand Down
6 changes: 3 additions & 3 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {
DMApplicationProvider,
DmssAPI,
EntityView,
ErrorResponse,
TApplication,
type ErrorResponse,
type TApplication,
} from '@development-framework/dm-core'
import { Button, Card, Icon, Typography } from '@equinor/eds-core-react'
import { refresh } from '@equinor/eds-icons'

import { AxiosError } from 'axios'
import type { AxiosError } from 'axios'
import { useContext, useEffect, useState } from 'react'
import { RouterProvider, createBrowserRouter } from 'react-router-dom'
import ViewPage from './ViewPage'
Expand Down
2 changes: 1 addition & 1 deletion example/src/ViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
EntityView,
ErrorGroup,
Loading,
TValidEntity,
type TValidEntity,
useDocument,
} from '@development-framework/dm-core'
import { Typography } from '@equinor/eds-core-react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
IUIPlugin,
type IUIPlugin,
Loading,
TGenericObject,
type TGenericObject,
useDocument,
} from '@development-framework/dm-core'
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { chevron_left, chevron_right } from '@equinor/eds-icons'
import { useState } from 'react'

import {
IUIPlugin,
type IUIPlugin,
Loading,
TGenericObject,
type TGenericObject,
useDocument,
} from '@development-framework/dm-core'
import { PaginationWrapper, SectionWrapper } from './styles'
Expand Down Expand Up @@ -86,6 +86,7 @@ const SignalTable = (props: { document: TGenericObject }) => {
{rows
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
.map((row: any) => (
// biome-ignore lint/a11y/useSemanticElements: <explanation>
<Table.Row role='checkbox' tabIndex={-1} key={row.index}>
{columns.map((column) => {
const value = row[column.id]
Expand Down
6 changes: 3 additions & 3 deletions example/src/plugins/marmo-ui/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { TUiPluginMap } from '@development-framework/dm-core'
import type { TUiPluginMap } from '@development-framework/dm-core'

//views
import { SignalPlot } from './containers/views/SignalPlot'
import { SignalTable } from './containers/views/SignalTable/SignalTable'

export default ({
export default {
'marmo-ess-plot-view': {
component: SignalPlot,
},
'marmo-ess-table-view': {
component: SignalTable,
},
} as TUiPluginMap)
} as TUiPluginMap
25 changes: 5 additions & 20 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
"baseUrl": "./src",
"incremental": true,
"paths": {
"@development-framework/dm-core/*": [
"../packages/dm-core/src/*"
],
"@development-framework/dm-core/*": ["../packages/dm-core/src/*"],
"@development-framework/dm-core-plugins/*": [
"../packages/dm-core-plugins/src/*"
]
},
"target": "ESNext",
"useDefineForClassFields": true,
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": false,
Expand All @@ -30,17 +24,8 @@
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"types": [
"vite/client",
"vite-plugin-svgr/client",
"node"
]
"types": ["vite/client", "vite-plugin-svgr/client", "node"]
},
"include": [
"src"
],
"exclude": [
"node_modules",
"tsconfig.tsbuildinfo"
]
"include": ["src"],
"exclude": ["node_modules", "tsconfig.tsbuildinfo"]
}
2 changes: 1 addition & 1 deletion example/vite.config.ts → example/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from 'vite'
import checker from 'vite-plugin-checker'
import svgrPlugin from 'vite-plugin-svgr'
import viteTsConfigPaths from 'vite-tsconfig-paths'
import { localConfig } from './vite.local.config'
import { localConfig } from './vite.local.config.mjs'

export default defineConfig({
base: '/',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as path from 'path'
import * as path from 'node:path'

export const localConfig = () => {
if ((process.env.ALIAS || 'on').trim() === 'on') {
Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"private": true,
"workspaces": [
"example",
"packages/dm-core",
"packages/dm-core-plugins"
],
"workspaces": ["example", "packages/dm-core", "packages/dm-core-plugins"],
"scripts": {
"start:example": "yarn workspace example start",
"build:dm-core": "yarn workspace @development-framework/dm-core build",
Expand Down
Loading
Loading