Skip to content

Commit

Permalink
Adds script to load ADRs from original path
Browse files Browse the repository at this point in the history
* Moves ADRs back to their original path, at `doc/adr`.
* Adds a script that copies the ADRs to a folder inside the project. The
  script runs automatically when the user starts the project with `yarn
  dev`.

Before copying files the script compares folders and only copies folders
and files that are missing.

The script runs synchronously, so the project only starts after the ADRs
have been synched.

This commit allows the ADRs to be kept in their original folder in
`theia-trace-extension`, as requested.

Signed-off-by: Rodrigo Pinto <rodrigo.pinto@calian.ca>
  • Loading branch information
Rodrigoplp-work committed Jan 19, 2023
1 parent 2d2e59f commit 6a6e43c
Show file tree
Hide file tree
Showing 22 changed files with 83 additions and 25 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ sequenceDiagram
User->>client: open Events Table
client->>context: create TraceContextComponent
context->>table: create TableOutputComponent
client->>server: POST /experiments/"{"expUUID"}"/outputs/table/"{"outputId"}"/columns
client->>server: POST /experiments/{expUUID}/outputs/table/{outputId}/columns
server->>client: 200: TableColumnHeader[]
client->>server: POST /experiments/"{"expUUID"}"/outputs/table/"{"outputId"}"/lines
client->>server: POST /experiments/{expUUID}/outputs/table/{outputId}/lines
Note over client,server: requested_items=list of columnIDs
Note over client,server: requested_table_count=100
Note over client,server: requested_table_index=0
Expand All @@ -46,7 +46,7 @@ sequenceDiagram
table->>table: Update table
table->>table: Update table with nbEvents
loop while indexingStatus==RUNNING
context->>server: GET /experiments/"{"expUUID"}"/
context->>server: GET /experiments/{expUUID}/
server->>context: 200: Experiment
context->>table: Update TableOutputComponent
table->>table: this.gridApi.setInfiniteRowCount(this.props.nbEvents);
Expand All @@ -73,9 +73,9 @@ sequenceDiagram
User->>client: open Events Table
client->>context: create TraceContextComponent
context->>table: create TableOutputComponent
client->>server: POST /experiments/"{"expUUID"}"/outputs/table/"{"outputId"}"/columns
client->>server: POST /experiments/{expUUID}/outputs/table/{outputId}/columns
server->>client: 200: TableColumnHeader[]
client->>server: POST /experiments/"{"expUUID"}"/outputs/table/"{"outputId"}"/lines
client->>server: POST /experiments/{expUUID}/outputs/table/{outputId}/lines
Note over client,server: requested_items=list of columnIDs
Note over client,server: requested_table_count=100
Note over client,server: requested_table_index=0
Expand All @@ -84,7 +84,7 @@ sequenceDiagram
table->>table: Update table
table->>table: Update table with nbEvents
loop while indexingStatus==RUNNING
table->>server: GET /experiments/"{"expUUID"}"/outputs/table/"{"outputId"}"/
table->>server: GET /experiments/{expUUID}/outputs/table/{outputId}/
server->>table: 200: DataProviderDescriptor/indexingStatus/nbEvents
table->>table: this.gridApi.setInfiniteRowCount(experiment.nbEvents);
table->>table: Update vertical scrollbar
Expand All @@ -103,7 +103,7 @@ sequenceDiagram
User->>table: enter column filter regex
table->>table: reset nbEvents
table->>table: Indicate that filter is active
table->>server: POST /experiments/"{"expUUID"}"/outputs/table/"{"outputId"}"/lines
table->>server: POST /experiments/{expUUID}/outputs/table/{outputId}/lines
Note over table,server: requested_table_index=startIndex
Note over table,server: requested_table_count=nbEvents
Note over table,server: table_filter_expressions=[columnId->regEx,...]
Expand All @@ -115,7 +115,7 @@ sequenceDiagram
table->>table: Update table
table->>table: Update table with nbEvents
loop while indexingStatus==RUNNING
table->>server: GET /experiments/"{"expUUID"}"/outputs/table/"{"outputId"}"/
table->>server: GET /experiments/{expUUID}/outputs/table/{outputId}/
server->>table: 200: DataProviderDescriptor/indexingStatus/nbEvents
table->>table: this.gridApi.setInfiniteRowCount(experiment.nbEvents);
table->>table: Update vertical scrollbar
Expand All @@ -130,7 +130,7 @@ The following endpoint needs to be added to the TSP to query the indexing progre
sequenceDiagram
participant client as TSP Client
participant server as Trace Server
client->>server: GET /experiments/"{"expUUID"}"/outputs/table/"{"outputId"}"/
client->>server: GET /experiments/{expUUID}/outputs/table/{outputId}/
server->>client: 200: DataProviderEnhanced
```

Expand All @@ -152,7 +152,7 @@ The following query parameters need to be updated to support filtering of the vi

```mermaid
sequenceDiagram
table->>server: POST /experiments/"{"expUUID"}"/outputs/table/"{"outputId"}"/lines
table->>server: POST /experiments/{expUUID}/outputs/table/{outputId}/lines
Note over table,server: table_filter_expressions=[columnId->regEx,...]
server->>table: 200: VirtualTableModel
```
Expand Down
1 change: 1 addition & 0 deletions doc/web-doc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.env.*
/.svelte-kit
/build
/doc-sources
/package
node_modules
vite.config.js.timestamp-*
Expand Down
10 changes: 0 additions & 10 deletions doc/web-doc/adr-loader.js

This file was deleted.

28 changes: 28 additions & 0 deletions doc/web-doc/doc-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import fs from 'fs-extra'
import { compareSync } from 'dir-compare'

const src = '../adr/'
const dest = 'doc-sources/adr-source/'

const errorCallback = err => {
if (err) throw err;
}

const options = {
excludeFilter: '.DS_Store',
compareSize: true
}

// Compare folders

const comparison = compareSync(src, dest, options)

// Copy missing files and folders

if (!comparison.same) {
comparison.diffSet.forEach(dif => {
if (dif.state === 'left' && dif.path1 === src) {
fs.copySync(src + dif.name1, dest + dif.name1, { recursive: true }, errorCallback)
}
})
}
7 changes: 5 additions & 2 deletions doc/web-doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"dev": "node doc-loader;vite dev",
"build": "vite build",
"preview": "vite preview",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
"format": "prettier --plugin-search-dir . --write .",
"load": "node doc-loader"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^1.0.0",
Expand All @@ -23,6 +24,8 @@
"type": "module",
"dependencies": {
"@ysuzuki19/remark-mermaid": "^1.0.2",
"dir-compare": "^4.0.0",
"fs-extra": "^11.1.0",
"mdsvex": "^0.10.6",
"mermaid": "^9.3.0"
}
Expand Down
2 changes: 1 addition & 1 deletion doc/web-doc/src/lib/process-files.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const allAdrFiles = import.meta.glob('/adr/*.md');
const allAdrFiles = import.meta.glob('/doc-sources/adr-source/*.md');
const iterableAdrFiles = Object.entries(allAdrFiles);

export const getAdrsContent = async () => {
Expand Down
40 changes: 38 additions & 2 deletions doc/web-doc/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,14 @@ devalue@^4.2.0:
resolved "https://registry.yarnpkg.com/devalue/-/devalue-4.2.0.tgz#3f542d7c828e317bab5fd3bcecde210af8f83d4b"
integrity sha512-mbjoAaCL2qogBKgeFxFPOXAUsZchircF+B/79LD4sHH0+NHfYm8gZpQrskKDn5gENGt35+5OI1GUF7hLVnkPDw==

dir-compare@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/dir-compare/-/dir-compare-4.0.0.tgz#264835502ae5b41e2aa8980a6797cde5440b8bdb"
integrity sha512-wC7thVKL3V656tO61rbEDE4LTeeYrUC2pAUL00AaXYghBhjjVNRyBlpH6POzb44ZuK23OSrqF6TbSC/QYeqfAg==
dependencies:
minimatch "^3.0.4"
p-limit "^3.1.0 "

doctrine@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
Expand Down Expand Up @@ -838,6 +846,15 @@ flatted@^3.1.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==

fs-extra@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.0.tgz#5784b102104433bb0e090f48bfc4a30742c357ed"
integrity sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"

fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
Expand Down Expand Up @@ -889,6 +906,11 @@ globrex@^0.1.2:
resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098"
integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==

graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==

grapheme-splitter@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"
Expand Down Expand Up @@ -1005,6 +1027,15 @@ json-stable-stringify-without-jsonify@^1.0.1:
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==

jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==
dependencies:
universalify "^2.0.0"
optionalDependencies:
graceful-fs "^4.1.6"

khroma@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/khroma/-/khroma-2.0.0.tgz#7577de98aed9f36c7a474c4d453d94c0d6c6588b"
Expand Down Expand Up @@ -1078,7 +1109,7 @@ mime@^3.0.0:
resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7"
integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==

minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
Expand Down Expand Up @@ -1139,7 +1170,7 @@ optionator@^0.9.1:
type-check "^0.4.0"
word-wrap "^1.2.3"

p-limit@^3.0.2:
p-limit@^3.0.2, "p-limit@^3.1.0 ":
version "3.1.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
Expand Down Expand Up @@ -1442,6 +1473,11 @@ unist-util-visit@^4.1.1:
unist-util-is "^5.0.0"
unist-util-visit-parents "^5.1.1"

universalify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==

uri-js@^4.2.2:
version "4.4.1"
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
Expand Down

0 comments on commit 6a6e43c

Please sign in to comment.