Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix create.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch committed Feb 12, 2021
1 parent 9a8bce3 commit 7545f0d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions scripts/create.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import { TruffleColors } from "../src/packages/colors";
import chalk from "chalk";
import yargs from "yargs";
import prettier from "prettier";
import camelCase from "camelcase";
import npmValiddate from "validate-npm-package-name";
import userName from "git-user-name";
import { sep, join, resolve } from "path";
import { highlight } from "cli-highlight";
import { mkdir, mkdirSync, writeFile } from "fs-extra";
Expand All @@ -14,6 +8,15 @@ import {
readFileSync as readFile
} from "fs";

// using `require` because everything in scripts uses typescript's default
// compiler settings, and these modules require enabling `esModuleInterop`
const npmValiddate = require("validate-npm-package-name");
const userName = require("git-user-name");
const camelCase = require("camelcase");
const prettier = require("prettier");
const chalk = require("chalk");
const yargs = require("yargs");

const COMMAND_NAME = "create";

const getArgv = () => {
Expand Down Expand Up @@ -212,6 +215,7 @@ describe("${packageName}", () => {
const tests = join(dir, "tests");
const src = join(dir, "src");

//@ts-ignore
function initSrc() {
return writeFile(
join(src, "index.ts"),
Expand All @@ -222,6 +226,7 @@ describe("${packageName}", () => {
);
}

//@ts-ignore
function initIndex() {
// When a bundler compiles our libs this headerdoc comment will cause that
// tool to retain our LICENSE information in their bundled output.
Expand All @@ -243,6 +248,7 @@ describe("${packageName}", () => {
);
}

//@ts-ignore
function initRootFiles() {
return Promise.all([
writeFile(
Expand All @@ -261,6 +267,7 @@ typedoc.json
]);
}

//@ts-ignore
function initTests() {
return writeFile(
join(tests, "index.test.ts"),
Expand Down

0 comments on commit 7545f0d

Please sign in to comment.