refactor: refactoring imports
将来ESMに移行しやすいように Related: #7658 なんかmochaが起動しなくなってるけど理由不明 すぐ直したい
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// ex) node built/tools/accept-migration Yo 1000000000001
|
||||
|
||||
import { createConnection } from 'typeorm';
|
||||
import config from '@/config';
|
||||
import config from '@/config/index.js';
|
||||
|
||||
createConnection({
|
||||
type: 'postgres',
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Emojis } from '../models';
|
||||
import { genId } from '@/misc/gen-id';
|
||||
import { Emojis } from '@/models/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
|
||||
async function main(name: string, url: string, alias?: string): Promise<any> {
|
||||
const aliases = alias != null ? [ alias ] : [];
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { initDb } from '../db/postgre';
|
||||
import { initDb } from '../db/postgre.js';
|
||||
import { getRepository } from 'typeorm';
|
||||
import { User } from '../models/entities/user';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
|
||||
async function main(username: string) {
|
||||
if (!username) throw `username required`;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { initDb } from '../db/postgre';
|
||||
import { initDb } from '../db/postgre.js';
|
||||
import { getRepository } from 'typeorm';
|
||||
import { User } from '../models/entities/user';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
|
||||
async function main(username: string) {
|
||||
if (!username) throw `username required`;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { updateQuestion } from '../remote/activitypub/models/question';
|
||||
import { updateQuestion } from '@/remote/activitypub/models/question.js';
|
||||
|
||||
async function main(uri: string): Promise<any> {
|
||||
return await updateQuestion(uri);
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { initDb } from '@/db/postgre';
|
||||
import { parseAcct } from '@/misc/acct';
|
||||
import { initDb } from '@/db/postgre.js';
|
||||
import { parseAcct } from '@/misc/acct.js';
|
||||
|
||||
async function main(acct: string): Promise<any> {
|
||||
await initDb();
|
||||
const { resolveUser } = await import('../remote/resolve-user');
|
||||
const { resolveUser } = await import('@/remote/resolve-user');
|
||||
|
||||
const { username, host } = parseAcct(acct);
|
||||
await resolveUser(username, host, {}, true);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Users, Signins } from '../models';
|
||||
import { Users, Signins } from '@/models/index.js';
|
||||
|
||||
// node built/tools/show-signin-history username
|
||||
// => {Success} {Date} {IPAddrsss}
|
||||
|
Reference in New Issue
Block a user