File tree Expand file tree Collapse file tree 3 files changed +23
-17
lines changed
Expand file tree Collapse file tree 3 files changed +23
-17
lines changed Original file line number Diff line number Diff line change 44 "description" : " An extension for Theia building the Arduino IDE" ,
55 "license" : " AGPL-3.0-or-later" ,
66 "scripts" : {
7- "prepare" : " yarn download-cli && yarn download-fwuploader && yarn download-ls && yarn clean && yarn download-examples && yarn build && yarn test" ,
7+ "prepare" : " yarn download-cli && yarn download-fwuploader && yarn download-ls && yarn copy-serial-plotter && yarn clean && yarn download-examples && yarn build && yarn test" ,
88 "clean" : " rimraf lib" ,
99 "download-cli" : " node ./scripts/download-cli.js" ,
1010 "download-fwuploader" : " node ./scripts/download-fwuploader.js" ,
11+ "copy-serial-plotter" : " npx ncp ../node_modules/arduino-serial-plotter-webapp ./build/arduino-serial-plotter-webapp" ,
1112 "download-ls" : " node ./scripts/download-ls.js" ,
1213 "download-examples" : " node ./scripts/download-examples.js" ,
1314 "generate-protocol" : " node ./scripts/generate-protocol.js" ,
1819 "test:watch" : " mocha --watch --watch-files lib \" ./lib/test/**/*.test.js\" "
1920 },
2021 "dependencies" : {
22+ "arduino-serial-plotter-webapp" : " 0.0.2" ,
2123 "@grpc/grpc-js" : " ^1.3.7" ,
2224 "@theia/application-package" : " 1.18.0" ,
2325 "@theia/core" : " 1.18.0" ,
Original file line number Diff line number Diff line change @@ -10,21 +10,20 @@ export class PlotterBackendContribution
1010 async initialize ( ) : Promise < void > { }
1111
1212 configure ( app : express . Application ) : void {
13- app . use (
14- express . static (
15- path . join (
16- __dirname ,
17- '../../../node_modules/arduino-serial-plotter-webapp/build'
18- )
19- )
20- ) ;
21- app . get ( '/plotter' , ( req , res ) =>
22- res . sendFile (
23- path . join (
24- __dirname ,
25- '../../../node_modules/arduino-serial-plotter-webapp/build/index.html'
26- )
27- )
28- ) ;
13+ const relativePath = [
14+ '..' ,
15+ '..' ,
16+ '..' ,
17+ 'build' ,
18+ 'arduino-serial-plotter-webapp' ,
19+ 'build' ,
20+ ] ;
21+ app . use ( express . static ( path . join ( __dirname , ...relativePath ) ) ) ;
22+ app . get ( '/plotter' , ( req , res ) => {
23+ console . log (
24+ `Serving serial plotter on http://${ req . headers . host } ${ req . url } `
25+ ) ;
26+ res . sendFile ( path . join ( __dirname , ...relativePath , 'index.html' ) ) ;
27+ } ) ;
2928 }
3029}
Original file line number Diff line number Diff line change @@ -4109,6 +4109,11 @@ archive-type@^4.0.0:
41094109 dependencies:
41104110 file-type "^4.2.0"
41114111
4112+ 4113+ version "0.0.1"
4114+ resolved "https://registry.yarnpkg.com/arduino-serial-plotter-webapp/-/arduino-serial-plotter-webapp-0.0.1.tgz#a66b512df72432bdb0f48495955351e637190943"
4115+ integrity sha512-6k+8MF6LtMdEZUSDh1FY/pmrI2wCTpFTVriEt5/sa9vJKnoZxkxwoSZzbYNtsqbJU2D4knzoVyS4J/LjaTbkOg==
4116+
41124117are-we-there-yet@~1.1.2:
41134118 version "1.1.5"
41144119 resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21"
You can’t perform that action at this time.
0 commit comments