From aa044a54e78f547516fa0f7ef497d91da27c7c3f Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Mon, 13 Mar 2023 16:31:41 +0100 Subject: [PATCH] Move the experiment into src/plugins and src/experiment --- package.json5 | 4 ++-- plugins/.gitignore | 1 - .../arithmeticDirect.ts => experiment/arithmeticInfer.ts} | 2 +- {plugins => src/plugins}/infer.ts | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 plugins/.gitignore rename src/{generic/arithmeticDirect.ts => experiment/arithmeticInfer.ts} (84%) rename {plugins => src/plugins}/infer.ts (97%) diff --git a/package.json5 b/package.json5 index c6dd1cb..2fcf926 100644 --- a/package.json5 +++ b/package.json5 @@ -5,8 +5,8 @@ main: 'index.ts', scripts: { 'build-and-run': 'ttsc -b && node build', - 'experiment-infer': 'tsc plugins/infer.ts && node plugins/infer.js ./src/generic/arithmetic.ts', - 'experiment-infer-direct': 'tsc plugins/infer.ts && node plugins/infer.js ./src/generic/arithmeticDirect.ts', + 'experiment-infer': 'ttsc -b && node build/plugins/infer.js ./src/generic/arithmetic.ts', + 'experiment-infer-direct': 'ttsc -b && node build/plugins/infer.js ./src/experiment/arithmeticInfer.ts', test: 'echo "Error: no test specified" && exit 1', }, keywords: [ diff --git a/plugins/.gitignore b/plugins/.gitignore deleted file mode 100644 index a6c7c28..0000000 --- a/plugins/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.js diff --git a/src/generic/arithmeticDirect.ts b/src/experiment/arithmeticInfer.ts similarity index 84% rename from src/generic/arithmeticDirect.ts rename to src/experiment/arithmeticInfer.ts index 65a7782..92aeffd 100644 --- a/src/generic/arithmeticDirect.ts +++ b/src/experiment/arithmeticInfer.ts @@ -1,4 +1,4 @@ -import {infer} from './infer' +import {infer} from '../generic/infer' export const square = infer((dep: { multiply: (a: number, b: number) => number, diff --git a/plugins/infer.ts b/src/plugins/infer.ts similarity index 97% rename from plugins/infer.ts rename to src/plugins/infer.ts index 03b792d..8efdc22 100644 --- a/plugins/infer.ts +++ b/src/plugins/infer.ts @@ -24,6 +24,7 @@ import { inspect } from 'util' * * - https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin * - https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API + * - https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#using-the-type-checker * - https://github.com/Microsoft/TypeScript/wiki/Using-the-Language-Service-API */