Fix aliases

This commit is contained in:
Acid Chicken (硫酸鶏) 2019-08-11 08:51:53 +09:00
parent 1dc433b292
commit bfde75dae6
No known key found for this signature in database
GPG key ID: 5388F56C75B677A1
10 changed files with 11 additions and 10 deletions

View file

@ -1,4 +1,4 @@
declare module '*/package.json' { declare module 'package.json' {
interface IRepository { interface IRepository {
type: string; type: string;
url: string; url: string;

View file

@ -1,5 +1,5 @@
import * as program from 'commander'; import * as program from 'commander';
import * as pkg from '~/package.json'; import * as pkg from 'package.json';
program program
.version(pkg.version) .version(pkg.version)

View file

@ -8,7 +8,7 @@ import Logger from '~/services/logger';
import loadConfig from '~/config/load'; import loadConfig from '~/config/load';
import { Config } from '~/config/types'; import { Config } from '~/config/types';
import { lessThan } from '~/prelude/array'; import { lessThan } from '~/prelude/array';
import * as pkg from '~/package.json'; import * as pkg from 'package.json';
import { program } from '~/argv'; import { program } from '~/argv';
import { showMachineInfo } from '~/misc/show-machine-info'; import { showMachineInfo } from '~/misc/show-machine-info';
import { initDb } from '~/db/postgre'; import { initDb } from '~/db/postgre';

View file

@ -5,7 +5,7 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as yaml from 'js-yaml'; import * as yaml from 'js-yaml';
import { Source, Mixin } from './types'; import { Source, Mixin } from './types';
import * as pkg from '~/package.json'; import * as pkg from 'package.json';
/** /**
* Path of configuration directory * Path of configuration directory

View file

@ -3,7 +3,7 @@ import * as os from 'os';
import config from '~/config'; import config from '~/config';
import define from '~/server/api/define'; import define from '~/server/api/define';
import { fetchMeta } from '~/misc/fetch-meta'; import { fetchMeta } from '~/misc/fetch-meta';
import * as pkg from '~/package.json'; import * as pkg from 'package.json';
import { Emojis } from '~/models'; import { Emojis } from '~/models';
import { getConnection } from 'typeorm'; import { getConnection } from 'typeorm';
import redis from '~/db/redis'; import redis from '~/db/redis';

View file

@ -1,6 +1,6 @@
import config from '~/config'; import config from '~/config';
import endpoints from '~/server/api/endpoints'; import endpoints from '~/server/api/endpoints';
import * as locale from '%'; import * as locale from '$';
import { fromEntries } from '~/prelude/array'; import { fromEntries } from '~/prelude/array';
import { kinds as kindsList } from '~/server/api/kinds'; import { kinds as kindsList } from '~/server/api/kinds';

View file

@ -2,7 +2,7 @@ import * as Router from 'koa-router';
import config from '~/config'; import config from '~/config';
import { fetchMeta } from '~/misc/fetch-meta'; import { fetchMeta } from '~/misc/fetch-meta';
// import User from '~/models/user'; // import User from '~/models/user';
import { name as softwareName, version, repository } from '~/package.json'; import { name as softwareName, version, repository } from 'package.json';
// import Note from '~/models/note'; // import Note from '~/models/note';
const router = new Router(); const router = new Router();

View file

@ -13,7 +13,7 @@ import * as glob from 'glob';
import config from '~/config'; import config from '~/config';
import { licenseHtml } from '~/misc/license'; import { licenseHtml } from '~/misc/license';
import { copyright } from '~/const.json'; import { copyright } from '~/const.json';
import * as locales from '%'; import * as locales from '$';
import * as nestedProperty from 'nested-property'; import * as nestedProperty from 'nested-property';
function getLang(lang: string): string { function getLang(lang: string): string {

View file

@ -13,7 +13,7 @@ import * as views from 'koa-views';
import docs from './docs'; import docs from './docs';
import packFeed from './feed'; import packFeed from './feed';
import { fetchMeta } from '~/misc/fetch-meta'; import { fetchMeta } from '~/misc/fetch-meta';
import * as pkg from '~/package.json'; import * as pkg from 'package.json';
import { genOpenapiSpec } from '~/server/api/openapi/gen-spec'; import { genOpenapiSpec } from '~/server/api/openapi/gen-spec';
import config from '~/config'; import config from '~/config';
import { Users, Notes, Emojis, UserProfiles, Pages } from '~/models'; import { Users, Notes, Emojis, UserProfiles, Pages } from '~/models';

View file

@ -21,8 +21,9 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"baseUrl": "./", "baseUrl": "./",
"paths": { "paths": {
"package.json": ["./package.json"],
"~*": ["./src*"], "~*": ["./src*"],
"%": ["./locales/"] "$": ["./locales/"]
}, },
"typeRoots": [ "typeRoots": [
"node_modules/@types", "node_modules/@types",