create-newt-app 0.24.0 → 0.26.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/README.md +5 -0
- package/dist/index.js +56 -9
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/zeevo/newt-app/main/.github/assets/logo-dark.svg">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/zeevo/newt-app/main/.github/assets/logo-light.svg" alt="newt-app" width="120">
|
|
5
|
+
</picture>
|
|
6
|
+
|
|
2
7
|
<h1>newt-app</h1>
|
|
3
8
|
<p><strong>Scaffold a production-ready, full-stack TypeScript monorepo in one command.</strong></p>
|
|
4
9
|
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import chalk from "chalk";
|
|
|
7
7
|
// package.json
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "create-newt-app",
|
|
10
|
-
version: "0.
|
|
10
|
+
version: "0.26.0",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
private: false,
|
|
13
13
|
type: "module",
|
|
@@ -17,6 +17,9 @@ var package_default = {
|
|
|
17
17
|
files: [
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
|
+
engines: {
|
|
21
|
+
node: ">=20.9.0"
|
|
22
|
+
},
|
|
20
23
|
scripts: {
|
|
21
24
|
build: "tsup",
|
|
22
25
|
"build:watch": "tsup --watch",
|
|
@@ -70,7 +73,7 @@ var package_json_default = {
|
|
|
70
73
|
},
|
|
71
74
|
"packageManager": "pnpm@9.0.0",
|
|
72
75
|
"engines": {
|
|
73
|
-
"node": ">=
|
|
76
|
+
"node": ">=20.9.0"
|
|
74
77
|
}
|
|
75
78
|
}`
|
|
76
79
|
};
|
|
@@ -1599,7 +1602,7 @@ var versions = {
|
|
|
1599
1602
|
"@nestjs/schematics": "^11.0.0",
|
|
1600
1603
|
"@nestjs/serve-static": "^5.0.0",
|
|
1601
1604
|
"@nestjs/testing": "^11.0.1",
|
|
1602
|
-
"@next/eslint-plugin-next": "^16.
|
|
1605
|
+
"@next/eslint-plugin-next": "^16.3.0",
|
|
1603
1606
|
"@shadcn/react": "^0.2.1",
|
|
1604
1607
|
"@swc/core": "^1.10.0",
|
|
1605
1608
|
"@tailwindcss/postcss": "^4.2.1",
|
|
@@ -1636,7 +1639,7 @@ var versions = {
|
|
|
1636
1639
|
"jest": "^30.0.0",
|
|
1637
1640
|
"kysely": "^0.28.2",
|
|
1638
1641
|
"lucide-react": "^1.16.0",
|
|
1639
|
-
"next": "16.
|
|
1642
|
+
"next": "16.3.0",
|
|
1640
1643
|
"next-themes": "^0.4.6",
|
|
1641
1644
|
"oxfmt": "^0.59.0",
|
|
1642
1645
|
"oxlint": "^1.74.0",
|
|
@@ -12821,6 +12824,36 @@ function validateDeploymentCombo(deployment, nestDiOnly2) {
|
|
|
12821
12824
|
}
|
|
12822
12825
|
return { valid: true };
|
|
12823
12826
|
}
|
|
12827
|
+
var TOOL_HINTS = {
|
|
12828
|
+
pnpm: "Install it with `npm install -g pnpm`, or run `corepack enable`.",
|
|
12829
|
+
git: "Install it from https://git-scm.com/downloads, or pass --no-git."
|
|
12830
|
+
};
|
|
12831
|
+
async function checkRequiredTools(needs, hasCommand2) {
|
|
12832
|
+
const required = [
|
|
12833
|
+
...needs.install ? ["pnpm"] : [],
|
|
12834
|
+
...needs.git ? ["git"] : []
|
|
12835
|
+
];
|
|
12836
|
+
const missing = (await Promise.all(
|
|
12837
|
+
required.map(async (tool) => await hasCommand2(tool) ? null : tool)
|
|
12838
|
+
)).filter((tool) => tool !== null);
|
|
12839
|
+
if (missing.length === 0) return { valid: true };
|
|
12840
|
+
return {
|
|
12841
|
+
valid: false,
|
|
12842
|
+
error: missing.map((tool) => `${tool} was not found on PATH. ${TOOL_HINTS[tool]}`).join("\n")
|
|
12843
|
+
};
|
|
12844
|
+
}
|
|
12845
|
+
function validateNodeVersion(current, requirement) {
|
|
12846
|
+
const parse = (value) => (value.match(/\d+/g) ?? []).slice(0, 3).map(Number);
|
|
12847
|
+
const [major = 0, minor = 0, patch = 0] = parse(current);
|
|
12848
|
+
const [minMajor = 0, minMinor = 0, minPatch = 0] = parse(requirement);
|
|
12849
|
+
const satisfied = major !== minMajor ? major > minMajor : minor !== minMinor ? minor > minMinor : patch >= minPatch;
|
|
12850
|
+
if (satisfied) return { valid: true };
|
|
12851
|
+
return {
|
|
12852
|
+
valid: false,
|
|
12853
|
+
error: `Node ${requirement} is required, but this is ${current}.
|
|
12854
|
+
Upgrade Node, or switch versions with a manager such as nvm or fnm.`
|
|
12855
|
+
};
|
|
12856
|
+
}
|
|
12824
12857
|
function validateProjectName(projectName) {
|
|
12825
12858
|
if (!projectName) {
|
|
12826
12859
|
return { valid: false, error: "Project name is required" };
|
|
@@ -12874,6 +12907,14 @@ async function scaffold(modules, options) {
|
|
|
12874
12907
|
}
|
|
12875
12908
|
await sortPackageJsons(options.name);
|
|
12876
12909
|
}
|
|
12910
|
+
async function hasCommand(command) {
|
|
12911
|
+
try {
|
|
12912
|
+
await execa(command, ["--version"]);
|
|
12913
|
+
return true;
|
|
12914
|
+
} catch {
|
|
12915
|
+
return false;
|
|
12916
|
+
}
|
|
12917
|
+
}
|
|
12877
12918
|
async function pnpmInstall(cwd) {
|
|
12878
12919
|
return await execa("pnpm", ["install"], {
|
|
12879
12920
|
cwd
|
|
@@ -12974,6 +13015,16 @@ async function doInit(options) {
|
|
|
12974
13015
|
}
|
|
12975
13016
|
};
|
|
12976
13017
|
try {
|
|
13018
|
+
const preflight = [
|
|
13019
|
+
validateNodeVersion(process.version, package_default.engines.node),
|
|
13020
|
+
await checkRequiredTools(
|
|
13021
|
+
{ install: options.install, git: options.git },
|
|
13022
|
+
hasCommand
|
|
13023
|
+
)
|
|
13024
|
+
].find((result) => !result.valid);
|
|
13025
|
+
if (preflight) {
|
|
13026
|
+
throw new Error(preflight.error);
|
|
13027
|
+
}
|
|
12977
13028
|
const group2 = await p.group(groupOpts, {
|
|
12978
13029
|
onCancel: () => {
|
|
12979
13030
|
console.log("Exiting.");
|
|
@@ -13020,11 +13071,7 @@ async function doInit(options) {
|
|
|
13020
13071
|
taskBuilder.add({
|
|
13021
13072
|
title: "Installing with pnpm",
|
|
13022
13073
|
task: async () => {
|
|
13023
|
-
|
|
13024
|
-
await pnpmInstall(name);
|
|
13025
|
-
} catch (e) {
|
|
13026
|
-
console.log(e);
|
|
13027
|
-
}
|
|
13074
|
+
await pnpmInstall(name);
|
|
13028
13075
|
return "Installed.";
|
|
13029
13076
|
}
|
|
13030
13077
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-newt-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20.9.0"
|
|
15
|
+
},
|
|
13
16
|
"dependencies": {
|
|
14
17
|
"@clack/prompts": "^0.11.0",
|
|
15
18
|
"chalk": "^5.3.0",
|