@whook/create 12.1.0 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,6 +100,7 @@ export default autoService(async function initCreateWhook({
100
100
  path.join(SOURCE_DIR, 'package-lock.json'),
101
101
  path.join(SOURCE_DIR, 'LICENSE'),
102
102
  path.join(SOURCE_DIR, 'README.md'),
103
+ path.join(SOURCE_DIR, 'src/watch.ts'),
103
104
  ].includes(src)
104
105
  ) {
105
106
  log(
@@ -128,20 +129,25 @@ ${author.name}
128
129
  `,
129
130
  ),
130
131
  ),
131
- ...(
132
- await readdir(path.join(SOURCE_DIR, 'src', 'config'))
133
- ).map((environment) =>
134
- environment === 'common'
135
- ? Promise.resolve()
136
- : writeFile(
137
- path.join(project.directory, `.env.${environment}`),
138
- 'JWT_SECRET=oudelali\n',
139
- ),
132
+ ...(await readdir(path.join(SOURCE_DIR, 'src', 'config'))).map(
133
+ (environment) =>
134
+ environment === 'common'
135
+ ? Promise.resolve()
136
+ : writeFile(
137
+ path.join(project.directory, `.env.${environment}`),
138
+ 'JWT_SECRET=oudelali\n',
139
+ ),
140
140
  ),
141
141
  writeFile(
142
142
  path.join(project.directory, 'package.json'),
143
143
  JSON.stringify(finalPackageJSON, null, 2),
144
144
  ),
145
+ readFile(path.join(SOURCE_DIR, 'src/watch.ts')).then((data) => {
146
+ return writeFile(
147
+ path.join(SOURCE_DIR, 'src/watch.ts'),
148
+ data.toString().replace('../../', './'),
149
+ );
150
+ }),
145
151
  writeFile(
146
152
  path.join(project.directory, 'tsconfig.json'),
147
153
  JSON.stringify(
@@ -187,7 +193,7 @@ ${author.name}
187
193
  'error',
188
194
  `⚠️ - Could not retrieve the \`.gitignore\` file contents from: "${GIT_IGNORE_URL}"`,
189
195
  );
190
- log('error-stack', printStackTrace(err));
196
+ log('error-stack', printStackTrace(err as Error));
191
197
  }),
192
198
  new Promise((resolve, reject) =>
193
199
  exec(
@@ -206,7 +212,7 @@ ${author.name}
206
212
  ),
207
213
  ).catch((err) => {
208
214
  log('error', '⚠️ - Could not initialize the git project!');
209
- log('error-stack', printStackTrace(err));
215
+ log('error-stack', printStackTrace(err as Error));
210
216
  }),
211
217
  ]);
212
218
 
@@ -242,7 +248,7 @@ ${author.name}
242
248
  symbol: '❌',
243
249
  text: 'Failed to install dependencies',
244
250
  });
245
- log('error-stack', printStackTrace(err));
251
+ log('error-stack', printStackTrace(err as Error));
246
252
  }
247
253
 
248
254
  log(
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  import { describe, it, beforeEach, jest, expect } from '@jest/globals';
2
3
  import _inquirer from 'inquirer';
3
4
  import initProject from './project.js';
@@ -54,7 +54,7 @@ export default autoService(async function initProject({
54
54
  'error',
55
55
  `Cannot create the project's directory: "${projectDirectory}"`,
56
56
  );
57
- log('error-stack', printStackTrace(err));
57
+ log('error-stack', printStackTrace(err as Error));
58
58
  throw YError.wrap(err as Error, 'E_PROJECT_DIR', projectDirectory);
59
59
  }
60
60