Skip to content

Modular logistics and supply chain operating system (LSOS)

Remove console prebuild script, bump docker fleetbase version

Ronald A. Richardson7e898dd54b20
diff --git a/console/package.json b/console/package.json
index 6f8df3de..3b418c4f 100644
--- a/console/package.json
+++ b/console/package.json
@@ -11,8 +11,7 @@
"test": "tests"
},
"scripts": {
- "prebuild": "node prebuild.js",
- "build": "pnpm run prebuild && ember build",
+ "build": "ember build",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:css": "stylelint \"**/*.css\"",
"lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
@@ -22,8 +21,8 @@
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:intl": "fleetbase-intl-lint",
- "start": "pnpm run prebuild && ember serve",
- "start:dev": "pnpm run prebuild && ember serve --environment development",
+ "start": "ember serve",
+ "start:dev": "ember serve --environment development",
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
"test:ember": "ember test"
},
diff --git a/console/pnpm-lock.yaml b/console/pnpm-lock.yaml
index df1b1ec5..825306e7 100644
--- a/console/pnpm-lock.yaml
+++ b/console/pnpm-lock.yaml
@@ -20,13 +20,13 @@ importers:
specifier: ^0.2.11
'@fleetbase/ember-core':
- specifier: ^0.3.7
+ specifier: latest
'@fleetbase/ember-ui':
- specifier: ^0.3.12
+ specifier: latest
'@fleetbase/fleetops-data':
- specifier: ^0.1.23
+ specifier: latest
'@fleetbase/fleetops-engine':
specifier: ^0.6.28
@@ -1451,15 +1451,6 @@ packages:
'@glint/template':
optional: true
- '@embroider/[email protected]':
- resolution: {integrity: sha512-x4wrnkE6fPN6mOyJeJv2I+lpKE2pHPq25S8bCiRJJb3H3RyiTm2LjSeB4AOVTi8YUjiWToI4PBgZOtx44hM4LA==}
- engines: {node: 12.* || 14.* || >= 16}
- peerDependencies:
- '@glint/template': ^1.0.0
- peerDependenciesMeta:
- '@glint/template':
- optional: true
-
'@embroider/[email protected]':
resolution: {integrity: sha512-zwpe7J9jyh8YPLzblk8WR3AQf6m+Ln/8Prlz9/DEwHD1m7GjJog1TIT0Sjv8guEj/hXCGntbNOzfE2Vj1T0Uug==}
engines: {node: 12.* || 14.* || >= 16}
@@ -1584,12 +1575,6 @@ packages:
peerDependencies:
ember-engines: ^0.9.0
- '@fleetbase/[email protected]':
- resolution: {integrity: sha512-9HIuHPuLh/cKiIF5bD4l1MSDlFYSEVcSxKH/5qDrO38J68V1uYUb37FJ7UBI9ojcz0bB/S/E/ZZhGZcNZXZPCw==}
- engines: {node: '>= 18'}
- peerDependencies:
- ember-engines: ^0.9.0
-
'@floating-ui/[email protected]':
resolution: {integrity: sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==}
@@ -10448,19 +10433,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@embroider/[email protected]':
- dependencies:
- '@embroider/shared-internals': 3.0.1
- assert-never: 1.4.0
- babel-import-util: 3.0.1
- ember-cli-babel: 7.26.11
- find-up: 5.0.0
- lodash: 4.17.21
- resolve: 1.22.11
- semver: 7.7.3
- transitivePeerDependencies:
- - supports-color
-
'@embroider/[email protected]':
dependencies:
'@embroider/shared-internals': 3.0.1
@@ -10539,7 +10511,7 @@ snapshots:
dependencies:
- '@embroider/macros': 1.19.4
+ '@embroider/macros': 1.19.5
broccoli-funnel: 3.0.8
ember-cli-babel: 7.26.11
@@ -17637,7 +17609,7 @@ snapshots:
dependencies:
- hash-base: 3.0.5
+ hash-base: 3.1.2
inherits: 2.0.4
safe-buffer: 5.2.1
diff --git a/console/prebuild.js b/console/prebuild.js
deleted file mode 100644
index c04ccd12..00000000
--- a/console/prebuild.js
+++ /dev/null
@@ -1,176 +0,0 @@
-const fg = require('fast-glob');
-const fs = require('fs');
-const path = require('path');
-const recast = require('recast');
-const babelParser = require('recast/parsers/babel');
-const builders = recast.types.builders;
-
-function getExtensionMountPath(extensionName) {
- let extensionNameSegments = extensionName.split('/');
- let mountName = extensionNameSegments[1];
-
- if (typeof mountName !== 'string') {
- mountName = extensionNameSegments[0];
- }
-
- return mountName.replace('-engine', '');
-}
-
-function only(subject, props = []) {
- const keys = Object.keys(subject);
- const result = {};
-
- for (let i = 0; i < keys.length; i++) {
- const key = keys[i];
-
- if (props.includes(key)) {
- result[key] = subject[key];
- }
- }
-
- return result;
-}
-
-function getExtensions() {
- return new Promise((resolve, reject) => {
- const extensions = [];
- const seenPackages = new Set();
-
- return fg(['node_modules/*/package.json', 'node_modules/*/*/package.json'])
- .then((results) => {
- for (let i = 0; i < results.length; i++) {
- const packagePath = results[i];
- const packageJson = fs.readFileSync(packagePath);
- let packageData = null;
-
- try {
- packageData = JSON.parse(packageJson);
- } catch (e) {
- console.warn(`Could not parse package.json at ${packagePath}:`, e);
- continue;
- }
-
- if (!packageData || !packageData.keywords || !packageData.keywords.includes('fleetbase-extension') || !packageData.keywords.includes('ember-engine')) {
- continue;
- }
-
- // If we've seen this package before, skip it
- if (seenPackages.has(packageData.name)) {
- continue;
- }
-
- seenPackages.add(packageData.name);
- extensions.push(only(packageData, ['name', 'description', 'version', 'fleetbase', 'keywords', 'license', 'repository']));
- }
-
- resolve(extensions);
- })
- .catch(reject);
- });
-}
-
-function getRouterFileContents() {
- const routerFilePath = path.join(__dirname, 'router.map.js');
- const routerFileContents = fs.readFileSync(routerFilePath, 'utf-8');
-
- return routerFileContents;
-}
-
-(async () => {
- const extensions = await getExtensions();
- const consoleExtensions = extensions.filter((extension) => !extension.fleetbase || extension.fleetbase.mount !== 'root');
- const rootExtensions = extensions.filter((extension) => extension.fleetbase && extension.fleetbase.mount === 'root');
- const routerFileContents = getRouterFileContents();
- const ast = recast.parse(routerFileContents, { parser: babelParser });
-
- recast.visit(ast, {
- visitCallExpression(path) {
- if (path.value.type === 'CallExpression' && path.value.callee.property.name === 'route' && path.value.arguments[0].value === 'console') {
- let functionExpression;
-
- // Find the function expression
- path.value.arguments.forEach((arg) => {
- if (arg.type === 'FunctionExpression') {
- functionExpression = arg;
- }
- });
- if (functionExpression) {
- // Check and add the new engine mounts
- consoleExtensions.forEach((extension) => {
- const mountPath = getExtensionMountPath(extension.name);
- let route = mountPath;
-
- if (extension.fleetbase && extension.fleetbase.route) {
- route = extension.fleetbase.route;
- }
-
- // Check if engine is already mounted
- const isMounted = functionExpression.body.body.some((expressionStatement) => {
- return expressionStatement.expression.arguments[0].value === extension.name;
- });
-
- // If not mounted, append to the function body
- if (!isMounted) {
- functionExpression.body.body.push(
- builders.expressionStatement(
- builders.callExpression(builders.memberExpression(builders.thisExpression(), builders.identifier('mount')), [
- builders.literal(extension.name),
- builders.objectExpression([
- builders.property('init', builders.identifier('as'), builders.literal(route)),
- builders.property('init', builders.identifier('path'), builders.literal(route)),
- ]),
- ])
- )
- );
- }
- });
- }
- }
-
- // console.log(path.value.callee.property.name);
- if (path.value.type === 'CallExpression' && path.value.callee.property.name === 'map') {
- let functionExpression;
-
- path.value.arguments.forEach((arg) => {
- if (arg.type === 'FunctionExpression') {
- functionExpression = arg;
- }
- });
-
- if (functionExpression) {
- rootExtensions.forEach((extension) => {
- const mountPath = getExtensionMountPath(extension.name);
- let route = mountPath;
-
- if (extension.fleetbase && extension.fleetbase.route) {
- route = extension.fleetbase.route;
- }
-
- const isMounted = functionExpression.body.body.some((expressionStatement) => {
- return expressionStatement.expression.arguments[0].value === extension.name;
- });
-
- if (!isMounted) {
- functionExpression.body.body.push(
- builders.expressionStatement(
- builders.callExpression(builders.memberExpression(builders.thisExpression(), builders.identifier('mount')), [
- builders.literal(extension.name),
- builders.objectExpression([
- builders.property('init', builders.identifier('as'), builders.literal(route)),
- builders.property('init', builders.identifier('path'), builders.literal(route)),
- ]),
- ])
- )
- );
- }
- });
- }
- }
-
- this.traverse(path);
- },
- });
-
- const output = recast.print(ast, { quote: 'single' }).code;
- fs.writeFileSync(path.join(__dirname, 'app/router.js'), output);
-})();
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 91807d99..d5ec726f 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -75,7 +75,7 @@ ENV QUEUE_CONNECTION=redis
ENV CADDYFILE_PATH=/fleetbase/Caddyfile
ENV CONSOLE_PATH=/fleetbase/console
ENV OCTANE_SERVER=frankenphp
-ENV FLEETBASE_VERSION=0.7.19
+ENV FLEETBASE_VERSION=0.7.20
# Set environment
ARG ENVIRONMENT=production