create-sprint 0.0.44 → 0.0.46

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.
@@ -65,10 +65,11 @@ export function getJavaScriptPackageJson(name, telemetry) {
65
65
  export function getTsConfig() {
66
66
  return JSON.stringify({
67
67
  compilerOptions: {
68
- target: "ES2020",
69
- module: "ESNext",
70
- moduleResolution: "bundler",
71
- lib: ["ES2020"],
68
+ target: "ES2022",
69
+ module: "NodeNext",
70
+ moduleResolution: "NodeNext",
71
+ lib: ["ES2022"],
72
+ types: ["node"],
72
73
  outDir: "./dist",
73
74
  rootDir: "./src",
74
75
  strict: true,
@@ -79,7 +80,6 @@ export function getTsConfig() {
79
80
  declaration: true,
80
81
  declarationMap: true,
81
82
  sourceMap: true,
82
- tabWidth: 4,
83
83
  baseUrl: ".",
84
84
  paths: {
85
85
  "@/*": ["./src/*"]
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { execSync } from "child_process";
1
+ import { spawn } from "child_process";
2
2
  import { existsSync } from "fs";
3
3
  import { mkdir, writeFile } from "fs/promises";
4
4
  import { join } from "path";
@@ -47,7 +47,18 @@ export async function runCLI(args) {
47
47
  const s2 = p.spinner();
48
48
  s2.start("Installing dependencies");
49
49
  try {
50
- execSync("npm install", { cwd: targetDir, stdio: "pipe" });
50
+ await new Promise((resolve, reject) => {
51
+ const child = spawn("npm", ["install"], {
52
+ cwd: targetDir,
53
+ stdio: "pipe"
54
+ });
55
+ child.on("close", (code) => {
56
+ if (code === 0)
57
+ resolve();
58
+ else
59
+ reject(new Error(`npm install exited with code ${code}`));
60
+ });
61
+ });
51
62
  s2.stop("Dependencies installed");
52
63
  }
53
64
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sprint",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "description": "Create a new Sprint API project",
5
5
  "type": "module",
6
6
  "bin": {
package/src/generators.ts CHANGED
@@ -77,10 +77,11 @@ export function getJavaScriptPackageJson(name: string, telemetry: string) {
77
77
  export function getTsConfig() {
78
78
  return JSON.stringify({
79
79
  compilerOptions: {
80
- target: "ES2020",
81
- module: "ESNext",
82
- moduleResolution: "bundler",
83
- lib: ["ES2020"],
80
+ target: "ES2022",
81
+ module: "NodeNext",
82
+ moduleResolution: "NodeNext",
83
+ lib: ["ES2022"],
84
+ types: ["node"],
84
85
  outDir: "./dist",
85
86
  rootDir: "./src",
86
87
  strict: true,
@@ -91,7 +92,6 @@ export function getTsConfig() {
91
92
  declaration: true,
92
93
  declarationMap: true,
93
94
  sourceMap: true,
94
- tabWidth: 4,
95
95
  baseUrl: ".",
96
96
  paths: {
97
97
  "@/*": ["./src/*"]
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { execSync } from "child_process";
1
+ import { spawn } from "child_process";
2
2
  import { existsSync } from "fs";
3
3
  import { mkdir, writeFile } from "fs/promises";
4
4
  import { join } from "path";
@@ -78,7 +78,16 @@ export async function runCLI(args: string[]) {
78
78
  const s2 = p.spinner();
79
79
  s2.start("Installing dependencies");
80
80
  try {
81
- execSync("npm install", { cwd: targetDir, stdio: "pipe" });
81
+ await new Promise<void>((resolve, reject) => {
82
+ const child = spawn("npm", ["install"], {
83
+ cwd: targetDir,
84
+ stdio: "pipe"
85
+ });
86
+ child.on("close", (code) => {
87
+ if (code === 0) resolve();
88
+ else reject(new Error(`npm install exited with code ${code}`));
89
+ });
90
+ });
82
91
  s2.stop("Dependencies installed");
83
92
  } catch {
84
93
  s2.stop("Install failed — run npm install manually");