From 0ad9d95725ae6d5f7537d3f8a7657207397c048e Mon Sep 17 00:00:00 2001 From: yalda Date: Sat, 10 Sep 2022 00:20:12 +0800 Subject: [PATCH] fix(bin):add npm file list, node require style to node:xx --- .gitignore | 4 ++-- index.ts | 7 ++++--- package.json | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 311aeb9..347f5e0 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,8 @@ pnpm-lock.yaml # ignore compiled files build types -index.js -!**/index.js +*.js +!template-*/*.js # ignore ide settings .idea diff --git a/index.ts b/index.ts index 4d9cc11..4092014 100755 --- a/index.ts +++ b/index.ts @@ -1,9 +1,10 @@ -import * as fs from 'fs' -import * as path from 'path' +import * as fs from 'node:fs' +import * as path from 'node:path' +import * as process from 'node:process' import minimist from 'minimist' import prompts from 'prompts' import mustache from 'mustache' -import { fileURLToPath } from 'url' +import { fileURLToPath } from 'node:url' import { red, ansi256, reset } from 'kolorist' const argv = minimist(process.argv.slice(2), { string: ['_'] }) diff --git a/package.json b/package.json index 754942f..0b6f7e8 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "files": [ "mustache", "template-*", + "bin.js", "index.js", "README.md" ],