Skip to content

Commit 8660cca

Browse files
committed
Rename files so it will not be ignored by npm
1 parent 8947165 commit 8660cca

File tree

13 files changed

+22
-19
lines changed

13 files changed

+22
-19
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kdcsoftware/create-nodejs",
3-
"version": "0.1.8",
3+
"version": "0.1.9",
44
"description": "NodeJs boilerplate",
55
"main": "lib/index.js",
66
"bin": "./cli.js",

src/configs.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
const CONFIG_FILES = [
2-
'.babelrc',
3-
'.editorconfig',
4-
'.eslintrc',
5-
'.gitignore',
6-
'.prettierrc',
7-
'.vscode/launch.json',
8-
'codecov.yml',
9-
'jest.config.js',
10-
'.github/workflows/push.yml',
11-
'.github/workflows/publish.yml',
12-
'LICENSE',
13-
];
1+
const CONFIG_FILES = {
2+
babelrc: '.babelrc',
3+
editorconfig: '.editorconfig',
4+
eslintrc: '.eslintrc',
5+
gitignore: '.gitignore',
6+
prettierrc: '.prettierrc',
7+
'vscode/launch.json': '.vscode/launch.json',
8+
'codecov.yml': 'codecov.yml',
9+
'jest.config.js': 'jest.config.js',
10+
'github/workflows/push.yml': '.github/workflows/push.yml',
11+
'github/workflows/publish.yml': '.github/workflows/publish.yml',
12+
LICENSE: 'LICENSE',
13+
};
1414

1515
export default CONFIG_FILES;

src/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ const run = async ({ packageName }) => {
3131
await npmProcProd;
3232

3333
// copy config
34-
CONFIG_FILES.forEach((c) => {
34+
Object.keys(CONFIG_FILES).forEach((k) => {
35+
const c = CONFIG_FILES[k];
3536
fse.copySync(
36-
resolve(`${PKG_DIR}/..`, `templates/${c}`),
37+
resolve(`${PKG_DIR}/..`, `templates/${k}`),
3738
`${CUR_DIR}/${c}`
3839
);
3940
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/index.test.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,25 @@ describe('Create NodeJs', () => {
1414
});
1515

1616
afterAll(async () => {
17-
await fse.remove(PKG_DIR);
17+
// await fse.remove(PKG_DIR);
1818
});
1919

2020
it('should run', async () => {
2121
jest.setTimeout(60000);
2222
expect.assertions(
2323
14 +
24-
CONFIG_FILES.length +
24+
Object.keys(CONFIG_FILES).length +
2525
NPM_PACKAGES_DEV.length +
2626
NPM_PACKAGES_PROD.length
2727
);
28+
2829
try {
2930
await run({ packageName: 'hello-world' });
3031
expect(fs.existsSync(PKG_DIR)).toBe(true);
3132
expect(fs.existsSync(`${PKG_DIR}/package.json`)).toBe(true);
3233

33-
CONFIG_FILES.forEach((c) => {
34+
Object.keys(CONFIG_FILES).forEach((k) => {
35+
const c = CONFIG_FILES[k];
3436
expect(fs.existsSync(`${PKG_DIR}/${c}`)).toBe(true);
3537
});
3638

0 commit comments

Comments
 (0)