Skip to content

Commit

Permalink
fix: specify correct types path in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
glebbash committed May 26, 2021
1 parent 2bbe436 commit 69f7d40
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions src/create-ts-lib-gh.spec.ts
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
2 changes: 1 addition & 1 deletion src/create-ts-lib-gh.ts
Original file line number Diff line number Diff line change
@@ -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);
3 changes: 2 additions & 1 deletion src/get-project-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/setup-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand Down

0 comments on commit 69f7d40

Please sign in to comment.