0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor: remove unused files (#2877)

This commit is contained in:
Gao Sun 2023-01-09 19:39:56 +08:00 committed by GitHub
parent a47671eb94
commit d0a81e76a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 13 deletions

View file

@ -1,4 +0,0 @@
// Have to define this in a separate file since Jest sticks with CJS
// We need to mock this before running tests
// https://github.com/facebook/jest/issues/12952
export const metaUrl = import.meta.url;

View file

@ -6,10 +6,9 @@ import path from 'path';
import { findPackage } from '@logto/shared';
import { getPathInModule } from '../../../utilities.js';
import { metaUrl } from './meta-url.js';
import type { AlterationFile } from './type.js';
const currentDirname = path.dirname(fileURLToPath(metaUrl));
const currentDirname = path.dirname(fileURLToPath(import.meta.url));
const alterationFilenameRegex = /-(\d+)-?.*\.js$/;
export const getTimestampFromFilename = (filename: string) => {

View file

@ -1,4 +0,0 @@
// Have to define this in a separate file since Jest sticks with CJS
// We need to mock this before running tests
// https://github.com/facebook/jest/issues/12952
export const metaUrl = import.meta.url;

View file

@ -15,8 +15,6 @@ import type { Options } from 'ora';
import ora from 'ora';
import { z } from 'zod';
import { metaUrl } from './meta-url.js';
export const safeExecSync = (command: string) => {
try {
return execSync(command, { encoding: 'utf8', stdio: 'pipe' });
@ -87,7 +85,7 @@ export const downloadFile = async (url: string, destination: string) => {
export const getPathInModule = (moduleName: string, relativePath = '/') =>
// https://stackoverflow.com/a/49455609/12514940
path.join(
path.dirname(createRequire(metaUrl).resolve(`${moduleName}/package.json`)),
path.dirname(createRequire(import.meta.url).resolve(`${moduleName}/package.json`)),
relativePath
);