Skip to content

Commit

Permalink
New relative module subpaths
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal Web committed Apr 23, 2023
1 parent 3bb364c commit 1fe8a91
Show file tree
Hide file tree
Showing 65 changed files with 627 additions and 563 deletions.
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
"no-spaced-func": "error",
"no-ternary": "off",
"no-trailing-spaces": "error",
"no-underscore-dangle": "error",
"no-underscore-dangle": ["error", { "allow": ["__dirname", "__filename"] }],
"no-unneeded-ternary": "error",
"no-constant-binary-expression": "error",
"no-whitespace-before-property": "error",
Expand Down Expand Up @@ -511,7 +511,6 @@
"jsdoc/implements-on-classes": 0,
"jsdoc/match-description": 1,
"jsdoc/multiline-blocks": 0,
"jsdoc/newline-after-description": 1,
"jsdoc/no-bad-blocks": 1,
"jsdoc/no-defaults": 0,
"jsdoc/no-missing-syntax": 0,
Expand Down
2 changes: 1 addition & 1 deletion DIS/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createServer } from '../server/index.js';
import { info } from 'utilities/logs.js';
import { info } from '#logs';
const server = await createServer({
maxMTU: 1100,
max: 900,
Expand Down
4 changes: 2 additions & 2 deletions browser/protocol/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PassThrough } from 'stream';
import { protocol } from 'electron';
import { read } from 'utilities/file.js';
import { currentPath } from 'utilities/directory.js';
import { read } from '#utilities/file.js';
import { currentPath } from '#utilities/directory.js';
export * from './local/index.js';
import uws from 'client/index.js';
const service = await uws.getCertificate(`${currentPath(import.meta)}/../../services/universal.web.cert`);
Expand Down
2 changes: 1 addition & 1 deletion browser/protocol/local/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import { protocol } from 'electron';
import { currentPath } from 'utilities/directory.js';
import { currentPath } from '#utilities/directory.js';
const resourcesDirectory = path.normalize(`${currentPath(import.meta)}/../../resources/`);
console.log(resourcesDirectory);
const resourceWhiteList = ['css/index.css', 'css/uikit-rtl.css', 'css/uikit-rtl.css', 'css/uikit.css',
Expand Down
2 changes: 1 addition & 1 deletion client/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { configure } from '../utilities/logs.js';
import { configure } from '#logs';
function buildConfiguration(configuration) {
const {
ip,
Expand Down
2 changes: 1 addition & 1 deletion client/connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { connected } from '../utilities/logs.js';
import { connected } from '#logs';
export async function connect(requestBody, requestHead) {
console.log('-------CLIENT CONNECTING-------\n');
const thisClient = this;
Expand Down
2 changes: 1 addition & 1 deletion client/emit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
success, failed, imported, msgSent, info
} from '../utilities/logs.js';
} from '#logs';
imported('Emit');
async function emit(api, body) {
const thisContext = this;
Expand Down
16 changes: 8 additions & 8 deletions client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ import {
} from 'Acid';
import dgram from 'dgram';
// Default utility imports
import { success, configure } from 'utilities/logs.js';
import { buildPacketSize } from '../utilities/buildPacketSize.js';
import { buildStringSize } from '../utilities/buildStringSize.js';
import { file } from '../utilities/file.js';
import { success, configure } from '#logs';
import { buildPacketSize } from '#utilities/buildPacketSize.js';
import { buildStringSize } from '#utilities/buildStringSize.js';
import { file } from '#utilities/file.js';
import {
createSessionKey,
clientSession,
createClientId,
keypair,
toBase64
} from '../utilities/crypto.js';
import { pluckBuffer } from '../utilities/pluckBuffer.js';
import { certificate } from '../utilities/certificate/index.js';
import { watch } from '../utilities/watch.js';
} from '#utilities/crypto.js';
import { pluckBuffer } from '#utilities/pluckBuffer.js';
import { certificate } from '#utilities/certificate/index.js';
import { watch } from '#utilities/watch.js';
// Client specific imports
import { getClient } from './getClient.js';
// Client specific imports to extend class
Expand Down
2 changes: 1 addition & 1 deletion client/listening.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
success, failed, imported, msgSent, info
} from '../utilities/logs.js'; imported('Server onListen');
} from '#logs'; imported('Server onListen');
export function onListening() {
const connection = this.server.address();
success(`Universal Web Client Server Listening`, connection);
Expand Down
4 changes: 2 additions & 2 deletions client/onMessage.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
success, failed, imported, msgSent, info, msgReceived
} from '../utilities/logs.js';
} from '#logs';
import {
encode,
decode
} from 'msgpackr';
import { decrypt } from '../utilities/crypto.js';
import { decrypt } from '#utilities/crypto.js';
imported('Server onMessage');
export async function onMessage(messageBuffer, connection) {
const thisContext = this;
Expand Down
2 changes: 1 addition & 1 deletion client/processMessage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
success, failed, imported, msgSent, info
} from '../utilities/logs.js';
} from '#logs';
import {
stringify,
hasValue
Expand Down
2 changes: 1 addition & 1 deletion client/request.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
success, failed, imported, msgSent, info
} from '../utilities/logs.js';
} from '#logs';
import { promise, } from 'Acid';
imported('Request');
export async function request(api, body = null, head = {}) {
Expand Down
8 changes: 4 additions & 4 deletions client/send.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
success, failed, imported, msgSent, info
} from '../utilities/logs.js';
import { buildPacketSize } from '../utilities/buildPacketSize.js';
import { buildStringSize } from '../utilities/buildStringSize.js';
} from '#logs';
import { buildPacketSize } from '#utilities/buildPacketSize.js';
import { buildStringSize } from '#utilities/buildStringSize.js';
import {
encode,
decode
Expand All @@ -13,7 +13,7 @@ import {
nonceBox,
toBase64,
hashSign
} from '../utilities/crypto.js';
} from '#utilities/crypto.js';
imported('Client Send');
export async function send(message, priority) {
console.log(`Priority: ${priority}`);
Expand Down
13 changes: 13 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"#utilities/*": ["./utilities/*"],
"#server/*": ["./server/*"],
"#client/*": ["./server/*"],
"#profile/*": ["./profile/*"],
"#serverApp/*": ["./serverApp/*"],
"#schemes/*": ["./schemes/*"],
"#resources/*": ["./resources/*"],
"#scripts/*": ["./scripts/*"],
"#state/*": ["./state/*"],
"#config/*": ["./config/*"],
"#udsp/*": ["./udsp/*"],
},
"module": "ESNext",
"moduleResolution": "nodenext",
"target": "ESNext",
Expand Down
Loading

0 comments on commit 1fe8a91

Please sign in to comment.