mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-05-18 12:02:53 +02:00
chore: maintenance
This commit is contained in:
@ -3,8 +3,8 @@ import fs from 'node:fs'
|
||||
|
||||
import validateProjectName from 'validate-npm-package-name'
|
||||
|
||||
import { isExistingPath } from '../utils/isExistingPath'
|
||||
import { template } from './Template'
|
||||
import { isExistingPath } from '../utils/isExistingPath.js'
|
||||
import { template } from './Template.js'
|
||||
|
||||
export interface ChallengeOptions {
|
||||
name: string
|
||||
|
@ -1,13 +1,13 @@
|
||||
import execa from 'execa'
|
||||
|
||||
import { Challenge } from './Challenge'
|
||||
import { Solution } from './Solution'
|
||||
import { Challenge } from './Challenge.js'
|
||||
import { Solution } from './Solution.js'
|
||||
|
||||
const solutionsRegex = /challenges\/[\s\S]*\/solutions\/(c|cpp|cs|dart|java|javascript|python|rust|typescript)\/[\s\S]*\/(.*).(c|cpp|cs|dart|java|js|py|rs|ts)/
|
||||
const solutionsRegex = /challenges\/[\S\s]*\/solutions\/(c|cpp|cs|dart|java|javascript|python|rust|typescript)\/[\S\s]*\/(.*).(c|cpp|cs|dart|java|js|py|rs|ts)/
|
||||
|
||||
const dockerRegex = /templates\/docker\/(c|cpp|cs|dart|java|javascript|python|rust|typescript)\/(.*)/
|
||||
|
||||
const inputOutputRegex = /challenges\/[\s\S]*\/test\/(.*)\/(input.txt|output.txt)/
|
||||
const inputOutputRegex = /challenges\/[\S\s]*\/test\/(.*)\/(input.txt|output.txt)/
|
||||
|
||||
export interface GitAffectedOptions {
|
||||
isContinuousIntegration: boolean
|
||||
|
@ -4,13 +4,13 @@ import fs from 'node:fs'
|
||||
import {
|
||||
createTemporaryEmptyFolder,
|
||||
TEMPORARY_PATH
|
||||
} from '../utils/createTemporaryEmptyFolder'
|
||||
import { isExistingPath } from '../utils/isExistingPath'
|
||||
import { Challenge } from './Challenge'
|
||||
import { copyDirectory } from '../utils/copyDirectory'
|
||||
import { template } from './Template'
|
||||
import { docker } from './Docker'
|
||||
import { Test } from './Test'
|
||||
} from '../utils/createTemporaryEmptyFolder.js'
|
||||
import { isExistingPath } from '../utils/isExistingPath.js'
|
||||
import { Challenge } from './Challenge.js'
|
||||
import { copyDirectory } from '../utils/copyDirectory.js'
|
||||
import { template } from './Template.js'
|
||||
import { docker } from './Docker.js'
|
||||
import { Test } from './Test.js'
|
||||
|
||||
export interface GetSolutionOptions {
|
||||
programmingLanguageName: string
|
||||
|
@ -4,7 +4,7 @@ import fs from 'node:fs'
|
||||
import { replaceInFile } from 'replace-in-file'
|
||||
import date from 'date-and-time'
|
||||
|
||||
import { copyDirectory } from '../utils/copyDirectory'
|
||||
import { copyDirectory } from '../utils/copyDirectory.js'
|
||||
|
||||
const TEMPLATE_PATH = path.join(__dirname, '..', '..', 'templates')
|
||||
const TEMPLATE_DOCKER_PATH = path.join(TEMPLATE_PATH, 'docker')
|
||||
@ -87,7 +87,7 @@ class Template {
|
||||
const { destination, githubUser, name } = options
|
||||
await copyDirectory(TEMPLATE_CHALLENGE_PATH, destination)
|
||||
await this.replaceInDestination({
|
||||
name: name,
|
||||
name,
|
||||
description: this.getDescription(githubUser),
|
||||
destination
|
||||
})
|
||||
|
@ -6,8 +6,8 @@ import ora from 'ora'
|
||||
import chalk from 'chalk'
|
||||
import { table } from 'table'
|
||||
|
||||
import { Solution } from './Solution'
|
||||
import { docker } from './Docker'
|
||||
import { Solution } from './Solution.js'
|
||||
import { docker } from './Docker.js'
|
||||
|
||||
export interface InputOutput {
|
||||
input: string
|
||||
@ -49,7 +49,7 @@ export class Test implements TestOptions {
|
||||
this.elapsedTimeMilliseconds = options.elapsedTimeMilliseconds
|
||||
}
|
||||
|
||||
static async printResult (tests: Test[]): Promise<void> {
|
||||
static printResult (tests: Test[]): void {
|
||||
const tableResult = [
|
||||
[
|
||||
chalk.bold('N°'),
|
||||
@ -120,7 +120,7 @@ export class Test implements TestOptions {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
await Test.printResult(tests)
|
||||
Test.printResult(tests)
|
||||
}
|
||||
|
||||
static async getInputOutput (testPath: string): Promise<InputOutput> {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Challenge } from '../Challenge'
|
||||
import { GitAffected } from '../GitAffected'
|
||||
import { Solution } from '../Solution'
|
||||
import { Challenge } from '../Challenge.js'
|
||||
import { GitAffected } from '../GitAffected.js'
|
||||
import { Solution } from '../Solution.js'
|
||||
|
||||
const gitAffected = new GitAffected({ isContinuousIntegration: false })
|
||||
|
||||
|
Reference in New Issue
Block a user