Migrating to ESM (#8)

* Migrating to ESM

* Fixing broken prettier
This commit is contained in:
Marco Lipparini
2024-02-25 10:47:00 +01:00
committed by GitHub
parent 0ec6b214cd
commit 1961d75eec
6 changed files with 13 additions and 10 deletions

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env node
require('../build/index.js');
import '../build/index.js';

View File

@@ -1,7 +1,8 @@
{
"name": "@mep-agency/local-dev-db",
"version": "1.0.0-alpha13",
"version": "1.0.0-alpha14",
"private": false,
"type": "module",
"description": "A zero-config local MariaDB instance for local development (using Docker)",
"author": "Marco Lipparini <developer@liarco.net>",
"license": "MIT",

View File

@@ -1,8 +1,9 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'node:url';
import fs from 'node:fs';
import path from 'node:path';
const JSON_CONFIG_FILE_NAME = 'ldd.json';
const PACKAGE_JSON_PATH = `${__dirname}/../package.json`;
const PACKAGE_JSON_PATH = fileURLToPath(new URL('../package.json', import.meta.url));
const DEFAULT_CONFIG: Partial<JsonConfiguration> = {
dbName: undefined,

View File

@@ -1,12 +1,13 @@
import fs from 'fs';
import { fileURLToPath } from 'node:url';
import fs from 'node:fs';
import { program } from 'commander';
import { confirm } from '@inquirer/prompts';
import { dockerCommand } from 'docker-cli-js';
import mysql from 'mysql';
import config from './config';
import config from './config.js';
const LDD_ROOT_PATH = `${__dirname}/..`;
const LDD_ROOT_PATH = fileURLToPath(new URL('..', import.meta.url));
interface DockerImagesCommandResult {
images: {

View File

@@ -5,8 +5,8 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"module": "CommonJS",
"moduleResolution": "node",
"module": "Node16",
"moduleResolution": "Node16",
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,