@quilted/create 0.1.21 → 0.1.24
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.
- package/CHANGELOG.md +18 -0
- package/build/cjs/app.cjs +252 -530
- package/build/cjs/index.cjs +261 -1002
- package/build/cjs/index3.cjs +1205 -577
- package/build/cjs/package-manager.cjs +219 -796
- package/build/cjs/package.cjs +325 -713
- package/build/cjs/parser-babel.cjs +3 -3
- package/build/cjs/parser-typescript.cjs +312 -0
- package/build/cjs/parser-yaml.cjs +2 -2
- package/build/cjs/standalone.cjs +3 -3
- package/build/esm/app.mjs +259 -537
- package/build/esm/index.mjs +245 -984
- package/build/esm/index2.mjs +16 -16
- package/build/esm/index3.mjs +1205 -548
- package/build/esm/package-manager.mjs +220 -797
- package/build/esm/package.mjs +328 -716
- package/build/esm/parser-babel.mjs +1 -1
- package/build/esm/parser-typescript.mjs +310 -0
- package/build/esm/parser-yaml.mjs +1 -1
- package/build/esm/standalone.mjs +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/app.d.ts.map +1 -1
- package/build/typescript/package.d.ts.map +1 -1
- package/build/typescript/shared.d.ts +1 -0
- package/build/typescript/shared.d.ts.map +1 -1
- package/package.json +1 -1
- package/source/app.ts +15 -2
- package/source/package.ts +5 -17
- package/source/shared.ts +24 -6
- package/templates/vscode/_vscode/settings.json +6 -1
- package/build/cjs/_commonjsHelpers.cjs +0 -10
- package/build/esm/_commonjsHelpers.mjs +0 -7
package/build/esm/index2.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path__default from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import process from 'node:process';
|
|
4
|
-
import
|
|
4
|
+
import fs__default, { promises } from 'node:fs';
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
How it works:
|
|
@@ -219,7 +219,7 @@ async function locatePath(
|
|
|
219
219
|
|
|
220
220
|
return pLocate(paths, async path_ => {
|
|
221
221
|
try {
|
|
222
|
-
const stat = await statFunction(
|
|
222
|
+
const stat = await statFunction(path__default.resolve(cwd, path_));
|
|
223
223
|
return matchType(type, stat);
|
|
224
224
|
} catch {
|
|
225
225
|
return false;
|
|
@@ -238,11 +238,11 @@ function locatePathSync(
|
|
|
238
238
|
checkType(type);
|
|
239
239
|
cwd = toPath$1(cwd);
|
|
240
240
|
|
|
241
|
-
const statFunction = allowSymlinks ?
|
|
241
|
+
const statFunction = allowSymlinks ? fs__default.statSync : fs__default.lstatSync;
|
|
242
242
|
|
|
243
243
|
for (const path_ of paths) {
|
|
244
244
|
try {
|
|
245
|
-
const stat = statFunction(
|
|
245
|
+
const stat = statFunction(path__default.resolve(cwd, path_));
|
|
246
246
|
|
|
247
247
|
if (matchType(type, stat)) {
|
|
248
248
|
return path_;
|
|
@@ -256,9 +256,9 @@ const toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath)
|
|
|
256
256
|
const findUpStop = Symbol('findUpStop');
|
|
257
257
|
|
|
258
258
|
async function findUpMultiple(name, options) {
|
|
259
|
-
let directory =
|
|
260
|
-
const {root} =
|
|
261
|
-
const stopAt =
|
|
259
|
+
let directory = path__default.resolve(toPath(options.cwd) || '');
|
|
260
|
+
const {root} = path__default.parse(directory);
|
|
261
|
+
const stopAt = path__default.resolve(directory, options.stopAt || root);
|
|
262
262
|
const limit = options.limit || Number.POSITIVE_INFINITY;
|
|
263
263
|
const paths = [name].flat();
|
|
264
264
|
|
|
@@ -286,22 +286,22 @@ async function findUpMultiple(name, options) {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
if (foundPath) {
|
|
289
|
-
matches.push(
|
|
289
|
+
matches.push(path__default.resolve(directory, foundPath));
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
if (directory === stopAt || matches.length >= limit) {
|
|
293
293
|
break;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
directory =
|
|
296
|
+
directory = path__default.dirname(directory);
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
return matches;
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
function findUpMultipleSync(name, options) {
|
|
303
|
-
let directory =
|
|
304
|
-
const {root} =
|
|
303
|
+
let directory = path__default.resolve(toPath(options.cwd) || '');
|
|
304
|
+
const {root} = path__default.parse(directory);
|
|
305
305
|
const stopAt = options.stopAt || root;
|
|
306
306
|
const limit = options.limit || Number.POSITIVE_INFINITY;
|
|
307
307
|
const paths = [name].flat();
|
|
@@ -329,14 +329,14 @@ function findUpMultipleSync(name, options) {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
if (foundPath) {
|
|
332
|
-
matches.push(
|
|
332
|
+
matches.push(path__default.resolve(directory, foundPath));
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
if (directory === stopAt || matches.length >= limit) {
|
|
336
336
|
break;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
directory =
|
|
339
|
+
directory = path__default.dirname(directory);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
return matches;
|
|
@@ -354,12 +354,12 @@ function findUpSync(name, options) {
|
|
|
354
354
|
|
|
355
355
|
async function packageDirectory({cwd} = {}) {
|
|
356
356
|
const filePath = await findUp('package.json', {cwd});
|
|
357
|
-
return filePath &&
|
|
357
|
+
return filePath && path__default.dirname(filePath);
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
function packageDirectorySync({cwd} = {}) {
|
|
361
361
|
const filePath = findUpSync('package.json', {cwd});
|
|
362
|
-
return filePath &&
|
|
362
|
+
return filePath && path__default.dirname(filePath);
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
export { packageDirectory, packageDirectorySync };
|