mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Remove base alias from packages (make scripts use relative paths for now)
This commit is contained in:
parent
fbb5c63c33
commit
785ba1e053
18 changed files with 37 additions and 33 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"version": "1.1.0",
|
||||||
"workspace": [
|
"workspace": [
|
||||||
"./packages/api",
|
"./packages/api",
|
||||||
"./packages/conf",
|
"./packages/conf",
|
||||||
|
|
@ -43,7 +44,6 @@
|
||||||
"./public"
|
"./public"
|
||||||
],
|
],
|
||||||
"imports": {
|
"imports": {
|
||||||
"@/": "./packages/ditto/",
|
|
||||||
"@b-fuze/deno-dom": "jsr:@b-fuze/deno-dom@^0.1.47",
|
"@b-fuze/deno-dom": "jsr:@b-fuze/deno-dom@^0.1.47",
|
||||||
"@bradenmacdonald/s3-lite-client": "jsr:@bradenmacdonald/s3-lite-client@^0.7.4",
|
"@bradenmacdonald/s3-lite-client": "jsr:@bradenmacdonald/s3-lite-client@^0.7.4",
|
||||||
"@cashu/cashu-ts": "npm:@cashu/cashu-ts@^2.2.0",
|
"@cashu/cashu-ts": "npm:@cashu/cashu-ts@^2.2.0",
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "@ditto/ditto",
|
"name": "@ditto/ditto",
|
||||||
"version": "1.1.0",
|
|
||||||
"exports": {},
|
"exports": {},
|
||||||
"imports": {
|
"imports": {
|
||||||
"deno.json": "./deno.json"
|
"@/": "./",
|
||||||
|
"deno.json": "../../deno.json"
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"rules": {
|
"rules": {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import { JsonParseStream } from '@std/json/json-parse-stream';
|
import { JsonParseStream } from '@std/json/json-parse-stream';
|
||||||
import { TextLineStream } from '@std/streams/text-line-stream';
|
import { TextLineStream } from '@std/streams/text-line-stream';
|
||||||
|
|
||||||
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
import { AdminSigner } from '../packages/ditto/signers/AdminSigner.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
import { type EventStub } from '@/utils/api.ts';
|
import { type EventStub } from '../packages/ditto/utils/api.ts';
|
||||||
import { nostrNow } from '@/utils.ts';
|
import { nostrNow } from '../packages/ditto/utils.ts';
|
||||||
|
|
||||||
const signer = new AdminSigner();
|
const signer = new AdminSigner();
|
||||||
const store = await Storages.db();
|
const store = await Storages.db();
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { NSchema } from '@nostrify/nostrify';
|
import { NSchema } from '@nostrify/nostrify';
|
||||||
import { nip19 } from 'nostr-tools';
|
import { nip19 } from 'nostr-tools';
|
||||||
|
|
||||||
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
import { AdminSigner } from '../packages/ditto/signers/AdminSigner.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
import { nostrNow } from '@/utils.ts';
|
import { nostrNow } from '../packages/ditto/utils.ts';
|
||||||
|
|
||||||
const store = await Storages.db();
|
const store = await Storages.db();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { assertEquals, assertThrows } from '@std/assert';
|
import { assertEquals, assertThrows } from '@std/assert';
|
||||||
|
|
||||||
import { buildFilter } from './db-export.ts';
|
import { buildFilter } from './db-export.ts';
|
||||||
|
|
||||||
Deno.test('buildFilter should return an empty filter when no arguments are provided', () => {
|
Deno.test('buildFilter should return an empty filter when no arguments are provided', () => {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import { Storages } from '@/storages.ts';
|
|
||||||
import { NostrFilter } from '@nostrify/nostrify';
|
import { NostrFilter } from '@nostrify/nostrify';
|
||||||
import { Command, InvalidOptionArgumentError } from 'commander';
|
import { Command, InvalidOptionArgumentError } from 'commander';
|
||||||
|
|
||||||
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
|
|
||||||
interface ExportFilter {
|
interface ExportFilter {
|
||||||
authors?: string[];
|
authors?: string[];
|
||||||
ids?: string[];
|
ids?: string[];
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { NostrEvent } from '@nostrify/nostrify';
|
||||||
import { JsonParseStream } from '@std/json/json-parse-stream';
|
import { JsonParseStream } from '@std/json/json-parse-stream';
|
||||||
import { TextLineStream } from '@std/streams/text-line-stream';
|
import { TextLineStream } from '@std/streams/text-line-stream';
|
||||||
|
|
||||||
import { Conf } from '@/config.ts';
|
import { Conf } from '../packages/ditto/config.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
|
|
||||||
const store = await Storages.db();
|
const store = await Storages.db();
|
||||||
const sem = new Semaphore(Conf.pg.poolSize);
|
const sem = new Semaphore(Conf.pg.poolSize);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
|
|
||||||
// This migrates kysely internally.
|
// This migrates kysely internally.
|
||||||
const kysely = await Storages.kysely();
|
const kysely = await Storages.kysely();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { policyWorker } from '@/workers/policy.ts';
|
import { policyWorker } from '../packages/ditto/workers/policy.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
|
|
||||||
const db = await Storages.db();
|
const db = await Storages.db();
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { NostrEvent } from '@nostrify/nostrify';
|
import { NostrEvent } from '@nostrify/nostrify';
|
||||||
|
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
import { EventsDB } from '@/storages/EventsDB.ts';
|
import { EventsDB } from '../packages/ditto/storages/EventsDB.ts';
|
||||||
|
|
||||||
const kysely = await Storages.kysely();
|
const kysely = await Storages.kysely();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { Semaphore } from '@core/asyncutil';
|
import { Semaphore } from '@core/asyncutil';
|
||||||
|
|
||||||
import { updateAuthorData } from '@/pipeline.ts';
|
|
||||||
import { Storages } from '@/storages.ts';
|
|
||||||
import { NostrEvent } from '@nostrify/nostrify';
|
import { NostrEvent } from '@nostrify/nostrify';
|
||||||
|
|
||||||
|
import { updateAuthorData } from '../packages/ditto/pipeline.ts';
|
||||||
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
|
|
||||||
const kysely = await Storages.kysely();
|
const kysely = await Storages.kysely();
|
||||||
const sem = new Semaphore(5);
|
const sem = new Semaphore(5);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { NSchema as n } from '@nostrify/nostrify';
|
import { NSchema as n } from '@nostrify/nostrify';
|
||||||
import { Storages } from '@/storages.ts';
|
|
||||||
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
|
|
||||||
const store = await Storages.db();
|
const store = await Storages.db();
|
||||||
const kysely = await Storages.kysely();
|
const kysely = await Storages.kysely();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { Conf } from '@/config.ts';
|
import { Conf } from '../packages/ditto/config.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
|
|
||||||
const kysely = await Storages.kysely();
|
const kysely = await Storages.kysely();
|
||||||
const statsQuery = kysely.selectFrom('author_stats').select('pubkey');
|
const statsQuery = kysely.selectFrom('author_stats').select('pubkey');
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
import { NostrEvent, NRelay1, NSchema } from '@nostrify/nostrify';
|
import { NostrEvent, NRelay1, NSchema } from '@nostrify/nostrify';
|
||||||
import { nip19 } from 'nostr-tools';
|
import { nip19 } from 'nostr-tools';
|
||||||
|
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
|
|
||||||
const store = await Storages.db();
|
const store = await Storages.db();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
|
||||||
import { Command } from 'commander';
|
import { Command } from 'commander';
|
||||||
import { NostrEvent } from 'nostr-tools';
|
import { NostrEvent } from 'nostr-tools';
|
||||||
import { nostrNow } from '@/utils.ts';
|
|
||||||
import { Conf } from '@/config.ts';
|
import { AdminSigner } from '../packages/ditto/signers/AdminSigner.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { nostrNow } from '../packages/ditto/utils.ts';
|
||||||
|
import { Conf } from '../packages/ditto/config.ts';
|
||||||
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
|
|
||||||
function die(code: number, ...args: unknown[]) {
|
function die(code: number, ...args: unknown[]) {
|
||||||
console.error(...args);
|
console.error(...args);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { exists } from '@std/fs/exists';
|
||||||
import { generateSecretKey, nip19 } from 'nostr-tools';
|
import { generateSecretKey, nip19 } from 'nostr-tools';
|
||||||
import question from 'question-deno';
|
import question from 'question-deno';
|
||||||
|
|
||||||
import { Conf } from '@/config.ts';
|
import { Conf } from '../packages/ditto/config.ts';
|
||||||
|
|
||||||
console.log('');
|
console.log('');
|
||||||
console.log('Hello! Welcome to the Ditto setup tool. We will ask you a few questions to generate a .env file for you.');
|
console.log('Hello! Welcome to the Ditto setup tool. We will ask you a few questions to generate a .env file for you.');
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { nip19 } from 'nostr-tools';
|
import { nip19 } from 'nostr-tools';
|
||||||
|
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '../packages/ditto/storages.ts';
|
||||||
import { refreshAuthorStats } from '@/utils/stats.ts';
|
import { refreshAuthorStats } from '../packages/ditto/utils/stats.ts';
|
||||||
|
|
||||||
let pubkey: string;
|
let pubkey: string;
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import {
|
||||||
updateTrendingLinks,
|
updateTrendingLinks,
|
||||||
updateTrendingPubkeys,
|
updateTrendingPubkeys,
|
||||||
updateTrendingZappedEvents,
|
updateTrendingZappedEvents,
|
||||||
} from '@/trends.ts';
|
} from '../packages/ditto/trends.ts';
|
||||||
|
|
||||||
const trendSchema = z.enum(['pubkeys', 'zapped_events', 'events', 'hashtags', 'links']);
|
const trendSchema = z.enum(['pubkeys', 'zapped_events', 'events', 'hashtags', 'links']);
|
||||||
const trends = trendSchema.array().parse(Deno.args);
|
const trends = trendSchema.array().parse(Deno.args);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue