create-stk 0.0.2 → 0.0.4

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/index.cjs CHANGED
@@ -95,7 +95,7 @@ function parseCliArgs(argv) {
95
95
  let parsed = null;
96
96
  const { project, normalizedArgv } = detectPositionalProject(argv);
97
97
  const managers = SUPPORTED_PACKAGES.map((p) => p.pkName);
98
- program.name("create-stk").description("Opinionated, unified project scaffolding CLI.").argument("[directory]", "Where your project will be stored").option("-p, --project <type>", `Project type: ${PROJECT_TYPES.join(" | ")}`).option("--pm <manager>", `Package manager: ${managers.join(" | ")}`).option("--git", "Initialize git repository").option("--no-git", "Skip git initialization").option("--skip-install", "Skip dependency installation").option("--dry-run", "Print the plan without creating files");
98
+ program.name("create-stk").description("Opinionated, unified project scaffolding CLI.").argument("[directory]", "Where your project will be stored").option("-p, --project <type>", `Project type: ${PROJECT_TYPES.join(" | ")} (auto-selects defaults)`).option("--pm <manager>", `Package manager: ${managers.join(" | ")} (defaults to detected when project is provided)`).option("--git", "Initialize git repository (default when project is provided)").option("--no-git", "Skip git initialization (overrides default)").option("--skip-install", "Skip dependency installation").option("--dry-run", "Print the plan without creating files");
99
99
  program.action((directory, options, command) => {
100
100
  const projectOption = options.project;
101
101
  const packageManager = options.pm;
@@ -151,6 +151,8 @@ async function resolvePlan(cli) {
151
151
  let packageManager;
152
152
  if (cli.packageManager) {
153
153
  packageManager = cli.packageManager;
154
+ } else if (project) {
155
+ packageManager = pkName;
154
156
  } else {
155
157
  const selections = await (0, import_prompts.group)(
156
158
  {
@@ -176,6 +178,8 @@ async function resolvePlan(cli) {
176
178
  let git;
177
179
  if (typeof cli.git === "boolean") {
178
180
  git = cli.git;
181
+ } else if (project) {
182
+ git = true;
179
183
  } else {
180
184
  const gitChoice = await (0, import_prompts.confirm)({
181
185
  message: "Do you want to initialize a git repo?"
@@ -260,13 +264,16 @@ var nextPageCode = `export default function Home() {
260
264
  </div>
261
265
  )
262
266
  }`;
263
- var nodeIndex = `
264
- console.log("Hello World!");`;
267
+ var nodeIndex = `function main() {
268
+ console.log("Hello World!");
269
+ }
270
+
271
+ main();`;
265
272
  var getNodePackage = (dirName) => `{
266
273
  "name": "${dirName}",
267
274
  "version": "1.0.0",
268
275
  "scripts": {
269
- "dev": "tsx index.mts"
276
+ "dev": "tsx index.mt"
270
277
  },
271
278
  "dependencies": {},
272
279
  "devDependencies": {}
@@ -354,7 +361,7 @@ async function setupNode(ctx) {
354
361
  import_fs.default.mkdirSync(targetDir, { recursive: true });
355
362
  }
356
363
  import_fs.default.writeFileSync(import_path2.default.join(targetDir, "package.json"), getNodePackage(dirName));
357
- import_fs.default.writeFileSync(import_path2.default.join(targetDir, "index.mts"), nodeIndex);
364
+ import_fs.default.writeFileSync(import_path2.default.join(targetDir, "index.ts"), nodeIndex);
358
365
  s.stop("Node Project created!");
359
366
  }
360
367
  async function setupSvelte(ctx) {
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ function parseCliArgs(argv) {
72
72
  let parsed = null;
73
73
  const { project, normalizedArgv } = detectPositionalProject(argv);
74
74
  const managers = SUPPORTED_PACKAGES.map((p) => p.pkName);
75
- program.name("create-stk").description("Opinionated, unified project scaffolding CLI.").argument("[directory]", "Where your project will be stored").option("-p, --project <type>", `Project type: ${PROJECT_TYPES.join(" | ")}`).option("--pm <manager>", `Package manager: ${managers.join(" | ")}`).option("--git", "Initialize git repository").option("--no-git", "Skip git initialization").option("--skip-install", "Skip dependency installation").option("--dry-run", "Print the plan without creating files");
75
+ program.name("create-stk").description("Opinionated, unified project scaffolding CLI.").argument("[directory]", "Where your project will be stored").option("-p, --project <type>", `Project type: ${PROJECT_TYPES.join(" | ")} (auto-selects defaults)`).option("--pm <manager>", `Package manager: ${managers.join(" | ")} (defaults to detected when project is provided)`).option("--git", "Initialize git repository (default when project is provided)").option("--no-git", "Skip git initialization (overrides default)").option("--skip-install", "Skip dependency installation").option("--dry-run", "Print the plan without creating files");
76
76
  program.action((directory, options, command) => {
77
77
  const projectOption = options.project;
78
78
  const packageManager = options.pm;
@@ -128,6 +128,8 @@ async function resolvePlan(cli) {
128
128
  let packageManager;
129
129
  if (cli.packageManager) {
130
130
  packageManager = cli.packageManager;
131
+ } else if (project) {
132
+ packageManager = pkName;
131
133
  } else {
132
134
  const selections = await group(
133
135
  {
@@ -153,6 +155,8 @@ async function resolvePlan(cli) {
153
155
  let git;
154
156
  if (typeof cli.git === "boolean") {
155
157
  git = cli.git;
158
+ } else if (project) {
159
+ git = true;
156
160
  } else {
157
161
  const gitChoice = await confirm({
158
162
  message: "Do you want to initialize a git repo?"
@@ -236,13 +240,16 @@ var nextPageCode = `export default function Home() {
236
240
  </div>
237
241
  )
238
242
  }`;
239
- var nodeIndex = `
240
- console.log("Hello World!");`;
243
+ var nodeIndex = `function main() {
244
+ console.log("Hello World!");
245
+ }
246
+
247
+ main();`;
241
248
  var getNodePackage = (dirName) => `{
242
249
  "name": "${dirName}",
243
250
  "version": "1.0.0",
244
251
  "scripts": {
245
- "dev": "tsx index.mts"
252
+ "dev": "tsx index.mt"
246
253
  },
247
254
  "dependencies": {},
248
255
  "devDependencies": {}
@@ -330,7 +337,7 @@ async function setupNode(ctx) {
330
337
  fs.mkdirSync(targetDir, { recursive: true });
331
338
  }
332
339
  fs.writeFileSync(path2.join(targetDir, "package.json"), getNodePackage(dirName));
333
- fs.writeFileSync(path2.join(targetDir, "index.mts"), nodeIndex);
340
+ fs.writeFileSync(path2.join(targetDir, "index.ts"), nodeIndex);
334
341
  s.stop("Node Project created!");
335
342
  }
336
343
  async function setupSvelte(ctx) {
package/dist/src/cli.js CHANGED
@@ -52,10 +52,10 @@ export function parseCliArgs(argv) {
52
52
  .name('create-stk')
53
53
  .description('Opinionated, unified project scaffolding CLI.')
54
54
  .argument('[directory]', 'Where your project will be stored')
55
- .option('-p, --project <type>', `Project type: ${PROJECT_TYPES.join(' | ')}`)
56
- .option('--pm <manager>', `Package manager: ${managers.join(' | ')}`)
57
- .option('--git', 'Initialize git repository')
58
- .option('--no-git', 'Skip git initialization')
55
+ .option('-p, --project <type>', `Project type: ${PROJECT_TYPES.join(' | ')} (auto-selects defaults)`)
56
+ .option('--pm <manager>', `Package manager: ${managers.join(' | ')} (defaults to detected when project is provided)`)
57
+ .option('--git', 'Initialize git repository (default when project is provided)')
58
+ .option('--no-git', 'Skip git initialization (overrides default)')
59
59
  .option('--skip-install', 'Skip dependency installation')
60
60
  .option('--dry-run', 'Print the plan without creating files');
61
61
  program.action((directory, options, command) => {
@@ -116,6 +116,9 @@ export async function resolvePlan(cli) {
116
116
  if (cli.packageManager) {
117
117
  packageManager = cli.packageManager;
118
118
  }
119
+ else if (project) {
120
+ packageManager = pkName;
121
+ }
119
122
  else {
120
123
  const selections = await group({
121
124
  packageManager: () => select({
@@ -139,6 +142,9 @@ export async function resolvePlan(cli) {
139
142
  if (typeof cli.git === 'boolean') {
140
143
  git = cli.git;
141
144
  }
145
+ else if (project) {
146
+ git = true;
147
+ }
142
148
  else {
143
149
  const gitChoice = await confirm({
144
150
  message: 'Do you want to initialize a git repo?',
@@ -73,13 +73,16 @@ export const nextPageCode = `export default function Home() {
73
73
  )
74
74
  }`;
75
75
  // Node
76
- export const nodeIndex = `
77
- console.log("Hello World!");`;
76
+ export const nodeIndex = `function main() {
77
+ console.log("Hello World!");
78
+ }
79
+
80
+ main();`;
78
81
  export const getNodePackage = (dirName) => `{
79
82
  "name": "${dirName}",
80
83
  "version": "1.0.0",
81
84
  "scripts": {
82
- "dev": "tsx index.mts"
85
+ "dev": "tsx index.mt"
83
86
  },
84
87
  "dependencies": {},
85
88
  "devDependencies": {}
@@ -175,7 +178,7 @@ async function setupNode(ctx) {
175
178
  fs.mkdirSync(targetDir, { recursive: true });
176
179
  }
177
180
  fs.writeFileSync(path.join(targetDir, 'package.json'), getNodePackage(dirName));
178
- fs.writeFileSync(path.join(targetDir, 'index.mts'), nodeIndex);
181
+ fs.writeFileSync(path.join(targetDir, 'index.ts'), nodeIndex);
179
182
  s.stop('Node Project created!');
180
183
  }
181
184
  async function setupSvelte(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-stk",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Opinionated, unified project scaffolding CLI.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",