create-turbo-kit 1.0.1 → 1.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.
- package/dist/chunk-5F6FI7NU.js +48 -0
- package/dist/chunk-5F6FI7NU.js.map +1 -0
- package/dist/chunk-7W32JAIP.js +36 -0
- package/dist/chunk-7W32JAIP.js.map +1 -0
- package/dist/chunk-EYEU3RGM.js +35 -0
- package/dist/chunk-EYEU3RGM.js.map +1 -0
- package/dist/chunk-SYNNS7BI.js +124 -0
- package/dist/chunk-SYNNS7BI.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +164 -0
- package/dist/cli.js.map +1 -0
- package/dist/helpers/install.d.ts +6 -0
- package/dist/helpers/install.js +10 -0
- package/dist/helpers/install.js.map +1 -0
- package/dist/helpers/scaffold.d.ts +9 -0
- package/dist/helpers/scaffold.js +8 -0
- package/dist/helpers/scaffold.js.map +1 -0
- package/dist/helpers/transform.d.ts +28 -0
- package/dist/helpers/transform.js +15 -0
- package/dist/helpers/transform.js.map +1 -0
- package/dist/utils/package-manager.d.ts +5 -0
- package/dist/utils/package-manager.js +9 -0
- package/dist/utils/package-manager.js.map +1 -0
- package/package.json +5 -2
- package/src/cli.ts +60 -4
- package/src/helpers/install.ts +22 -0
- package/src/helpers/scaffold.ts +1 -0
- package/src/helpers/transform.ts +80 -0
- package/tsup.config.ts +10 -0
- package/dist/cli.cjs +0 -256
- package/dist/helpers/install.cjs +0 -75
- package/dist/helpers/scaffold.cjs +0 -82
- package/dist/helpers/transform.cjs +0 -90
- package/dist/utils/package-manager.cjs +0 -59
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/helpers/transform.ts
|
|
31
|
-
var transform_exports = {};
|
|
32
|
-
__export(transform_exports, {
|
|
33
|
-
replaceScope: () => replaceScope,
|
|
34
|
-
setupEnv: () => setupEnv
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(transform_exports);
|
|
37
|
-
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
38
|
-
var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
39
|
-
var import_path = __toESM(require("path"), 1);
|
|
40
|
-
var import_prompts = require("@clack/prompts");
|
|
41
|
-
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
42
|
-
async function replaceScope(projectDir, newScope) {
|
|
43
|
-
const s = (0, import_prompts.spinner)();
|
|
44
|
-
s.start(`Replacing scope with ${import_picocolors.default.cyan(newScope)}...`);
|
|
45
|
-
try {
|
|
46
|
-
const files = await (0, import_fast_glob.default)("**/*", {
|
|
47
|
-
cwd: projectDir,
|
|
48
|
-
ignore: [
|
|
49
|
-
"**/.git/**",
|
|
50
|
-
"**/node_modules/**",
|
|
51
|
-
"**/.turbo/**",
|
|
52
|
-
"**/dist/**",
|
|
53
|
-
"**/.next/**",
|
|
54
|
-
"**/pnpm-lock.yaml",
|
|
55
|
-
"**/yarn.lock",
|
|
56
|
-
"**/package-lock.json",
|
|
57
|
-
"**/bun.lockb"
|
|
58
|
-
],
|
|
59
|
-
absolute: true
|
|
60
|
-
});
|
|
61
|
-
await Promise.all(
|
|
62
|
-
files.map(async (file) => {
|
|
63
|
-
try {
|
|
64
|
-
const content = await import_fs_extra.default.readFile(file, "utf8");
|
|
65
|
-
if (content.includes("@acme")) {
|
|
66
|
-
const newContent = content.replace(/@acme/g, newScope);
|
|
67
|
-
await import_fs_extra.default.writeFile(file, newContent);
|
|
68
|
-
}
|
|
69
|
-
} catch (e) {
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
);
|
|
73
|
-
s.stop(`Replaced scope with ${import_picocolors.default.cyan(newScope)}`);
|
|
74
|
-
} catch (error) {
|
|
75
|
-
s.stop("Failed to replace scope");
|
|
76
|
-
throw error;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
async function setupEnv(projectDir) {
|
|
80
|
-
const envExample = import_path.default.join(projectDir, ".env.example");
|
|
81
|
-
const envDest = import_path.default.join(projectDir, ".env");
|
|
82
|
-
if (await import_fs_extra.default.pathExists(envExample)) {
|
|
83
|
-
await import_fs_extra.default.copy(envExample, envDest);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
87
|
-
0 && (module.exports = {
|
|
88
|
-
replaceScope,
|
|
89
|
-
setupEnv
|
|
90
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/utils/package-manager.ts
|
|
21
|
-
var package_manager_exports = {};
|
|
22
|
-
__export(package_manager_exports, {
|
|
23
|
-
getInstallCommand: () => getInstallCommand,
|
|
24
|
-
getRunner: () => getRunner
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(package_manager_exports);
|
|
27
|
-
function getRunner(pm) {
|
|
28
|
-
switch (pm) {
|
|
29
|
-
case "npm":
|
|
30
|
-
return "npx";
|
|
31
|
-
case "pnpm":
|
|
32
|
-
return "pnpm dlx";
|
|
33
|
-
case "yarn":
|
|
34
|
-
return "yarn dlx";
|
|
35
|
-
case "bun":
|
|
36
|
-
return "bunx";
|
|
37
|
-
default:
|
|
38
|
-
return "npx";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function getInstallCommand(pm) {
|
|
42
|
-
switch (pm) {
|
|
43
|
-
case "npm":
|
|
44
|
-
return "npm install";
|
|
45
|
-
case "pnpm":
|
|
46
|
-
return "pnpm install";
|
|
47
|
-
case "yarn":
|
|
48
|
-
return "yarn install";
|
|
49
|
-
case "bun":
|
|
50
|
-
return "bun install";
|
|
51
|
-
default:
|
|
52
|
-
return "npm install";
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
-
0 && (module.exports = {
|
|
57
|
-
getInstallCommand,
|
|
58
|
-
getRunner
|
|
59
|
-
});
|