Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Updated script requires.
Mike Cao615a6d444f34
diff --git a/scripts/check-lang.mjs b/scripts/check-lang.mjsindex 7db34d45e..c6568d9bd 100644--- a/scripts/check-lang.mjs+++ b/scripts/check-lang.mjs@@ -5,8 +5,8 @@ import chalk from 'chalk';import { createRequire } from "module";const require = createRequire(import.meta.url);-const messages = require('../src/lang/en-US.json');-const ignore = require('../lang-ignore.json');+const messages = require(path.resolve(process.cwd(), 'src/lang/en-US.json'));+const ignore = require(path.resolve(process.cwd(), 'lang-ignore.json'));const dir = path.resolve(process.cwd(), 'lang');const files = fs.readdirSync(dir);const keys = Object.keys(messages).sort();diff --git a/scripts/download-country-names.mjs b/scripts/download-country-names.mjsindex 419ba9e5e..1517acdf6 100644--- a/scripts/download-country-names.mjs+++ b/scripts/download-country-names.mjs@@ -3,7 +3,6 @@ import fs from 'fs-extra';import path from 'node:path';import https from 'https';import chalk from 'chalk';-import url from "node:url";const src = path.resolve(process.cwd(), 'src/lang');const dest = path.resolve(process.cwd(), 'public/intl/country');diff --git a/scripts/format-lang.mjs b/scripts/format-lang.mjsindex a6f0863b7..42f630258 100644--- a/scripts/format-lang.mjs+++ b/scripts/format-lang.mjs@@ -19,7 +19,7 @@ async function run() {await fs.ensureDir(dest);files.forEach(file => {- const lang = require(`../src/lang/${file}`);+ const lang = require(path.resolve(process.cwd() `src/lang/${file}`));const keys = Object.keys(lang).sort();const formatted = keys.reduce((obj, key) => {diff --git a/scripts/merge-messages.mjs b/scripts/merge-messages.mjsindex c9f3b921c..6bd4c0fc0 100644--- a/scripts/merge-messages.mjs+++ b/scripts/merge-messages.mjs@@ -16,7 +16,7 @@ with the existing files under `lang`. Any newly addedkeys will be printed to the console.*/files.forEach(file => {- const lang = require(`../src/lang/${file}`);+ const lang = require(path.resolve(process.cwd(), `src/lang/${file}`));console.log(`Merging ${file}`);diff --git a/scripts/set-routes-manifest.mjs b/scripts/set-routes-manifest.mjsindex 2738970d1..ea291c1a1 100644--- a/scripts/set-routes-manifest.mjs+++ b/scripts/set-routes-manifest.mjs@@ -2,6 +2,9 @@import 'dotenv/config';import fs from 'node:fs';import path from 'node:path';+import { createRequire } from "module";++const require = createRequire(import.meta.url);const routesManifestPath = path.resolve(process.cwd(), '.next/routes-manifest.json');const originalPath = path.resolve(process.cwd(), '.next/routes-manifest-orig.json');diff --git a/scripts/telemetry.mjs b/scripts/telemetry.mjsindex 2b7c95c01..78bf54fd3 100644--- a/scripts/telemetry.mjs+++ b/scripts/telemetry.mjs@@ -1,9 +1,10 @@import os from 'node:os';+import path from 'node:path';import isCI from 'is-ci';import { createRequire } from 'module';const require = createRequire(import.meta.url);-const pkg = require('../package.json');+const pkg = require(path.resolve(process.cwd(), 'package.json'));const url = 'https://api.umami.is/v1/telemetry';