mirror of
https://github.com/umami-software/umami.git
synced 2026-02-03 20:27:13 +01:00
Replaced __dirname usage.
This commit is contained in:
parent
b5efbbbb2e
commit
73b45a9f5e
11 changed files with 25 additions and 28 deletions
10
pnpm-workspace.yaml
Normal file
10
pnpm-workspace.yaml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
packages:
|
||||||
|
- '**'
|
||||||
|
ignoredBuiltDependencies:
|
||||||
|
- cypress
|
||||||
|
- esbuild
|
||||||
|
- sharp
|
||||||
|
onlyBuiltDependencies:
|
||||||
|
- '@prisma/client'
|
||||||
|
- '@prisma/engines'
|
||||||
|
- prisma
|
||||||
|
|
@ -21,7 +21,7 @@ if (process.env.MAXMIND_LICENSE_KEY) {
|
||||||
`?edition_id=${db}&license_key=${process.env.MAXMIND_LICENSE_KEY}&suffix=tar.gz`;
|
`?edition_id=${db}&license_key=${process.env.MAXMIND_LICENSE_KEY}&suffix=tar.gz`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dest = path.resolve(__dirname, '../geo');
|
const dest = path.resolve(process.cwd(), 'geo');
|
||||||
|
|
||||||
if (!fs.existsSync(dest)) {
|
if (!fs.existsSync(dest)) {
|
||||||
fs.mkdirSync(dest);
|
fs.mkdirSync(dest);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { createRequire } from "module";
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
const messages = require('../src/lang/en-US.json');
|
const messages = require('../src/lang/en-US.json');
|
||||||
const ignore = require('../lang-ignore.json');
|
const ignore = require('../lang-ignore.json');
|
||||||
const dir = path.resolve(__dirname, '../lang');
|
const dir = path.resolve(process.cwd(), 'lang');
|
||||||
const files = fs.readdirSync(dir);
|
const files = fs.readdirSync(dir);
|
||||||
const keys = Object.keys(messages).sort();
|
const keys = Object.keys(messages).sort();
|
||||||
const filter = process.argv?.[2];
|
const filter = process.argv?.[2];
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,8 @@
|
||||||
import 'dotenv/config';
|
import 'dotenv/config';
|
||||||
import fse from 'fs-extra';
|
import fse from 'fs-extra';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import url from 'node:url';
|
|
||||||
import del from 'del';
|
import del from 'del';
|
||||||
|
|
||||||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
function getDatabaseType(url = process.env.DATABASE_URL) {
|
function getDatabaseType(url = process.env.DATABASE_URL) {
|
||||||
const type = process.env.DATABASE_TYPE || (url && url.split(':')[0]);
|
const type = process.env.DATABASE_TYPE || (url && url.split(':')[0]);
|
||||||
|
|
||||||
|
|
@ -25,8 +22,8 @@ if (!databaseType || !['mysql', 'postgresql'].includes(databaseType)) {
|
||||||
|
|
||||||
console.log(`Database type detected: ${databaseType}`);
|
console.log(`Database type detected: ${databaseType}`);
|
||||||
|
|
||||||
const src = path.resolve(__dirname, `../db/${databaseType}`);
|
const src = path.resolve(process.cwd(), `db/${databaseType}`);
|
||||||
const dest = path.resolve(__dirname, '../prisma');
|
const dest = path.resolve(process.cwd(), 'prisma');
|
||||||
|
|
||||||
del.sync(dest);
|
del.sync(dest);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,8 @@ import https from 'https';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import url from "node:url";
|
import url from "node:url";
|
||||||
|
|
||||||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
const src = path.resolve(process.cwd(), 'src/lang');
|
||||||
|
const dest = path.resolve(process.cwd(), 'public/intl/country');
|
||||||
const src = path.resolve(__dirname, '../src/lang');
|
|
||||||
const dest = path.resolve(__dirname, '../public/intl/country');
|
|
||||||
const files = fs.readdirSync(src);
|
const files = fs.readdirSync(src);
|
||||||
|
|
||||||
const getUrl = locale =>
|
const getUrl = locale =>
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,9 @@ import fs from 'fs-extra';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import url from "node:url";
|
|
||||||
|
|
||||||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
const src = path.resolve(process.cwd(), 'src/lang');
|
||||||
|
const dest = path.resolve(process.cwd(), 'public/intl/language');
|
||||||
const src = path.resolve(__dirname, '../src/lang');
|
|
||||||
const dest = path.resolve(__dirname, '../public/intl/language');
|
|
||||||
const files = fs.readdirSync(src);
|
const files = fs.readdirSync(src);
|
||||||
|
|
||||||
const getUrl = locale =>
|
const getUrl = locale =>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import url from 'node:url';
|
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import del from 'del';
|
import del from 'del';
|
||||||
import prettier from 'prettier';
|
import prettier from 'prettier';
|
||||||
import { createRequire } from 'module';
|
import { createRequire } from 'module';
|
||||||
|
|
||||||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
const src = path.resolve(__dirname, '../src/lang');
|
const src = path.resolve(process.cwd(), 'src/lang');
|
||||||
const dest = path.resolve(__dirname, '../build/messages');
|
const dest = path.resolve(process.cwd(), 'build/messages');
|
||||||
const files = fs.readdirSync(src);
|
const files = fs.readdirSync(src);
|
||||||
|
|
||||||
del.sync([path.join(dest)]);
|
del.sync([path.join(dest)]);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import messages from '../build/extracted-messages.json';
|
||||||
import { createRequire } from "module";
|
import { createRequire } from "module";
|
||||||
|
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
const dest = path.resolve(__dirname, '../src/lang');
|
const dest = path.resolve(process.cwd(), 'src/lang');
|
||||||
const files = fs.readdirSync(dest);
|
const files = fs.readdirSync(dest);
|
||||||
const keys = Object.keys(messages).sort();
|
const keys = Object.keys(messages).sort();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import 'dotenv/config';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
|
||||||
const routesManifestPath = path.resolve(__dirname, '../.next/routes-manifest.json');
|
const routesManifestPath = path.resolve(process.cwd(), '.next/routes-manifest.json');
|
||||||
const originalPath = path.resolve(__dirname, '../.next/routes-manifest-orig.json');
|
const originalPath = path.resolve(process.cwd(), '.next/routes-manifest-orig.json');
|
||||||
const originalManifest = require(originalPath);
|
const originalManifest = require(originalPath);
|
||||||
|
|
||||||
const API_PATH = '/api/:path*';
|
const API_PATH = '/api/:path*';
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,11 @@
|
||||||
import 'dotenv/config';
|
import 'dotenv/config';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import url from "node:url";
|
|
||||||
|
|
||||||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
const endPoint = process.env.COLLECT_API_ENDPOINT;
|
const endPoint = process.env.COLLECT_API_ENDPOINT;
|
||||||
|
|
||||||
if (endPoint) {
|
if (endPoint) {
|
||||||
const file = path.resolve(__dirname, '../public/script.js');
|
const file = path.resolve(process.cwd(), 'public/script.js');
|
||||||
|
|
||||||
const tracker = fs.readFileSync(file);
|
const tracker = fs.readFileSync(file);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
'use client';
|
||||||
export * from './queries/useActiveUsersQuery';
|
export * from './queries/useActiveUsersQuery';
|
||||||
export * from './queries/useEventDataEventsQuery';
|
export * from './queries/useEventDataEventsQuery';
|
||||||
export * from './queries/useEventDataPropertiesQuery';
|
export * from './queries/useEventDataPropertiesQuery';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue