@openc3/js-common 5.21.0-beta0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/utils.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=function(e){var a;!e.name!=="NotFound"&&(e.path=`${__BASE_URL__}/${e.path.replace(/^\//,"")}`),(a=e.children)==null||a.forEach(n)};exports.prependBasePath=n;
2
+ //# sourceMappingURL=utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.cjs","sources":["../src/utils/routeUtils.js"],"sourcesContent":["/*\n# Copyright 2024, OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nconst prependBasePath = function (route) {\n if (!route.name !== 'NotFound') {\n route.path = `${__BASE_URL__}/${route.path.replace(/^\\//, '')}`\n }\n route.children?.forEach(prependBasePath)\n}\n\nexport { prependBasePath }\n"],"names":["prependBasePath","route","_a"],"mappings":"gFAkBK,MAACA,EAAkB,SAAUC,EAAO,OACnC,CAACA,EAAM,OAAS,aAClBA,EAAM,KAAO,GAAG,YAAY,IAAIA,EAAM,KAAK,QAAQ,MAAO,EAAE,CAAC,KAE/DC,EAAAD,EAAM,WAAN,MAAAC,EAAgB,QAAQF,EAC1B"}
package/dist/utils.js ADDED
@@ -0,0 +1,8 @@
1
+ const p = function(a) {
2
+ var n;
3
+ !a.name !== "NotFound" && (a.path = `${__BASE_URL__}/${a.path.replace(/^\//, "")}`), (n = a.children) == null || n.forEach(p);
4
+ };
5
+ export {
6
+ p as prependBasePath
7
+ };
8
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../src/utils/routeUtils.js"],"sourcesContent":["/*\n# Copyright 2024, OpenC3, Inc.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nconst prependBasePath = function (route) {\n if (!route.name !== 'NotFound') {\n route.path = `${__BASE_URL__}/${route.path.replace(/^\\//, '')}`\n }\n route.children?.forEach(prependBasePath)\n}\n\nexport { prependBasePath }\n"],"names":["prependBasePath","route","_a"],"mappings":"AAkBK,MAACA,IAAkB,SAAUC,GAAO;AAlBzC,MAAAC;AAmBE,EAAI,CAACD,EAAM,SAAS,eAClBA,EAAM,OAAO,GAAG,YAAY,IAAIA,EAAM,KAAK,QAAQ,OAAO,EAAE,CAAC,MAE/DC,IAAAD,EAAM,aAAN,QAAAC,EAAgB,QAAQF;AAC1B;"}
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@openc3/js-common",
3
+ "description": "Common library for COSMOS tool development",
4
+ "version": "5.21.0-beta0",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "homepage": "https://openc3.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/OpenC3/cosmos.git",
10
+ "directory": "openc3-cosmos-init/plugins/packages/openc3-js-common"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/OpenC3/cosmos/issues"
14
+ },
15
+ "keywords": [
16
+ "openc3",
17
+ "cosmos"
18
+ ],
19
+ "type": "module",
20
+ "files": [
21
+ "dist",
22
+ "viteDevServerPlugin.mjs"
23
+ ],
24
+ "exports": {
25
+ "./services": {
26
+ "import": "./dist/services.js",
27
+ "require": "./dist/services.cjs"
28
+ },
29
+ "./utils": {
30
+ "import": "./dist/utils.js",
31
+ "require": "./dist/utils.cjs"
32
+ },
33
+ "./viteDevServerPlugin": {
34
+ "default": "./viteDevServerPlugin.mjs"
35
+ }
36
+ },
37
+ "scripts": {
38
+ "serve": "vite build --watch --mode dev-server",
39
+ "build": "vite build",
40
+ "lint": "eslint src",
41
+ "serve:standalone": "vite preview --mode standalone"
42
+ },
43
+ "dependencies": {
44
+ "@astrouxds/astro-web-components": "7.24.0",
45
+ "@rails/actioncable": "7.1.3-4",
46
+ "axios": "1.7.7",
47
+ "binary-search": "1.3.6",
48
+ "date-fns": "4.1.0",
49
+ "date-fns-tz": "3.2.0",
50
+ "lodash": "4.17.21",
51
+ "sass": "1.80.4",
52
+ "sortablejs": "1.15.3",
53
+ "sprintf-js": "1.1.3",
54
+ "uplot": "1.6.31"
55
+ },
56
+ "devDependencies": {
57
+ "eslint": "9.16.0",
58
+ "eslint-config-prettier": "9.1.0",
59
+ "eslint-plugin-prettier": "5.2.1",
60
+ "eslint-plugin-vue": "9.27.0",
61
+ "prettier": "3.3.3",
62
+ "vite": "5.4.11"
63
+ }
64
+ }
@@ -0,0 +1,44 @@
1
+ /*
2
+ # Copyright 2024, OpenC3, Inc.
3
+ # All Rights Reserved.
4
+ #
5
+ # This program is free software; you can modify and/or redistribute it
6
+ # under the terms of the GNU Affero General Public License
7
+ # as published by the Free Software Foundation; version 3 with
8
+ # attribution addendums as found in the LICENSE.txt
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU Affero General Public License for more details.
14
+ #
15
+ # This file may also be used under the terms of a commercial license
16
+ # if purchased from OpenC3, Inc.
17
+ */
18
+
19
+ import { spawn } from 'child_process'
20
+
21
+ let devServerPid
22
+ export const devServerPlugin = ({ mode }) => ({
23
+ /* Hacky workaround since I can't get the vite dev server working correctly in our project.
24
+ * The `vite` command is serving files from `outDir`, but somehow it doesn't refresh when those files are changed.
25
+ * This simple plugin just listens for a couple vite hooks and spawns a new instance of vite to serve the new files.
26
+ */
27
+ name: 'dev-reload',
28
+ buildEnd() {
29
+ // Called after Rollup finishes, but before files are written
30
+ if (mode !== 'dev-server') {
31
+ return
32
+ }
33
+ devServerPid && process.kill(devServerPid)
34
+ devServerPid = null
35
+ },
36
+ closeBundle() {
37
+ // Called after build output files are written
38
+ if (mode !== 'dev-server') {
39
+ return
40
+ }
41
+ const v = spawn('vite')
42
+ devServerPid = v.pid
43
+ },
44
+ })