mirror of
https://github.com/umami-software/umami.git
synced 2026-02-03 20:27:13 +01:00
Switched to type: module.
This commit is contained in:
parent
615a6d444f
commit
4e37e10b6d
20 changed files with 25 additions and 50 deletions
|
|
@ -2,6 +2,7 @@ import 'dotenv/config';
|
||||||
import { createRequire } from 'module';
|
import { createRequire } from 'module';
|
||||||
|
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
const pkg = require('./package.json');
|
const pkg = require('./package.json');
|
||||||
|
|
||||||
const TRACKER_SCRIPT = '/script.js';
|
const TRACKER_SCRIPT = '/script.js';
|
||||||
32
package.json
32
package.json
|
|
@ -9,6 +9,7 @@
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/umami-software/umami.git"
|
"url": "https://github.com/umami-software/umami.git"
|
||||||
},
|
},
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3000",
|
"dev": "next dev -p 3000",
|
||||||
"dev-turbo": "next dev -p 3000 --turbo",
|
"dev-turbo": "next dev -p 3000 --turbo",
|
||||||
|
|
@ -16,36 +17,36 @@
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"build-docker": "npm-run-all build-db build-tracker build-geo build-app",
|
"build-docker": "npm-run-all build-db build-tracker build-geo build-app",
|
||||||
"start-docker": "npm-run-all check-db update-tracker set-routes-manifest start-server",
|
"start-docker": "npm-run-all check-db update-tracker set-routes-manifest start-server",
|
||||||
"start-env": "node scripts/start-env.mjs",
|
"start-env": "node scripts/start-env.js",
|
||||||
"start-server": "node server.js",
|
"start-server": "node server.js",
|
||||||
"build-app": "next build",
|
"build-app": "next build",
|
||||||
"build-components": "rollup -c rollup.components.config.mjs",
|
"build-components": "rollup -c rollup.components.config.js",
|
||||||
"build-tracker": "rollup -c rollup.tracker.config.mjs",
|
"build-tracker": "rollup -c rollup.tracker.config.js",
|
||||||
"build-db": "npm-run-all copy-db-files build-db-client",
|
"build-db": "npm-run-all copy-db-files build-db-client",
|
||||||
"build-lang": "npm-run-all format-lang compile-lang clean-lang download-country-names download-language-names",
|
"build-lang": "npm-run-all format-lang compile-lang clean-lang download-country-names download-language-names",
|
||||||
"build-geo": "node scripts/build-geo.mjs",
|
"build-geo": "node scripts/build-geo.js",
|
||||||
"build-db-schema": "prisma db pull",
|
"build-db-schema": "prisma db pull",
|
||||||
"build-db-client": "prisma generate",
|
"build-db-client": "prisma generate",
|
||||||
"build-icons": "svgr ./src/assets --out-dir ./src/components/svg --typescript",
|
"build-icons": "svgr ./src/assets --out-dir ./src/components/svg --typescript",
|
||||||
"set-routes-manifest": "node scripts/set-routes-manifest.mjs",
|
"set-routes-manifest": "node scripts/set-routes-manifest.js",
|
||||||
"update-tracker": "node scripts/update-tracker.mjs",
|
"update-tracker": "node scripts/update-tracker.js",
|
||||||
"update-db": "prisma migrate deploy",
|
"update-db": "prisma migrate deploy",
|
||||||
"check-db": "node scripts/check-db.mjs",
|
"check-db": "node scripts/check-db.js",
|
||||||
"check-env": "node scripts/check-env.mjs",
|
"check-env": "node scripts/check-env.js",
|
||||||
"copy-db-files": "node scripts/copy-db-files.mjs",
|
"copy-db-files": "node scripts/copy-db-files.js",
|
||||||
"extract-messages": "formatjs extract \"src/components/messages.ts\" --out-file build/extracted-messages.json",
|
"extract-messages": "formatjs extract \"src/components/messages.ts\" --out-file build/extracted-messages.json",
|
||||||
"merge-messages": "node scripts/merge-messages.mjs",
|
"merge-messages": "node scripts/merge-messages.js",
|
||||||
"generate-lang": "npm-run-all extract-messages merge-messages",
|
"generate-lang": "npm-run-all extract-messages merge-messages",
|
||||||
"format-lang": "node scripts/format-lang.mjs",
|
"format-lang": "node scripts/format-lang.js",
|
||||||
"compile-lang": "formatjs compile-folder --ast build/messages public/intl/messages",
|
"compile-lang": "formatjs compile-folder --ast build/messages public/intl/messages",
|
||||||
"clean-lang": "prettier --write ./public/intl/messages/*.json",
|
"clean-lang": "prettier --write ./public/intl/messages/*.json",
|
||||||
"check-lang": "node scripts/check-lang.mjs",
|
"check-lang": "node scripts/check-lang.js",
|
||||||
"download-country-names": "node scripts/download-country-names.mjs",
|
"download-country-names": "node scripts/download-country-names.js",
|
||||||
"download-language-names": "node scripts/download-language-names.mjs",
|
"download-language-names": "node scripts/download-language-names.js",
|
||||||
"change-password": "node scripts/change-password.js",
|
"change-password": "node scripts/change-password.js",
|
||||||
"lint": "next lint --quiet",
|
"lint": "next lint --quiet",
|
||||||
"prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || husky install",
|
"prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || husky install",
|
||||||
"postbuild": "node scripts/postbuild.mjs",
|
"postbuild": "node scripts/postbuild.js",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"cypress-open": "cypress open cypress run",
|
"cypress-open": "cypress open cypress run",
|
||||||
"cypress-run": "cypress run cypress run"
|
"cypress-run": "cypress run cypress run"
|
||||||
|
|
@ -164,7 +165,6 @@
|
||||||
"postcss-flexbugs-fixes": "^5.0.2",
|
"postcss-flexbugs-fixes": "^5.0.2",
|
||||||
"postcss-import": "^15.1.0",
|
"postcss-import": "^15.1.0",
|
||||||
"postcss-preset-env": "7.8.3",
|
"postcss-preset-env": "7.8.3",
|
||||||
"postcss-rtlcss": "^4.0.1",
|
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"prompts": "2.4.2",
|
"prompts": "2.4.2",
|
||||||
"rollup": "^3.28.0",
|
"rollup": "^3.28.0",
|
||||||
|
|
|
||||||
26
pnpm-lock.yaml
generated
26
pnpm-lock.yaml
generated
|
|
@ -294,9 +294,6 @@ importers:
|
||||||
postcss-preset-env:
|
postcss-preset-env:
|
||||||
specifier: 7.8.3
|
specifier: 7.8.3
|
||||||
version: 7.8.3(postcss@8.5.3)
|
version: 7.8.3(postcss@8.5.3)
|
||||||
postcss-rtlcss:
|
|
||||||
specifier: ^4.0.1
|
|
||||||
version: 4.0.9(postcss@8.5.3)
|
|
||||||
prettier:
|
prettier:
|
||||||
specifier: ^2.6.2
|
specifier: ^2.6.2
|
||||||
version: 2.8.8
|
version: 2.8.8
|
||||||
|
|
@ -6317,12 +6314,6 @@ packages:
|
||||||
postcss-resolve-nested-selector@0.1.6:
|
postcss-resolve-nested-selector@0.1.6:
|
||||||
resolution: {integrity: sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==}
|
resolution: {integrity: sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==}
|
||||||
|
|
||||||
postcss-rtlcss@4.0.9:
|
|
||||||
resolution: {integrity: sha512-dCNKEf+FgTv+EA3XI8ysg2RnpS5s3/iZmU+9qpCNFxHU/BhK+4hz7jyCsCAfo0CLnDrMPtaQENhwb+EGm1wh7Q==}
|
|
||||||
engines: {node: '>=18.0.0'}
|
|
||||||
peerDependencies:
|
|
||||||
postcss: ^8.4.21
|
|
||||||
|
|
||||||
postcss-safe-parser@6.0.0:
|
postcss-safe-parser@6.0.0:
|
||||||
resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==}
|
resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==}
|
||||||
engines: {node: '>=12.0'}
|
engines: {node: '>=12.0'}
|
||||||
|
|
@ -6742,11 +6733,6 @@ packages:
|
||||||
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
|
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
rtlcss@4.1.1:
|
|
||||||
resolution: {integrity: sha512-/oVHgBtnPNcggP2aVXQjSy6N1mMAfHg4GSag0QtZBlD5bdDgAHwr4pydqJGd+SUCu9260+Pjqbjwtvu7EMH1KQ==}
|
|
||||||
engines: {node: '>=12.0.0'}
|
|
||||||
hasBin: true
|
|
||||||
|
|
||||||
run-parallel@1.2.0:
|
run-parallel@1.2.0:
|
||||||
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
|
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
|
||||||
|
|
||||||
|
|
@ -14723,11 +14709,6 @@ snapshots:
|
||||||
|
|
||||||
postcss-resolve-nested-selector@0.1.6: {}
|
postcss-resolve-nested-selector@0.1.6: {}
|
||||||
|
|
||||||
postcss-rtlcss@4.0.9(postcss@8.5.3):
|
|
||||||
dependencies:
|
|
||||||
postcss: 8.5.3
|
|
||||||
rtlcss: 4.1.1
|
|
||||||
|
|
||||||
postcss-safe-parser@6.0.0(postcss@8.5.3):
|
postcss-safe-parser@6.0.0(postcss@8.5.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
postcss: 8.5.3
|
postcss: 8.5.3
|
||||||
|
|
@ -15283,13 +15264,6 @@ snapshots:
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
rtlcss@4.1.1:
|
|
||||||
dependencies:
|
|
||||||
escalade: 3.2.0
|
|
||||||
picocolors: 1.1.1
|
|
||||||
postcss: 8.5.3
|
|
||||||
strip-json-comments: 3.1.1
|
|
||||||
|
|
||||||
run-parallel@1.2.0:
|
run-parallel@1.2.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
queue-microtask: 1.2.3
|
queue-microtask: 1.2.3
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
module.exports = {
|
export default {
|
||||||
plugins: [
|
plugins: [
|
||||||
'postcss-flexbugs-fixes',
|
'postcss-flexbugs-fixes',
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ export default {
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
replace({
|
replace({
|
||||||
'__COLLECT_API_HOST__': process.env.COLLECT_API_HOST || '',
|
__COLLECT_API_HOST__: process.env.COLLECT_API_HOST || '',
|
||||||
'__COLLECT_API_ENDPOINT__': process.env.COLLECT_API_ENDPOINT || '/api/send',
|
__COLLECT_API_ENDPOINT__: process.env.COLLECT_API_ENDPOINT || '/api/send',
|
||||||
delimiters: ['', ''],
|
delimiters: ['', ''],
|
||||||
preventAssignment: true,
|
preventAssignment: true,
|
||||||
}),
|
}),
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import { createRequire } from "module";
|
import { createRequire } from 'module';
|
||||||
|
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
const messages = require(path.resolve(process.cwd(), 'src/lang/en-US.json'));
|
const messages = require(path.resolve(process.cwd(), 'src/lang/en-US.json'));
|
||||||
|
|
@ -19,7 +19,7 @@ async function run() {
|
||||||
await fs.ensureDir(dest);
|
await fs.ensureDir(dest);
|
||||||
|
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
const lang = require(path.resolve(process.cwd() `src/lang/${file}`));
|
const lang = require(path.resolve(process.cwd()`src/lang/${file}`));
|
||||||
const keys = Object.keys(lang).sort();
|
const keys = Object.keys(lang).sort();
|
||||||
|
|
||||||
const formatted = keys.reduce((obj, key) => {
|
const formatted = keys.reduce((obj, key) => {
|
||||||
|
|
@ -3,7 +3,7 @@ import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import prettier from 'prettier';
|
import prettier from 'prettier';
|
||||||
import messages from '../build/extracted-messages.json';
|
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(process.cwd(), 'src/lang');
|
const dest = path.resolve(process.cwd(), 'src/lang');
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import 'dotenv/config';
|
import 'dotenv/config';
|
||||||
import { sendTelemetry } from './telemetry.mjs';
|
import { sendTelemetry } from './telemetry.js';
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
if (!process.env.DISABLE_TELEMETRY) {
|
if (!process.env.DISABLE_TELEMETRY) {
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
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 { createRequire } from "module";
|
import { createRequire } from 'module';
|
||||||
|
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue