diff --git a/package.json b/package.json index 370b04e..788fb80 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "typescript" ], "main": "dist/create-ts-lib-gh.js", - "typings": "dist/create-ts-lib-gh.d.ts", + "types": "dist/create-ts-lib-gh.d.ts", "files": [ "dist", "template" diff --git a/src/create-ts-lib-gh.spec.ts b/src/create-ts-lib-gh.spec.ts index 3e9e8d8..eb3cfba 100644 --- a/src/create-ts-lib-gh.spec.ts +++ b/src/create-ts-lib-gh.spec.ts @@ -1,7 +1,8 @@ -import { ProjectInfo, setupProject } from './setup-project'; -import { getProjectInfo } from './get-project-info'; import { mocked } from 'ts-jest/utils'; +import { getProjectInfo } from './get-project-info'; +import { ProjectInfo, setupProject } from './setup-project'; + jest.mock('./setup-project'); jest.mock('./get-project-info'); diff --git a/src/create-ts-lib-gh.ts b/src/create-ts-lib-gh.ts index 72945cb..5f2abbd 100644 --- a/src/create-ts-lib-gh.ts +++ b/src/create-ts-lib-gh.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { setupProject } from './setup-project'; import { getProjectInfo } from './get-project-info'; +import { setupProject } from './setup-project'; getProjectInfo().then(setupProject); diff --git a/src/get-project-info.ts b/src/get-project-info.ts index a4abef1..073fa6c 100644 --- a/src/get-project-info.ts +++ b/src/get-project-info.ts @@ -2,9 +2,10 @@ // TODO: test this -import { ProjectInfo } from './setup-project'; import input from '@inquirer/input'; +import { ProjectInfo } from './setup-project'; + const NPM_LIB_PATTERN = /^[a-z][a-z-]{0,213}$/; const KEYWORDS_PATTERN = /^[a-z][a-z-]*(?: [a-z][a-z-]*)*$/; const GH_USERNAME_PATTERN = /^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i; diff --git a/src/setup-project.ts b/src/setup-project.ts index c80c61b..d97a1b6 100644 --- a/src/setup-project.ts +++ b/src/setup-project.ts @@ -2,10 +2,10 @@ // TODO: test this -import { mkdir, readdir, readFile, rename, writeFile } from 'fs/promises'; -import { join, dirname } from 'path'; -import { render } from 'ejs'; import child_process from 'child_process'; +import { render } from 'ejs'; +import { mkdir, readdir, readFile, rename, writeFile } from 'fs/promises'; +import { dirname, join } from 'path'; import { promisify } from 'util'; const exec = promisify(child_process.exec); diff --git a/template/package.json b/template/package.json index 240cca5..c6c9b99 100644 --- a/template/package.json +++ b/template/package.json @@ -6,7 +6,7 @@ <%- library.keywords.map((k) => `"${str(k)}"`).join(",\n ") %> ], "main": "dist/<%= str(library.name) %>.js", - "typings": "dist/@types/<%= str(library.name) %>.d.ts", + "types": "dist/<%= str(library.name) %>.d.ts", "files": [ "dist" ],