-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from mdvanes/feature/dockerlist
Feature/dockerlist
- Loading branch information
Showing
42 changed files
with
5,146 additions
and
3,609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"status": "received", | ||
"containers": [ | ||
{ | ||
"Id": "245425425245afafaffaaafaffaaffaa43542524524524524542542444452532", | ||
"Names": ["/determined_edison"], | ||
"State": "running", | ||
"Status": "Up 11 days" | ||
}, | ||
|
||
{ | ||
"Id": "245425425245afafaffaaafaffaaffaa43542524524524524542542444452531", | ||
"Names": ["/hello_world"], | ||
"State": "exited", | ||
"Status": "Exited (0) 42 hours ago" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
398540 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
####{BSB GENERATED: NO EDIT | ||
B lib/bs | ||
FLG -open MdworldHomeremoteDockerlist | ||
FLG -ppx '/home/martin/ZNoBackup/repos/homeremote-plugins/node_modules/rescript/linux/bsc.exe -as-ppx -bs-jsx 3' | ||
S /home/martin/ZNoBackup/repos/homeremote-plugins/node_modules/rescript/lib/ocaml | ||
B /home/martin/ZNoBackup/repos/homeremote-plugins/node_modules/rescript/lib/ocaml | ||
FLG -w +a-4-9-20-40-41-42-50-61-102 | ||
S /home/martin/ZNoBackup/repos/homeremote-plugins/node_modules/@rescript/react/lib/ocaml | ||
B /home/martin/ZNoBackup/repos/homeremote-plugins/node_modules/@rescript/react/lib/ocaml | ||
S /home/martin/ZNoBackup/repos/homeremote-plugins/node_modules/bs-fetch/lib/ocaml | ||
B /home/martin/ZNoBackup/repos/homeremote-plugins/node_modules/bs-fetch/lib/ocaml | ||
S src | ||
B lib/bs/src | ||
####BSB GENERATED: NO EDIT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src | ||
stories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# homeremote-stream-player | ||
|
||
Show a list of docker containers and start or stop them | ||
|
||
See https://github.com/mdvanes/homeremote/issues/9 | ||
|
||
## How this project was set up | ||
|
||
- nvm use 15 | ||
- copied package.json from other client package in the monorepo | ||
- `yarn lerna add rescript -D --scope=@mdworld/homeremote-dockerlist` | ||
- add bsconfig.json following https://rescript-lang.org/docs/manual/latest/installation#integrate-into-an-existing-js-project | ||
- add `"re:build": "rescript", "re:start": "rescript build -w"` to package.json/scripts | ||
- create a file /packages/dockerlist-client/src/Test.res with the button example from https://rescript-lang.org/try | ||
- in /packages/dockerlist-client run `yarn re:build` | ||
- now get an error that is probably caused because rescript-react is not yet installed, see https://rescript-lang.org/docs/react/latest/introduction | ||
- compilation indeed does work, when Test.res only contains `Js.log("Hello, World!")` | ||
- Add rescript-react: `yarn lerna add @rescript/react --scope=@mdworld/homeremote-dockerlist` | ||
- Add { | ||
"reason": { "react-jsx": 3 }, | ||
"bs-dependencies": ["@rescript/react"] | ||
} in bsconfig.json | ||
- in /packages/dockerlist-client run `yarn re:build` | ||
- Add fetch to endpoint: `yarn lerna add bs-fetch --scope=@mdworld/homeremote-dockerlist` and add to bsconfig.json: "bs-dependencies": ["bs-fetch"] | ||
|
||
## Running | ||
|
||
- dev: run in root: `yarn start` and it will start storybook, mock api, and `yarn re:start` (in this dir) | ||
|
||
## TODO | ||
|
||
- Fix building, exclude "dist" from the build? | ||
- Add DockerList to the Example app | ||
- For now XHR works in Rescript, but Fetch only works in Reason files. Mainly decoding the JSON fails, even with "@glennsl/bs-json" | ||
- Material UI bindings seem very unstable: https://jsiebern.github.io/bs-material-ui Adding it breaks the build sometimes | ||
- Clean up old Elm deps from package.json | ||
- Builders (like webpack) are discouraged: https://rescript-lang.org/docs/manual/latest/interop-with-js-build-systems | ||
- Snowpack build to `dist` dir like in https://github.com/jihchi/rescript-react-realworld-example-app/blob/main/package.json https://www.snowpack.dev/ | ||
- Storybook like in https://raw.githubusercontent.com/elfsternberg/doc-rescript-with-storybook/main/src/stories/02_Noncard.stories.mdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "@mdworld/homeremote-dockerlist", | ||
"sources": [ | ||
{ | ||
"dir": "src", | ||
"subdirs": true | ||
} | ||
], | ||
"package-specs": [ | ||
{ | ||
"module": "commonjs", | ||
"in-source": true | ||
} | ||
], | ||
"suffix": ".bs.js", | ||
"reason": { "react-jsx": 3 }, | ||
"bs-dependencies": ["@rescript/react", "bs-fetch"], | ||
"namespace": true, | ||
"gentypeconfig": { | ||
"language": "typescript" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{ | ||
"name": "@mdworld/homeremote-dockerlist", | ||
"version": "1.7.1", | ||
"main": "./src/DockerList.bs.js", | ||
"types": "./src/DockerList.gen.tsx", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mdvanes/homeremote-plugins.git" | ||
}, | ||
"scripts": { | ||
"clean": "rm src/*.bs.js && rm src/*.gen.tsx", | ||
"build": "yarn re:build", | ||
"re:build": "rescript", | ||
"re:start": "rescript build -w" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"jest": { | ||
"roots": [ | ||
"<rootDir>/src" | ||
], | ||
"collectCoverageFrom": [ | ||
"src/**/*.{js,jsx,ts,tsx}", | ||
"!src/**/*.d.ts" | ||
], | ||
"setupFiles": [ | ||
"react-app-polyfill/jsdom" | ||
], | ||
"setupFilesAfterEnv": [ | ||
"<rootDir>/src/setupTests.js" | ||
], | ||
"testMatch": [ | ||
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}", | ||
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}" | ||
], | ||
"transform": { | ||
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest", | ||
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js", | ||
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js" | ||
}, | ||
"transformIgnorePatterns": [ | ||
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$", | ||
"^.+\\.module\\.(css|sass|scss)$" | ||
], | ||
"modulePaths": [ | ||
"/usr/lib/nodejs", | ||
"/usr/lib/node_modules", | ||
"/usr/share/javascript" | ||
], | ||
"moduleNameMapper": { | ||
"^react-native$": "react-native-web", | ||
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy" | ||
}, | ||
"moduleFileExtensions": [ | ||
"web.js", | ||
"js", | ||
"web.ts", | ||
"ts", | ||
"web.tsx", | ||
"tsx", | ||
"json", | ||
"web.jsx", | ||
"jsx", | ||
"node" | ||
], | ||
"watchPlugins": [ | ||
"jest-watch-typeahead/filename", | ||
"jest-watch-typeahead/testname" | ||
] | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"react-app" | ||
] | ||
}, | ||
"license": "MIT", | ||
"gitHead": "1c79d816ed2921cfe7c8a6a64fd84a339984f774", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"devDependencies": { | ||
"gentype": "^3.50.0", | ||
"rescript": "^9.1.2" | ||
}, | ||
"dependencies": { | ||
"@rescript/react": "^0.10.3", | ||
"bs-fetch": "^0.6.2" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.