Compare commits

..

No commits in common. "v0.1.0-develop.1" and "v0.0.1" have entirely different histories.

8 changed files with 1 additions and 18363 deletions

View File

@ -1,13 +0,0 @@
name: Build/Publish
on:
push:
branches:
- master
- develop
- develop-*
jobs:
main:
uses: lumeweb/github-node-deploy-workflow/.github/workflows/main.yml@master
secrets: inherit

View File

@ -1,5 +0,0 @@
{
"preset": [
"@lumeweb/node-library-preset"
]
}

View File

@ -1,6 +0,0 @@
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/publish-kernel-module/compare/v0.0.1...v0.1.0-develop.1) (2023-06-26)
### Features
* initial version ([65f3dcc](https://git.lumeweb.com/LumeWeb/publish-kernel-module/commit/65f3dcca6fe2cb3d65be7e4dc11e529f1bf06370))

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 Hammer Technologies LLC
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

18209
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +0,0 @@
{
"name": "@lumeweb/publish-kernel-module",
"version": "0.1.0-develop.1",
"type": "module",
"repository": {
"type": "git",
"url": "gitea@git.lumeweb.com:LumeWeb/publish-kernel-module.git"
},
"devDependencies": {
"@lumeweb/node-library-preset": "git+https://git.lumeweb.com/LumeWeb/node-library-preset.git",
"@types/prompts": "^2.4.4",
"presetter": "*"
},
"readme": "ERROR: No README data found!",
"scripts": {
"prepare": "presetter bootstrap",
"build": "run build",
"semantic-release": "semantic-release"
},
"publishConfig": {
"access": "public"
},
"files": [
"lib/**"
],
"dependencies": {
"@lumeweb/community-portals": "^0.1.0-develop.4",
"@lumeweb/libportal": "^0.2.0-develop.9",
"@lumeweb/libweb": "^0.2.0-develop.19",
"chalk": "^5.2.0",
"prompts": "^2.4.2"
},
"bin": "./lib/index.js"
}

View File

@ -1,84 +0,0 @@
#! /usr/bin/env node
import prompts from "prompts";
import * as process from "process";
import fs from "fs/promises";
import path from "path";
import {
hexToBytes,
maybeInitDefaultPortals,
setActivePortalMasterKey,
uploadObject,
} from "@lumeweb/libweb";
import chalk from "chalk";
import * as util from "util";
import { fileExists } from "#util.js";
let key = process.env.PORTAL_PRIVATE_KEY;
if (!key) {
// @ts-ignore
key = await prompts.prompts.password({
name: "private_key",
message: "Enter your private key",
validate: (prev) => prev && prev.length === 64,
});
}
let file = process.env.KERNEL_FILE;
if (!file || !(await fileExists(file))) {
const cwd = process.cwd();
const locations = [
"dist/module.js",
"dist/index.js",
"lib/module.js",
"lib/index.js",
];
const promises = locations.map((item) => {
item = path.join(cwd, item);
return [item, fileExists(item)];
});
const pResults: boolean[] = await Promise.all(
promises.map((item) => item[1] as Promise<boolean>),
);
const results = pResults.reduce((prev, cur, index) => {
if (cur) {
prev.push(locations[index]);
}
return prev;
}, [] as any);
if (!results.length) {
console.error("Kernel module could not be found");
process.exit(1);
}
file = results[0];
}
setActivePortalMasterKey(hexToBytes(key as string));
maybeInitDefaultPortals();
const fd = await fs.open(file as string);
const [cid, err] = await uploadObject(
fd.createReadStream(),
BigInt((await fd.stat()).size),
);
if (err) {
console.error("Failed to publish: ", err);
}
console.log(
util.format(
"%s: %s",
chalk.green("Kernel module successfully published"),
cid,
),
);

View File

@ -1,11 +0,0 @@
import fs from "fs/promises";
export async function fileExists(path: string) {
try {
await fs.stat(path);
} catch {
return false;
}
return true;
}