diff --git a/.gitignore b/.gitignore index 4c183a6..8bee51a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ *.log node_modules -*.js +dist/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..bdf1bb8 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "sourceMaps": true, + "smartStep": true, + "request": "launch", + "name": "Launch Program", + "skipFiles": [ + "/**", + "${workspaceFolder}/node_modules/**" + ], + "cwd": "${workspaceFolder}", + "runtimeExecutable": "yarn", + "runtimeArgs": ["run", "test"], + "program": "${workspaceFolder}/dist/2020-day-01.js", + "outFiles": [ + "${workspaceFolder}/dist/**/*.js" + ], + "console": "integratedTerminal" + } + ] +} \ No newline at end of file diff --git a/input-01.txt b/input/2020-day-01.txt similarity index 100% rename from input-01.txt rename to input/2020-day-01.txt diff --git a/package.json b/package.json index 432bf8d..d573976 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "type": "module", "scripts": { - "test": "mocha 2020-*.js", + "test": "mocha", "pretest": "tsc" } } diff --git a/2020-day1.ts b/src/2020-day-01.ts similarity index 96% rename from 2020-day1.ts rename to src/2020-day-01.ts index 1140ab5..4dd51ef 100644 --- a/2020-day1.ts +++ b/src/2020-day-01.ts @@ -3,7 +3,7 @@ import { readFileSync } from 'fs'; import 'mocha'; -let input = readFileSync('./input-01.txt', 'utf-8') +let input = readFileSync('./input/2020-day-01.txt', 'utf-8') .split('\n') .map(l => parseInt(l.trim(), 10)); diff --git a/tsconfig.json b/tsconfig.json index d112f06..ae10f59 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,10 +12,10 @@ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + "outDir": "./dist", /* Redirect output structure to the directory. */ + "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ // "removeComments": true, /* Do not emit comments to output. */