-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ESM, add ignore paths option (#7)
* Add ignore paths option * Upgrade dependencies, move to es modules * Use node 16 for build
- Loading branch information
Showing
16 changed files
with
209 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ | |
"version": "0.0.9", | ||
"description": "Track typescript conversion velocity for your big projects", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"author": "Alexander Harding <[email protected]>", | ||
"license": "MIT", | ||
"type": "module", | ||
"scripts": { | ||
"build": "yarn clean; tsc; chmod +x dist/cli.js", | ||
"clean": "rm -rf ./dist", | ||
|
@@ -23,27 +23,27 @@ | |
"ts-reporter": "./dist/cli.js" | ||
}, | ||
"devDependencies": { | ||
"@types/chart.js": "^2.9.32", | ||
"@types/fs-extra": "^9.0.11", | ||
"@types/lodash": "^4.14.168", | ||
"@types/node": "^15.0.1", | ||
"@types/chart.js": "^2.9.37", | ||
"@types/fs-extra": "^9.0.13", | ||
"@types/lodash": "^4.14.182", | ||
"@types/node": "^17.0.32", | ||
"@types/sloc": "^0.2.0", | ||
"@types/yargs": "^16.0.1", | ||
"ts-node": "^9.1.1", | ||
"typescript": "^4.2.4", | ||
"@types/yargs": "^17.0.10", | ||
"ts-node": "^10.7.0", | ||
"typescript": "^4.6.4", | ||
"watch": "^1.0.2" | ||
}, | ||
"dependencies": { | ||
"chalk": "^4.1.1", | ||
"chalk": "^5.0.1", | ||
"chart.js": "^2.9.4", | ||
"chartjs-node-canvas": "^3.1.0", | ||
"date-fns": "^2.21.1", | ||
"execa": "^5.0.0", | ||
"fs-extra": "^9.1.0", | ||
"glob": "^7.1.6", | ||
"glob-promise": "^4.1.0", | ||
"chartjs-node-canvas": "^3.2.0", | ||
"date-fns": "^2.28.0", | ||
"execa": "^6.1.0", | ||
"fs-extra": "^10.1.0", | ||
"glob": "^8.0.1", | ||
"glob-promise": "^4.2.2", | ||
"lodash": "^4.17.21", | ||
"sloc": "^0.2.1", | ||
"yargs": "^16.2.0" | ||
"yargs": "^17.5.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"date": "2021-01-01T00:00:00.000Z", | ||
"stats": { | ||
"js": { | ||
"total": 1, | ||
"source": 1, | ||
"comment": 0, | ||
"single": 0, | ||
"block": 0, | ||
"mixed": 0, | ||
"empty": 0, | ||
"todo": 0, | ||
"blockEmpty": 0 | ||
}, | ||
"ts": { | ||
"total": 0, | ||
"source": 0, | ||
"comment": 0, | ||
"single": 0, | ||
"block": 0, | ||
"mixed": 0, | ||
"blockEmpty": 0, | ||
"empty": 0, | ||
"todo": 0 | ||
} | ||
} | ||
}, | ||
{ | ||
"date": "2021-01-02T00:00:00.000Z", | ||
"stats": { | ||
"js": { | ||
"total": 1, | ||
"source": 1, | ||
"comment": 0, | ||
"single": 0, | ||
"block": 0, | ||
"mixed": 0, | ||
"empty": 0, | ||
"todo": 0, | ||
"blockEmpty": 0 | ||
}, | ||
"ts": { | ||
"total": 1, | ||
"source": 1, | ||
"comment": 0, | ||
"single": 0, | ||
"block": 0, | ||
"mixed": 0, | ||
"empty": 0, | ||
"todo": 0, | ||
"blockEmpty": 0 | ||
} | ||
} | ||
}, | ||
{ | ||
"date": "2021-01-03T00:00:00.000Z", | ||
"stats": { | ||
"js": { | ||
"total": 1, | ||
"source": 1, | ||
"comment": 0, | ||
"single": 0, | ||
"block": 0, | ||
"mixed": 0, | ||
"empty": 0, | ||
"todo": 0, | ||
"blockEmpty": 0 | ||
}, | ||
"ts": { | ||
"total": 2, | ||
"source": 2, | ||
"comment": 0, | ||
"single": 0, | ||
"block": 0, | ||
"mixed": 0, | ||
"empty": 0, | ||
"todo": 0, | ||
"blockEmpty": 0 | ||
} | ||
} | ||
} | ||
], | ||
"path": "/Users/aeharding/ts-reporter/temp/2021-04-30_05:03:08/0", | ||
"version": "0.0.8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
664dba8f23929c7dbbe1d5b64baeb5f25d380a7c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import assert from "assert"; | ||
import fse from "fs-extra"; | ||
import { run } from "../utils/misc.js"; | ||
import { dirname } from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
const DIR = process.argv[2]; | ||
|
||
run(async () => { | ||
const resultDataPath = `${DIR}/reports/ts-migration/data.json`; | ||
assert.ok(fse.existsSync(resultDataPath)); | ||
|
||
const result = fse.readJSONSync(resultDataPath); | ||
const expected = fse.readJSONSync(`${__dirname}/data.json`); | ||
|
||
delete result.path; | ||
delete expected.path; | ||
delete result.version; | ||
delete expected.version; | ||
|
||
assert.deepStrictEqual(result, expected); | ||
|
||
// TODO - need better solution | ||
// assert.strictEqual( | ||
// ( | ||
// await execa("shasum", [`${DIR}/reports/ts-migration/image.png`]) | ||
// ).stdout.split(" ")[0], | ||
// fse.readFileSync(`${__dirname}/image.png.shasum`).toString() | ||
// ); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
git init | ||
echo "{}" > package.json | ||
echo "const foo = 0;\n const bar = 1;\n const baz = 2;" > code1.js | ||
git add . | ||
git commit -m "commit 1" --date "01-01-21T00:00:00.000Z" | ||
echo "ts codes 1" > code2.ts | ||
mkdir ignorethispath | ||
echo "ts codes 1" > ignorethispath/blah.ts | ||
git add . | ||
git commit -m "commit 2" --date "01-02-21T00:00:00.000Z" | ||
echo "ts codes 2" > code3.ts | ||
git add . | ||
git commit -m "commit 3" --date "01-03-21T00:00:00.000Z" | ||
|
||
git rebase --root --committer-date-is-author-date | ||
|
||
npx ts-reporter build . --from 2021-01-01 --to 2021-01-03 --ignore "ignorethispath/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "commonjs", | ||
"target": "es2020", | ||
"module": "es2020", | ||
"lib": ["es2020", "DOM"], | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"baseUrl": "lib", | ||
"noImplicitAny": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"sourceMap": true, | ||
"declaration": true, | ||
"outDir": "./dist", | ||
"lib": ["ES2015", "DOM"] | ||
"allowSyntheticDefaultImports": true, | ||
"experimentalDecorators": true, | ||
"emitDecoratorMetadata": true, | ||
"moduleResolution": "node", | ||
"outDir": "dist", | ||
"typeRoots": ["node_modules/@types"] | ||
}, | ||
"exclude": ["test/**", "temp/**"] | ||
} |