1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-12-08 00:45:29 +01:00

refactor: usage of node: for builtin modules

This commit is contained in:
Divlo 2021-07-03 18:40:17 +02:00
parent fd830c9a8b
commit c80eb11874
No known key found for this signature in database
GPG Key ID: 185ED2F15F104E52
32 changed files with 1396 additions and 1270 deletions

View File

@ -44,8 +44,8 @@ Gitpod will automatically setup an environment for you.
#### Prerequisites #### Prerequisites
- [Node.js](https://nodejs.org/) >= 16 - [Node.js](https://nodejs.org/) >= 16.0.0
- [npm](https://npmjs.com/) >= 7 - [npm](https://npmjs.com/) >= 7.0.0
- [Docker](https://www.docker.com/) - [Docker](https://www.docker.com/)
#### Installation #### Installation

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input = [] const input = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input: string[] = [] const input: string[] = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input = [] const input = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input = [] const input = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input: string[] = [] const input: string[] = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input = [] const input = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input: string[] = [] const input: string[] = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input = [] const input = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const numbers = [] const numbers = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const numbers = [] const numbers = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const numbers = [] const numbers = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const numbers = [] const numbers = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const removeByIndex = <T = any>(array: T[], index: number): T[] => { const removeByIndex = <T = any>(array: T[], index: number): T[] => {
const result = [...array] const result = [...array]

View File

@ -1,6 +1,5 @@
import { Command, Option } from 'clipanion' import { Command, Option } from 'clipanion'
import * as typanion from 'typanion' import * as typanion from 'typanion'
import chalk from 'chalk' import chalk from 'chalk'
import { Challenge } from '../../services/Challenge' import { Challenge } from '../../services/Challenge'

View File

@ -1,6 +1,5 @@
import { Command, Option } from 'clipanion' import { Command, Option } from 'clipanion'
import * as typanion from 'typanion' import * as typanion from 'typanion'
import chalk from 'chalk' import chalk from 'chalk'
import { Solution } from '../../services/Solution' import { Solution } from '../../services/Solution'

View File

@ -1,6 +1,5 @@
import { Command, Option } from 'clipanion' import { Command, Option } from 'clipanion'
import * as typanion from 'typanion' import * as typanion from 'typanion'
import chalk from 'chalk' import chalk from 'chalk'
import { Solution } from '../../services/Solution' import { Solution } from '../../services/Solution'

View File

@ -1,5 +1,5 @@
import path from 'path' import path from 'node:path'
import fs from 'fs' import fs from 'node:fs'
import validateProjectName from 'validate-npm-package-name' import validateProjectName from 'validate-npm-package-name'

View File

@ -1,4 +1,4 @@
import path from 'path' import path from 'node:path'
import { import {
createTemporaryEmptyFolder, createTemporaryEmptyFolder,

View File

@ -1,5 +1,5 @@
import path from 'path' import path from 'node:path'
import fs from 'fs' import fs from 'node:fs'
import { replaceInFile } from 'replace-in-file' import { replaceInFile } from 'replace-in-file'
import date from 'date-and-time' import date from 'date-and-time'

View File

@ -1,6 +1,6 @@
import fs from 'fs' import fs from 'node:fs'
import path from 'path' import path from 'node:path'
import { performance } from 'perf_hooks' import { performance } from 'node:perf_hooks'
import ora from 'ora' import ora from 'ora'
import chalk from 'chalk' import chalk from 'chalk'

View File

@ -1,5 +1,6 @@
import fs from 'node:fs'
import fsMock from 'mock-fs' import fsMock from 'mock-fs'
import fs from 'fs'
import { copyDirectory } from '../copyDirectory' import { copyDirectory } from '../copyDirectory'

View File

@ -1,5 +1,6 @@
import fs from 'node:fs'
import fsMock from 'mock-fs' import fsMock from 'mock-fs'
import fs from 'fs'
import { import {
TEMPORARY_PATH, TEMPORARY_PATH,

View File

@ -1,5 +1,5 @@
import fs from 'fs' import fs from 'node:fs'
import path from 'path' import path from 'node:path'
export async function copyDirectory ( export async function copyDirectory (
source: string, source: string,

View File

@ -1,5 +1,5 @@
import path from 'path' import path from 'node:path'
import fs from 'fs' import fs from 'node:fs'
import { isExistingPath } from '../utils/isExistingPath' import { isExistingPath } from '../utils/isExistingPath'

View File

@ -1,4 +1,4 @@
import fs from 'fs' import fs from 'node:fs'
export const isExistingPath = async (path: string): Promise<boolean> => { export const isExistingPath = async (path: string): Promise<boolean> => {
try { try {

View File

@ -1,10 +0,0 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
rootDir: './cli',
testPathIgnorePatterns: [
'<rootDir>/commands/run/test.ts',
'<rootDir>/services/Test.ts',
'<rootDir>/node_modules'
]
}

10
jest.config.json Normal file
View File

@ -0,0 +1,10 @@
{
"preset": "ts-jest",
"testEnvironment": "node",
"rootDir": "./cli",
"testPathIgnorePatterns": [
"<rootDir>/commands/run/test.ts",
"<rootDir>/services/Test.ts",
"<rootDir>/node_modules"
]
}

2565
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
"url": "git+https://github.com/Divlo/programming-challenges" "url": "git+https://github.com/Divlo/programming-challenges"
}, },
"engines": { "engines": {
"node": ">=14.0.0", "node": ">=16.0.0",
"npm": ">=7.0.0" "npm": ">=7.0.0"
}, },
"ts-standard": { "ts-standard": {
@ -40,7 +40,7 @@
"clipanion": "3.0.0-rc.12", "clipanion": "3.0.0-rc.12",
"date-and-time": "1.0.1", "date-and-time": "1.0.1",
"execa": "5.1.1", "execa": "5.1.1",
"ora": "5.4.0", "ora": "5.4.1",
"replace-in-file": "6.2.0", "replace-in-file": "6.2.0",
"table": "6.7.1", "table": "6.7.1",
"typanion": "3.3.1", "typanion": "3.3.1",
@ -52,15 +52,15 @@
"@types/date-and-time": "0.13.0", "@types/date-and-time": "0.13.0",
"@types/jest": "26.0.23", "@types/jest": "26.0.23",
"@types/mock-fs": "4.13.0", "@types/mock-fs": "4.13.0",
"@types/node": "15.12.2", "@types/node": "16.0.0",
"@types/validate-npm-package-name": "3.0.2", "@types/validate-npm-package-name": "3.0.3",
"editorconfig-checker": "4.0.2", "editorconfig-checker": "4.0.2",
"jest": "27.0.4", "jest": "27.0.6",
"markdownlint-cli": "0.27.1", "markdownlint-cli": "0.27.1",
"mock-fs": "5.0.0", "mock-fs": "5.0.0",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"ts-jest": "27.0.3", "ts-jest": "27.0.3",
"ts-standard": "10.0.0", "ts-standard": "10.0.0",
"typescript": "4.3.2" "typescript": "4.3.5"
} }
} }

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input = [] const input = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({

View File

@ -1,4 +1,4 @@
import readline from 'readline' import readline from 'node:readline'
const input: string[] = [] const input: string[] = []
const readlineInterface = readline.createInterface({ const readlineInterface = readline.createInterface({