Skip to content

Commit

Permalink
Trying to fix on esm problem
Browse files Browse the repository at this point in the history
  • Loading branch information
erdemkosk committed Dec 10, 2023
1 parent 3d0d1da commit b4e577c
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 23 deletions.
Binary file modified .DS_Store
Binary file not shown.
7 changes: 4 additions & 3 deletions bin/index.ts
Expand Up @@ -5,9 +5,10 @@ import inquirerPrompt from 'inquirer-autocomplete-prompt'
import chalk from 'chalk'
import packages from '../package.json' assert { type: 'json' }

import CommandFactory from '../lib/command/CommandFactory'
import type Command from '../lib/command/Command'
import CommandInvoker from '../lib/command/CommandInvoker'
import CommandFactory from '../lib/command/commandFactory'

import type Command from '../lib/command/command'

Check failure on line 10 in bin/index.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module '../lib/command/command' or its corresponding type declarations.
import CommandInvoker from '../lib/command/commandInvoker'

Check failure on line 11 in bin/index.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module '../lib/command/commandInvoker' or its corresponding type declarations.
import { CommandTypes } from '../lib/const'

const program = new CommanderCommand()
Expand Down
2 changes: 1 addition & 1 deletion lib/command/CommandInvoker.ts
@@ -1,4 +1,4 @@
import type Command from './Command'
import type Command from './command'

Check failure on line 1 in lib/command/CommandInvoker.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module './command' or its corresponding type declarations.

// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export default class CommandInvoker {
Expand Down
16 changes: 8 additions & 8 deletions lib/command/commandFactory.ts
@@ -1,12 +1,12 @@
import { CommandTypes } from '../const'
import type Command from './Command'
import CompareCommand from './commandTypes/CompareCommand'
import LsCommand from './commandTypes/LsCommand'
import RestoreCommand from './commandTypes/RestoreCommand'
import RevertCommand from './commandTypes/RevertCommand'
import SyncCommand from './commandTypes/SyncCommand'
import UpdateAllCommand from './commandTypes/UpdateAllCommand'
import UpdateCommand from './commandTypes/UpdateCommand'
import type Command from './command'

Check failure on line 2 in lib/command/commandFactory.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module './command' or its corresponding type declarations.
import CompareCommand from './commandTypes/compareCommand'

Check failure on line 3 in lib/command/commandFactory.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module './commandTypes/compareCommand' or its corresponding type declarations.
import LsCommand from './commandTypes/lsCommand'

Check failure on line 4 in lib/command/commandFactory.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module './commandTypes/lsCommand' or its corresponding type declarations.
import RestoreCommand from './commandTypes/restoreCommand'

Check failure on line 5 in lib/command/commandFactory.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module './commandTypes/restoreCommand' or its corresponding type declarations.
import RevertCommand from './commandTypes/revertCommand'

Check failure on line 6 in lib/command/commandFactory.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module './commandTypes/revertCommand' or its corresponding type declarations.
import SyncCommand from './commandTypes/syncCommand'

Check failure on line 7 in lib/command/commandFactory.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module './commandTypes/syncCommand' or its corresponding type declarations.
import UpdateAllCommand from './commandTypes/updateAllCommand'

Check failure on line 8 in lib/command/commandFactory.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find module './commandTypes/updateAllCommand' or its corresponding type declarations.
import UpdateCommand from './commandTypes/updateCommand'

export default class CommandFactory {
createCommand (commandType: number): Command | null {
Expand Down
2 changes: 1 addition & 1 deletion lib/command/commandTypes/CompareCommand.ts
@@ -1,4 +1,4 @@
import Command from '../Command'
import Command from '../command'
import { compareEnvFiles } from '../../handler/envHandler'
import { getEnvFilesRecursively } from '../../handler/fileHandler'
import Table from 'cli-table3'
Expand Down
2 changes: 1 addition & 1 deletion lib/command/commandTypes/LsCommand.ts
@@ -1,4 +1,4 @@
import Command from '../Command'
import Command from '../command'
import { getValuesInEnv } from '../../handler/envHandler'
import { getEnvFilesRecursively } from '../../handler/fileHandler'
import Table from 'cli-table3'
Expand Down
2 changes: 1 addition & 1 deletion lib/command/commandTypes/RestoreCommand.ts
@@ -1,4 +1,4 @@
import Command from '../Command'
import Command from '../command'
import { restoreEnvFile } from '../../handler/envHandler'
import chalk from 'chalk'
import { consola } from 'consola'
Expand Down
2 changes: 1 addition & 1 deletion lib/command/commandTypes/RevertCommand.ts
@@ -1,4 +1,4 @@
import Command from '../Command'
import Command from '../command'
import { updateEnvFile, getUniqueEnvNames } from '../../handler/envHandler'
import { getEnvFilesRecursively } from '../../handler/fileHandler'
import { getEnvVersions } from '../../handler/historyHandler'
Expand Down
2 changes: 1 addition & 1 deletion lib/command/commandTypes/SyncCommand.ts
@@ -1,4 +1,4 @@
import Command from '../Command'
import Command from '../command'
import { syncEnvFile } from '../../handler/envHandler'
import chalk from 'chalk'
import { consola } from 'consola'
Expand Down
2 changes: 1 addition & 1 deletion lib/command/commandTypes/UpdateAllCommand.ts
@@ -1,4 +1,4 @@
import Command from '../Command'
import Command from '../command'
import { updateAllEnvFile, promptForEnvVariable } from '../../handler/envHandler'
import chalk from 'chalk'
import inquirer from 'inquirer'
Expand Down
2 changes: 1 addition & 1 deletion lib/command/commandTypes/UpdateCommand.ts
@@ -1,4 +1,4 @@
import Command from '../Command'
import Command from '../command'
import { getUniqueEnvNames, updateEnvFile } from '../../handler/envHandler'
import { getEnvFilesRecursively } from '../../handler/fileHandler'
import chalk from 'chalk'
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"build": "tsc",
"lint": "tsc --noEmit && eslint \"**/*.{js,ts}\" --quiet --fix",
"serve": "node dist/bin/index.js",
"serve": "node --no-warnings --experimental-specifier-resolution=node dist/bin/index.js",
"start": "tsc && npm run serve",
"test": "jest --forceExit --verbose --detectOpenHandles --coverage --coverageReporters=text-summary"
},
Expand Down Expand Up @@ -52,6 +52,6 @@
"typescript": "^5.2.2"
},
"bin": {
"envolve": "./dist/bin/index.js"
"envolve": ".start-envolve.sh"
}
}
2 changes: 2 additions & 0 deletions start-envolve.sh
@@ -0,0 +1,2 @@
#!/bin/bash
exec node --experimental-specifier-resolution=node ./dist/bin/index.js "$@"
2 changes: 1 addition & 1 deletion tsconfig.json
Expand Up @@ -18,6 +18,6 @@
]
}
},
"include": ["lib/**/*.ts", "bin/*.ts", "index.ts", "tests/**/*.ts"],
"include": ["lib/**/*.ts","lib/**/**/*.ts", "bin/*.ts", "index.ts", "tests/**/*.ts"],
"exclude": ["node_modules" , "dist"]
}

0 comments on commit b4e577c

Please sign in to comment.