Rename workspace modules to avoid confusion

This commit is contained in:
KernelDeimos 2024-04-23 04:06:03 -04:00
parent 74e213a534
commit 65a73b5b45
53 changed files with 2345 additions and 1943 deletions

4171
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,12 +6,10 @@
"scripts": {
"test": "npx mocha"
},
"workspaces": [
"packages/*"
],
"dependencies": {
"@heyputer/kv.js": "^0.1.3",
"@heyputer/multest": "^0.0.2",
"@heyputer/puter-js-common": "^1.0.0",
"@opentelemetry/api": "^1.4.1",
"@opentelemetry/auto-instrumentations-node": "^0.43.0",
"@opentelemetry/exporter-trace-otlp-grpc": "^0.40.0",

View File

@ -1,5 +1,5 @@
{
"name": "puter-js-common",
"name": "@heyputer/puter-js-common",
"version": "1.0.0",
"description": "",
"main": "index.js",

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { Context } = require('./util/context');

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
class DatabaseModule extends AdvancedBase {
async install (context) {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { Context } = require('./util/context');
class Kernel extends AdvancedBase {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
class LocalDiskStorageModule extends AdvancedBase {
async install (context) {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
class PuterDriversModule extends AdvancedBase {
async install () {}

View File

@ -1,4 +1,4 @@
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const config = require("./config");
class SelfhostedModule extends AdvancedBase {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
class ThirdPartyDriversModule extends AdvancedBase {
// constructor () {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { quot } = require("../util/strutil");
const { TechnicalError } = require("../errors/TechnicalError");
const { print_error_help } = require("../errors/error_help_details");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { quot } = require("../util/strutil");
class ConfigLoader extends AdvancedBase {

View File

@ -27,7 +27,7 @@ const SystemFSEntryService = require('./storage/SystemFSEntryService.js');
const PerformanceMonitor = require('../monitor/PerformanceMonitor.js');
const { NodePathSelector, NodeUIDSelector, NodeInternalIDSelector } = require('./node/selectors.js');
const FSNodeContext = require('./FSNodeContext.js');
const { AdvancedBase } = require('puter-js-common');
const { AdvancedBase } = require('@heyputer/puter-js-common');
const { Context } = require('../util/context.js');
const { simple_retry } = require('../util/retryutil.js');
const APIError = require('../api/APIError.js');

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require('puter-js-common');
const { AdvancedBase } = require('@heyputer/puter-js-common');
const PathResolver = require('../../routers/filesystem_api/batch/PathResolver');
const commands = require('./commands').commands;
const { WorkUnit } = require('../../services/runtime-analysis/ExpectationService');

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { AsyncProviderTrait } = require("../../traits/AsyncProviderTrait");
const { HLMkdir, QuickMkdir } = require("../hl_operations/hl_mkdir");
const { Context } = require("../../util/context");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { id2path } = require("../../helpers");
const { PuterPath } = require("../lib/PuterPath");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { WeakConstructorTrait } = require("../traits/WeakConstructorTrait");
const { Eq, And } = require("./query/query");
const { Entity } = require("./entitystorage/Entity");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { instance_ } = require("../../monitor/PerformanceMonitor");
const { WeakConstructorTrait } = require("../../traits/WeakConstructorTrait");
const { Property } = require("./Property");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { WeakConstructorTrait } = require("../../traits/WeakConstructorTrait");
class PropType extends AdvancedBase {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { WeakConstructorTrait } = require("../../traits/WeakConstructorTrait");
class Property extends AdvancedBase {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { WeakConstructorTrait } = require("../../traits/WeakConstructorTrait");
const { Context } = require("../../util/context");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { WeakConstructorTrait } = require("../../traits/WeakConstructorTrait");
class Entity extends AdvancedBase {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { BaseES } = require("./BaseES");
const APIError = require("../../api/APIError");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { BaseES } = require("./BaseES");
const APIError = require("../../api/APIError");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { WeakConstructorTrait } = require("../../traits/WeakConstructorTrait");
class Predicate extends AdvancedBase {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const api_error_handler = require("../../api/api_error_handler");
const config = require("../../config");
const { get_user, get_app, id2path } = require("../../helpers");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const NOOP = async () => {};

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
class Emailservice extends AdvancedBase {
static MODULES = {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
class EngPortalService extends AdvancedBase {
static MODULES = {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { Context } = require("../util/context");
const { ContextAwareTrait } = require("../traits/ContextAwareTrait");
const { OtelTrait } = require("../traits/OtelTrait");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const BaseService = require("./BaseService");
class MapCollection extends AdvancedBase {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
class StorageService extends AdvancedBase {
constructor ({ services }) {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
class WSPushService extends AdvancedBase {
static MODULES = {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const BaseService = require("../BaseService");
const { Context } = require("../../util/context");
const config = require("../../config");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { Context } = require("../../util/context");
const { get_user, get_app } = require("../../helpers");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const BaseService = require("../BaseService");
class BaseDatabaseAccessService extends BaseService {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { Context } = require("../../util/context");
const APIError = require("../../api/APIError");
const { DriverError } = require("./DriverError");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { Context } = require("../../util/context");
const { MultiValue } = require("../../util/multivalue");
const { stream_to_buffer } = require("../../util/streamutil");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { Context } = require("../../../util/context");
const APIError = require("../../../api/APIError");
const { AppUnderUserActorType, Actor, UserActorType } = require("../../auth/Actor");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const ENDPOINT = 'https://api.puter.com/drivers/call';

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { BasicBase } = require("puter-js-common/src/bases/BasicBase");
const { BasicBase } = require("@heyputer/puter-js-common/src/bases/BasicBase");
const types = require("../types");
const { hash_serializable_object, stringify_serializable_object } = require("../../../util/datautil");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { BasicBase } = require("puter-js-common/src/bases/BasicBase");
const { BasicBase } = require("@heyputer/puter-js-common/src/bases/BasicBase");
const { TypeSpec } = require("./Construct");
class RuntimeEntity extends BasicBase {

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { is_valid_path } = require("../../filesystem/validation");
const { is_valid_url, is_valid_uuid4 } = require("../../helpers");
const { FileFacade } = require("./FileFacade");

View File

@ -17,7 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const TeePromise = require("@heyputer/multest/src/util/TeePromise");
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { FileTracker } = require("./FileTracker");
const { pausing_tee } = require("../../util/streamutil");

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
const APIError = require("../../api/APIError");
const { Context } = require("../../util/context");
const BaseService = require("../BaseService");

View File

@ -22,7 +22,7 @@
const axios = require('axios');
const { TeePromise } = require("../../util/promise");
const { AdvancedBase } = require('puter-js-common');
const { AdvancedBase } = require('@heyputer/puter-js-common');
const FormData = require("form-data");
const { stream_to_the_void, buffer_to_stream } = require('../../util/streamutil');
const BaseService = require('../BaseService');

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("puter-js-common");
const { AdvancedBase } = require("@heyputer/puter-js-common");
/**
* MutliValue represents a subject with multiple values or a value with multiple

View File

@ -1,11 +1,11 @@
{
"name": "dev-ansi-terminal",
"name": "@heyputer/phoenix",
"version": "0.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "dev-ansi-terminal",
"name": "@heyputer/phoenix",
"version": "0.0.0",
"license": "AGPL-3.0-only",
"workspaces": [

View File

@ -1,5 +1,5 @@
{
"name": "dev-ansi-terminal",
"name": "@heyputer/phoenix",
"version": "0.0.0",
"description": "ANSI Terminal for Puter",
"main": "exports.js",

View File

@ -1,5 +1,5 @@
{
"name": "puter-js-common",
"name": "@heyputer/puter-js-common",
"version": "1.0.0",
"description": "",
"main": "index.js",

View File

@ -1,5 +1,5 @@
{
"name": "puter",
"name": "@heyputer/puterjs",
"version": "1.0.0",
"description": "",
"main": "index.js",

View File

@ -1,5 +1,5 @@
{
"name": "@putersh/terminal-emulator",
"name": "@heyputer/terminal",
"version": "0.0.0",
"description": "ANSI Terminal for Puter",
"main": "exports.js",

View File

@ -93,14 +93,6 @@ const early_init_errors = [
}
];
const newstuff = {
// Nullish coalescing operator
nco: (...a) => a.reduce((acc, val) => acc == undefined ? val : acc),
// Optional chaining
oc: (obj, ...keys) => keys.reduce((acc, key) => acc ? acc[key] : undefined, obj),
oc_call: (maybe_fn, ...args) => maybe_fn ? maybe_fn(...args) : undefined,
};1
const _print_error_help = (error_help) => {
const lines = [];
lines.push(nco(error_help.title, error_help.text));
@ -128,7 +120,8 @@ const _print_error_help = (error_help) => {
await main();
} catch (e) {
for ( const error_help of early_init_errors ) {
if ( oc_call(oc(e, message, includes), error_help.text) ) {
const message = e && e.message;
if ( e.message && e.message.includes(error_help.text) ) {
_print_error_help(error_help);
break;
}