mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
refactor build process (#1675)
* add nc-broadcast to view initialization.sh logs * include stderr * refactor build * add frontend/config.json as frontend dependency * fix nc-broadcast * always run all workflows * address dependabot alerts * fix build caching * remove registries.json * more efficient build
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// @ts-check
|
||||
const fs = require('fs')
|
||||
const childProcess = require('child_process')
|
||||
const { env } = require('process')
|
||||
|
||||
const gitHash = String(
|
||||
childProcess.execSync('git describe --always --abbrev=40 --dirty=-modified'),
|
||||
@@ -9,8 +8,5 @@ const gitHash = String(
|
||||
|
||||
const origConfig = require('./config.json')
|
||||
|
||||
const registries = require('./registries.json')
|
||||
|
||||
origConfig['gitHash'] = gitHash
|
||||
origConfig.ui['marketplace'] = registries.prod
|
||||
fs.writeFileSync('./config.json', JSON.stringify(origConfig, null, 2))
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
"skipStartupAlerts": true
|
||||
},
|
||||
"marketplace": {
|
||||
"url": "https://beta-registry-0-3.start9labs.com/",
|
||||
"name": "Embassy Marketplace"
|
||||
"url": "https://registry.start9.com/",
|
||||
"name": "Start9 Marketplace"
|
||||
}
|
||||
},
|
||||
"gitHash": ""
|
||||
|
||||
4
frontend/package-lock.json
generated
4
frontend/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "embassy-os",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.1.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "embassy-os",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.1.1",
|
||||
"dependencies": {
|
||||
"@angular/animations": "^13.3.0",
|
||||
"@angular/common": "^13.3.0",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"build:deps": "rm -rf .angular/cache && cd ../patch-db/client && npm ci && npm run build",
|
||||
"build:diagnostic-ui": "ng run diagnostic-ui:build",
|
||||
"build:setup-wizard": "ng run setup-wizard:build",
|
||||
"build:ui": "ng run ui:build && tsc projects/ui/postprocess.ts && node projects/ui/postprocess.js && git log | head -n1 > dist/ui/git-hash.txt",
|
||||
"build:ui": "ng run ui:build",
|
||||
"build:all": "npm run build:deps && npm run build:diagnostic-ui && npm run build:setup-wizard && npm run build:ui",
|
||||
"start:diagnostic-ui": "npm run-script build-config && ionic serve --project diagnostic-ui --host 0.0.0.0",
|
||||
"start:setup-wizard": "npm run-script build-config && ionic serve --project setup-wizard --host 0.0.0.0",
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { parse } from 'node-html-parser'
|
||||
import * as fs from 'fs'
|
||||
|
||||
let index = fs.readFileSync('./dist/ui/index.html').toString('utf-8')
|
||||
|
||||
const root = parse(index)
|
||||
for (let elem of root.querySelectorAll('link')) {
|
||||
if (elem.getAttribute('rel') === 'stylesheet') {
|
||||
const sheet = fs
|
||||
.readFileSync('./dist/ui/' + elem.getAttribute('href'))
|
||||
.toString('utf-8')
|
||||
index = index.replace(elem.toString(), '<style>' + sheet + '</style>')
|
||||
}
|
||||
}
|
||||
fs.writeFileSync('./dist/ui/index.html', index)
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"prod": {
|
||||
"url": "https://registry.start9.com",
|
||||
"name": "Embassy Marketplace"
|
||||
},
|
||||
"beta": {
|
||||
"url": "https://beta-registry-0-3.start9labs.com",
|
||||
"name": "Beta Marketplace"
|
||||
},
|
||||
"alpha": {
|
||||
"url": "https://alpha-registry-0-3.start9labs.com",
|
||||
"name": "Alpha Marketplace"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user