create-krispya 0.4.0 → 0.4.2
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/dist/cli.cjs +5 -1
- package/dist/cli.mjs +4 -1
- package/dist/index.cjs +40 -17
- package/dist/index.mjs +40 -17
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
const module$1 = require('module');
|
|
4
5
|
const process$1 = require('process');
|
|
5
6
|
const index = require('./index.cjs');
|
|
6
7
|
const path = require('path');
|
|
@@ -10,6 +11,7 @@ const p = require('@clack/prompts');
|
|
|
10
11
|
const color = require('chalk');
|
|
11
12
|
const undici = require('undici');
|
|
12
13
|
|
|
14
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
13
15
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
14
16
|
|
|
15
17
|
function _interopNamespaceCompat(e) {
|
|
@@ -27,6 +29,8 @@ function _interopNamespaceCompat(e) {
|
|
|
27
29
|
const p__namespace = /*#__PURE__*/_interopNamespaceCompat(p);
|
|
28
30
|
const color__default = /*#__PURE__*/_interopDefaultCompat(color);
|
|
29
31
|
|
|
32
|
+
const require$1 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href)));
|
|
33
|
+
const pkg = require$1("../package.json");
|
|
30
34
|
function getDefaultProjectName(template) {
|
|
31
35
|
const base = index.getBaseTemplate(template);
|
|
32
36
|
switch (base) {
|
|
@@ -408,7 +412,7 @@ async function main() {
|
|
|
408
412
|
'set Node.js version for engines.node field (default: "latest")'
|
|
409
413
|
).option("-y, --yes", "Skip prompts and use default values").action(async (name, options) => {
|
|
410
414
|
console.clear();
|
|
411
|
-
p__namespace.intro(color__default.bgCyan(color__default.black(
|
|
415
|
+
p__namespace.intro(color__default.bgCyan(color__default.black(` create-krispya v${pkg.version} `)));
|
|
412
416
|
let generateOptions;
|
|
413
417
|
if (Object.keys(options).length > 0) {
|
|
414
418
|
const template = options.template ?? "vanilla";
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
2
3
|
import { cwd } from 'process';
|
|
3
4
|
import { getBaseTemplate, getLatestPnpmVersion, getLatestNodeVersion, getLatestNpmVersion, generate, generateRandomName, getLanguageFromTemplate } from './index.mjs';
|
|
4
5
|
import { join, dirname } from 'path';
|
|
@@ -8,6 +9,8 @@ import * as p from '@clack/prompts';
|
|
|
8
9
|
import color from 'chalk';
|
|
9
10
|
import { fetch } from 'undici';
|
|
10
11
|
|
|
12
|
+
const require$1 = createRequire(import.meta.url);
|
|
13
|
+
const pkg = require$1("../package.json");
|
|
11
14
|
function getDefaultProjectName(template) {
|
|
12
15
|
const base = getBaseTemplate(template);
|
|
13
16
|
switch (base) {
|
|
@@ -389,7 +392,7 @@ async function main() {
|
|
|
389
392
|
'set Node.js version for engines.node field (default: "latest")'
|
|
390
393
|
).option("-y, --yes", "Skip prompts and use default values").action(async (name, options) => {
|
|
391
394
|
console.clear();
|
|
392
|
-
p.intro(color.bgCyan(color.black(
|
|
395
|
+
p.intro(color.bgCyan(color.black(` create-krispya v${pkg.version} `)));
|
|
393
396
|
let generateOptions;
|
|
394
397
|
if (Object.keys(options).length > 0) {
|
|
395
398
|
const template = options.template ?? "vanilla";
|
package/dist/index.cjs
CHANGED
|
@@ -1157,13 +1157,25 @@ function generate(options) {
|
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
1159
|
if (language === "typescript") {
|
|
1160
|
-
const
|
|
1160
|
+
const tsConfig = {
|
|
1161
|
+
$schema: "https://json.schemastore.org/tsconfig",
|
|
1162
|
+
files: [],
|
|
1163
|
+
references: [
|
|
1164
|
+
{ path: "./.config/tsconfig.app.json" },
|
|
1165
|
+
{ path: "./.config/tsconfig.node.json" }
|
|
1166
|
+
]
|
|
1167
|
+
};
|
|
1168
|
+
files["tsconfig.json"] = {
|
|
1169
|
+
type: "text",
|
|
1170
|
+
content: JSON.stringify(tsConfig, null, 2)
|
|
1171
|
+
};
|
|
1172
|
+
const tsConfigApp = {
|
|
1161
1173
|
$schema: "https://json.schemastore.org/tsconfig",
|
|
1162
1174
|
compilerOptions: {
|
|
1163
1175
|
target: "ESNext",
|
|
1164
1176
|
module: "ESNext",
|
|
1165
1177
|
moduleResolution: "bundler",
|
|
1166
|
-
lib: ["ESNext"],
|
|
1178
|
+
lib: ["DOM", "DOM.Iterable", "ESNext"],
|
|
1167
1179
|
esModuleInterop: true,
|
|
1168
1180
|
allowSyntheticDefaultImports: true,
|
|
1169
1181
|
strict: true,
|
|
@@ -1172,30 +1184,40 @@ function generate(options) {
|
|
|
1172
1184
|
rewriteRelativeImportExtensions: true,
|
|
1173
1185
|
erasableSyntaxOnly: true
|
|
1174
1186
|
},
|
|
1175
|
-
include: ["src", "tests"]
|
|
1176
|
-
};
|
|
1177
|
-
files["tsconfig.node.json"] = {
|
|
1178
|
-
type: "text",
|
|
1179
|
-
content: JSON.stringify(tsConfigNode, null, 2)
|
|
1180
|
-
};
|
|
1181
|
-
const tsConfig = {
|
|
1182
|
-
$schema: "https://json.schemastore.org/tsconfig",
|
|
1183
|
-
extends: "./tsconfig.node.json",
|
|
1184
|
-
compilerOptions: {},
|
|
1185
|
-
include: ["*.config.ts"],
|
|
1186
|
-
references: [{ path: "./tsconfig.node.json" }]
|
|
1187
|
+
include: ["../src", "../tests"]
|
|
1187
1188
|
};
|
|
1188
1189
|
if (isReact || isR3f) {
|
|
1189
|
-
|
|
1190
|
+
tsConfigApp.compilerOptions.jsx = "react-jsx";
|
|
1190
1191
|
devDependencies["@types/react"] = "^19.0.0";
|
|
1191
1192
|
devDependencies["@types/react-dom"] = "^19.0.0";
|
|
1192
1193
|
}
|
|
1193
1194
|
if (isR3f) {
|
|
1194
1195
|
devDependencies["@types/three"] = "~0.175.0";
|
|
1195
1196
|
}
|
|
1196
|
-
files["tsconfig.json"] = {
|
|
1197
|
+
files[".config/tsconfig.app.json"] = {
|
|
1197
1198
|
type: "text",
|
|
1198
|
-
content: JSON.stringify(
|
|
1199
|
+
content: JSON.stringify(tsConfigApp, null, 2)
|
|
1200
|
+
};
|
|
1201
|
+
const tsConfigNode = {
|
|
1202
|
+
$schema: "https://json.schemastore.org/tsconfig",
|
|
1203
|
+
compilerOptions: {
|
|
1204
|
+
target: "ESNext",
|
|
1205
|
+
module: "ESNext",
|
|
1206
|
+
moduleResolution: "bundler",
|
|
1207
|
+
lib: ["ESNext"],
|
|
1208
|
+
esModuleInterop: true,
|
|
1209
|
+
allowSyntheticDefaultImports: true,
|
|
1210
|
+
strict: true,
|
|
1211
|
+
skipLibCheck: true,
|
|
1212
|
+
composite: true,
|
|
1213
|
+
rewriteRelativeImportExtensions: true,
|
|
1214
|
+
erasableSyntaxOnly: true
|
|
1215
|
+
},
|
|
1216
|
+
include: ["../*.config.ts", "./*.ts"]
|
|
1217
|
+
};
|
|
1218
|
+
files[".config/tsconfig.node.json"] = {
|
|
1219
|
+
type: "text",
|
|
1220
|
+
content: JSON.stringify(tsConfigNode, null, 2)
|
|
1199
1221
|
};
|
|
1200
1222
|
}
|
|
1201
1223
|
const codeSnippets = {};
|
|
@@ -1335,6 +1357,7 @@ function generate(options) {
|
|
|
1335
1357
|
const jsxExt = language === "typescript" ? "tsx" : "jsx";
|
|
1336
1358
|
const packageJson = {
|
|
1337
1359
|
name,
|
|
1360
|
+
description: "Built with \u{1F339} create-krispya",
|
|
1338
1361
|
type: "module"
|
|
1339
1362
|
};
|
|
1340
1363
|
if (isLibrary) {
|
package/dist/index.mjs
CHANGED
|
@@ -1151,13 +1151,25 @@ function generate(options) {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
if (language === "typescript") {
|
|
1154
|
-
const
|
|
1154
|
+
const tsConfig = {
|
|
1155
|
+
$schema: "https://json.schemastore.org/tsconfig",
|
|
1156
|
+
files: [],
|
|
1157
|
+
references: [
|
|
1158
|
+
{ path: "./.config/tsconfig.app.json" },
|
|
1159
|
+
{ path: "./.config/tsconfig.node.json" }
|
|
1160
|
+
]
|
|
1161
|
+
};
|
|
1162
|
+
files["tsconfig.json"] = {
|
|
1163
|
+
type: "text",
|
|
1164
|
+
content: JSON.stringify(tsConfig, null, 2)
|
|
1165
|
+
};
|
|
1166
|
+
const tsConfigApp = {
|
|
1155
1167
|
$schema: "https://json.schemastore.org/tsconfig",
|
|
1156
1168
|
compilerOptions: {
|
|
1157
1169
|
target: "ESNext",
|
|
1158
1170
|
module: "ESNext",
|
|
1159
1171
|
moduleResolution: "bundler",
|
|
1160
|
-
lib: ["ESNext"],
|
|
1172
|
+
lib: ["DOM", "DOM.Iterable", "ESNext"],
|
|
1161
1173
|
esModuleInterop: true,
|
|
1162
1174
|
allowSyntheticDefaultImports: true,
|
|
1163
1175
|
strict: true,
|
|
@@ -1166,30 +1178,40 @@ function generate(options) {
|
|
|
1166
1178
|
rewriteRelativeImportExtensions: true,
|
|
1167
1179
|
erasableSyntaxOnly: true
|
|
1168
1180
|
},
|
|
1169
|
-
include: ["src", "tests"]
|
|
1170
|
-
};
|
|
1171
|
-
files["tsconfig.node.json"] = {
|
|
1172
|
-
type: "text",
|
|
1173
|
-
content: JSON.stringify(tsConfigNode, null, 2)
|
|
1174
|
-
};
|
|
1175
|
-
const tsConfig = {
|
|
1176
|
-
$schema: "https://json.schemastore.org/tsconfig",
|
|
1177
|
-
extends: "./tsconfig.node.json",
|
|
1178
|
-
compilerOptions: {},
|
|
1179
|
-
include: ["*.config.ts"],
|
|
1180
|
-
references: [{ path: "./tsconfig.node.json" }]
|
|
1181
|
+
include: ["../src", "../tests"]
|
|
1181
1182
|
};
|
|
1182
1183
|
if (isReact || isR3f) {
|
|
1183
|
-
|
|
1184
|
+
tsConfigApp.compilerOptions.jsx = "react-jsx";
|
|
1184
1185
|
devDependencies["@types/react"] = "^19.0.0";
|
|
1185
1186
|
devDependencies["@types/react-dom"] = "^19.0.0";
|
|
1186
1187
|
}
|
|
1187
1188
|
if (isR3f) {
|
|
1188
1189
|
devDependencies["@types/three"] = "~0.175.0";
|
|
1189
1190
|
}
|
|
1190
|
-
files["tsconfig.json"] = {
|
|
1191
|
+
files[".config/tsconfig.app.json"] = {
|
|
1191
1192
|
type: "text",
|
|
1192
|
-
content: JSON.stringify(
|
|
1193
|
+
content: JSON.stringify(tsConfigApp, null, 2)
|
|
1194
|
+
};
|
|
1195
|
+
const tsConfigNode = {
|
|
1196
|
+
$schema: "https://json.schemastore.org/tsconfig",
|
|
1197
|
+
compilerOptions: {
|
|
1198
|
+
target: "ESNext",
|
|
1199
|
+
module: "ESNext",
|
|
1200
|
+
moduleResolution: "bundler",
|
|
1201
|
+
lib: ["ESNext"],
|
|
1202
|
+
esModuleInterop: true,
|
|
1203
|
+
allowSyntheticDefaultImports: true,
|
|
1204
|
+
strict: true,
|
|
1205
|
+
skipLibCheck: true,
|
|
1206
|
+
composite: true,
|
|
1207
|
+
rewriteRelativeImportExtensions: true,
|
|
1208
|
+
erasableSyntaxOnly: true
|
|
1209
|
+
},
|
|
1210
|
+
include: ["../*.config.ts", "./*.ts"]
|
|
1211
|
+
};
|
|
1212
|
+
files[".config/tsconfig.node.json"] = {
|
|
1213
|
+
type: "text",
|
|
1214
|
+
content: JSON.stringify(tsConfigNode, null, 2)
|
|
1193
1215
|
};
|
|
1194
1216
|
}
|
|
1195
1217
|
const codeSnippets = {};
|
|
@@ -1329,6 +1351,7 @@ function generate(options) {
|
|
|
1329
1351
|
const jsxExt = language === "typescript" ? "tsx" : "jsx";
|
|
1330
1352
|
const packageJson = {
|
|
1331
1353
|
name,
|
|
1354
|
+
description: "Built with \u{1F339} create-krispya",
|
|
1332
1355
|
type: "module"
|
|
1333
1356
|
};
|
|
1334
1357
|
if (isLibrary) {
|