@altronix/cli 0.7.17 → 0.7.19

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/build.js CHANGED
@@ -353,14 +353,15 @@ function emulateBytePages(board) {
353
353
  board.startsWith('netway5pq') ||
354
354
  board.startsWith('oa2b'));
355
355
  }
356
- function extraAppConfs(extraConfs) {
356
+ function extraAppConfs(extraConfs, config) {
357
357
  const key = process.env['ALTRONIX_RELEASE_KEY'];
358
358
  if (!key)
359
359
  throw new Error('missing ALTRONIX_RELEASE_KEY from environment');
360
360
  const extraConfsData = [
361
361
  `CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="${key}"`,
362
362
  `CONFIG_BOOTLOADER_MCUBOOT=y`,
363
- `CONFIG_ATX_UPDATE_ENABLE=y`
363
+ `CONFIG_ATX_UPDATE_ENABLE=y`,
364
+ `CONFIG_ATX_CONFIG="${config}"`
364
365
  ].join('\r\n');
365
366
  return from(fs.promises.writeFile(extraConfs, extraConfsData));
366
367
  }
@@ -474,7 +475,7 @@ export async function build() {
474
475
  const wasm$ = buildWasm ? from(await Promise.all(wasm)) : EMPTY;
475
476
  // Handle all the preliminary stuff before building
476
477
  const ready$ = concat(merge(apps$.pipe(mergeMap(({ installDir: s, binaryDir: b }) => from([s, b]))), boot$.pipe(mergeMap(({ installDir: s, binaryDir: b }) => from([s, b]))), wasm$.pipe(map(({ installDir }) => installDir))).pipe(toArray(), mergeMap((arr) => from([...new Set(arr)])), // dedupe
477
- clean(this.opts()['yes']), mkdir()), apps$.pipe(mergeMap(({ binaryDir }) => extraAppConfs(path.join(binaryDir, extraAppConfFile)))), boot$.pipe(mergeMap(({ board, binaryDir }) => extraBootConfs(board, path.join(binaryDir, extraBootConfFile)))), wasm$.pipe(mergeMap(seedle)), wasm$.pipe(mergeMap(({ files, cddl: dest }) => concatFiles(files, dest)))).pipe(last(), share());
478
+ clean(this.opts()['yes']), mkdir()), apps$.pipe(mergeMap(({ binaryDir, config }) => extraAppConfs(path.join(binaryDir, extraAppConfFile), config))), boot$.pipe(mergeMap(({ board, binaryDir }) => extraBootConfs(board, path.join(binaryDir, extraBootConfFile)))), wasm$.pipe(mergeMap(seedle)), wasm$.pipe(mergeMap(({ files, cddl: dest }) => concatFiles(files, dest)))).pipe(last(), share());
478
479
  // Get an array of every build item.
479
480
  const items$ = merge(apps$.pipe(map(westItem)), boot$.pipe(map(westItem)), wasm$.pipe(map(cmakeItem))).pipe(toArray());
480
481
  // Run build commands for all bootloaders, applications and wasm concurrently
@@ -10,14 +10,19 @@ export default function Progress({ total, response$, onComplete }) {
10
10
  return (React.createElement(Box, null,
11
11
  React.createElement(Box, null,
12
12
  React.createElement(Text, null, "["),
13
- new Array(progress).fill(0).map((_, idx) => (React.createElement(Text, { key: idx }, "#"))),
14
- new Array(empty).fill(0).map((_, idx) => (React.createElement(Text, { key: idx }, "-"))),
13
+ progress > 0 && new Array(progress).fill(0).map(mapper('#')),
14
+ empty > 0 && new Array(empty).fill(0).map(mapper('-')),
15
15
  React.createElement(Text, null, "]")),
16
16
  React.createElement(Box, { marginLeft: 1 },
17
17
  React.createElement(Text, null,
18
- Math.ceil((100 * progress) / width),
18
+ Math.min(Math.ceil((100 * progress) / width), 100),
19
19
  "%"))));
20
20
  }
21
+ function mapper(char) {
22
+ return function (_item, idx) {
23
+ return React.createElement(Text, { key: idx }, char);
24
+ };
25
+ }
21
26
  function useProgress(obs$, total, width, onComplete) {
22
27
  const [progress, setProgress] = useState([0, width]);
23
28
  useLayoutEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altronix/cli",
3
- "version": "0.7.17",
3
+ "version": "0.7.19",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,8 +22,8 @@
22
22
  "react": "^18.2.0",
23
23
  "rxjs": "^7.8.1",
24
24
  "winston": "^3.13.0",
25
- "@altronix/device": "0.7.0",
26
- "@altronix/zdk": "0.7.1"
25
+ "@altronix/device": "0.7.1",
26
+ "@altronix/zdk": "0.7.2"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@sindresorhus/tsconfig": "^3.0.1",