Skip to content

Commit

Permalink
scaffold openmct project
Browse files Browse the repository at this point in the history
  • Loading branch information
davetsay committed Dec 7, 2022
1 parent 518bc96 commit fdd0692
Show file tree
Hide file tree
Showing 5 changed files with 155 additions and 3 deletions.
78 changes: 78 additions & 0 deletions dist/openmct-dynamic-plans.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["DynamicPlansPlugin"] = factory();
else
root["DynamicPlansPlugin"] = factory();
})(self, () => {
return /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({

/***/ "./src/plugin.js":
/*!***********************!*\
!*** ./src/plugin.js ***!
\***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DynamicPlansPlugin)\n/* harmony export */ });\nfunction DynamicPlansPlugin (options) {\n return function install(openmct) {\n console.log('plugin installed');\n }\n}\n\n\n//# sourceURL=webpack://DynamicPlansPlugin/./src/plugin.js?");

/***/ })

/******/ });
/************************************************************************/
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = {};
/******/ __webpack_modules__["./src/plugin.js"](0, __webpack_exports__, __webpack_require__);
/******/
/******/ return __webpack_exports__;
/******/ })()
;
});
49 changes: 49 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="node_modules/openmct/dist/openmct.js"></script>
<script type="text/javascript" src="dist/openmct-dynamic-plans.js"></script>
<script>
const ONE_SECOND = 1000;
const THIRTY_SECONDS = 30 * ONE_SECOND;
const ONE_MINUTE = 60 * ONE_SECOND;
const THIRTY_MINUTES = 30 * ONE_MINUTE;

openmct.setAssetPath("node_modules/openmct/dist");

openmct.install(new DynamicPlansPlugin.default());
openmct.install(openmct.plugins.DisplayLayout({
showAsView: ['summary-widget', 'example.imagery']
}));
openmct.install(new openmct.plugins.LocalStorage());
openmct.install(new openmct.plugins.Espresso());
openmct.install(new openmct.plugins.MyItems());
openmct.install(openmct.plugins.UTCTimeSystem());
openmct.install(openmct.plugins.Conductor({
menuOptions: [
{
name: "Fixed",
timeSystem: 'utc',
bounds: {
start: Date.now() - THIRTY_MINUTES,
end: Date.now()
}
},
{
name: "Realtime",
timeSystem: 'utc',
clock: 'local',
clockOffsets: {
start: - THIRTY_MINUTES,
end: THIRTY_SECONDS
}
}
]
}));

document.addEventListener('DOMContentLoaded', () => openmct.start(document.body));
</script>
</head>
<body>
</body>
</html>
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"name": "openmct-dynamic-plans",
"version": "1.0.0",
"description": "Example working with non-persistable plans",
"main": "index.js",
"main": "dist/openmct-dynamic-plans.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "webpack",
"start": "serve ."
},
"repository": {
"type": "git",
Expand All @@ -17,6 +19,10 @@
},
"homepage": "https://github.com/davetsay/openmct-dynamic-plans#readme",
"devDependencies": {
"webpack": "^5.75.0"
"openmct": "latest",
"serve": "^9.4.0",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
}
}
5 changes: 5 additions & 0 deletions src/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function DynamicPlansPlugin (options) {
return function install(openmct) {
console.log('plugin installed');
}
}
14 changes: 14 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var path = require('path');

module.exports = {
entry: {
main: './src/plugin'
},
mode: 'development',
output: {
path: path.resolve(__dirname, "dist"),
filename: "openmct-dynamic-plans.js",
library: "DynamicPlansPlugin",
libraryTarget: "umd"
}
};

0 comments on commit fdd0692

Please sign in to comment.