tackl 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/bin/tackl.js +31 -27
  2. package/package.json +1 -1
package/bin/tackl.js CHANGED
@@ -25,9 +25,10 @@ const log = {
25
25
  };
26
26
 
27
27
  const showBanner = () => {
28
+ const purple = str => `\x1b[38;2;128;0;255m${str}\x1b[0m`;
28
29
  console.log(
29
30
  pc.bold(
30
- pc.cyan(`
31
+ purple(`
31
32
  ╔═════════════════════════════════════════════════╗
32
33
  ║ ║
33
34
  ║ ████████╗ █████╗ ██████╗██╗ ██╗██╗ ║
@@ -58,13 +59,15 @@ ${pc.bold('Usage:')}
58
59
  tackl [project-name] [options]
59
60
 
60
61
  ${pc.bold('Options:')}
61
- --no-install Skip dependency installation
62
- --no-git Skip git initialization
62
+ --no-install Skip dependency installation (default: install)
63
+ --no-git Skip git initialization (default: init)
63
64
  -h, --help Show this help message
64
65
 
65
66
  ${pc.bold('Examples:')}
66
- tackl my-app
67
- tackl my-app --no-install --no-git
67
+ tackl my-app # Creates project with npm install + git init
68
+ tackl my-app --no-install # Creates project with git init only
69
+ tackl my-app --no-git # Creates project with npm install only
70
+ tackl my-app --no-install --no-git # Creates project only
68
71
 
69
72
  ${pc.bold('Repository:')} https://github.com/12-studio/tackl
70
73
  `);
@@ -76,8 +79,8 @@ ${pc.bold('Repository:')} https://github.com/12-studio/tackl
76
79
  const initial = {
77
80
  name: argName,
78
81
  ref: DEFAULT_REF, // Always use main branch
79
- install: !args.includes('--no-install'),
80
- git: !args.includes('--no-git'),
82
+ install: !args.includes('--no-install'), // Default: true (install)
83
+ git: !args.includes('--no-git'), // Default: true (init git)
81
84
  };
82
85
 
83
86
  // Filter out null prompts
@@ -92,22 +95,6 @@ ${pc.bold('Repository:')} https://github.com/12-studio/tackl
92
95
  ? true
93
96
  : 'Use lowercase letters, numbers, - . _',
94
97
  },
95
- {
96
- type: 'toggle',
97
- name: 'install',
98
- message: 'Install dependencies?',
99
- initial: initial.install,
100
- active: 'yes',
101
- inactive: 'no',
102
- },
103
- {
104
- type: 'toggle',
105
- name: 'git',
106
- message: 'Initialize git?',
107
- initial: initial.git,
108
- active: 'yes',
109
- inactive: 'no',
110
- },
111
98
  ].filter(q => q.type !== null);
112
99
 
113
100
  const answers = await prompts(promptQuestions, {
@@ -122,9 +109,9 @@ ${pc.bold('Repository:')} https://github.com/12-studio/tackl
122
109
  });
123
110
 
124
111
  const projectName = (answers.name || initial.name).trim();
125
- const ref = (answers.ref || initial.ref).trim();
126
- const doInstall = answers.install;
127
- const doGit = answers.git;
112
+ const ref = initial.ref; // Always use main branch
113
+ const doInstall = initial.install; // Default: true
114
+ const doGit = initial.git; // Default: true
128
115
 
129
116
  // Validate project name
130
117
  if (!projectName) {
@@ -190,6 +177,15 @@ ${pc.bold('Repository:')} https://github.com/12-studio/tackl
190
177
  fs.rmSync(gitPath, { recursive: true, force: true });
191
178
  } catch {}
192
179
 
180
+ // Remove any existing lock files to ensure npm is used
181
+ try {
182
+ const yarnLock = path.join(targetDir, 'yarn.lock');
183
+ const pnpmLock = path.join(targetDir, 'pnpm-lock.yaml');
184
+ if (fs.existsSync(yarnLock)) fs.unlinkSync(yarnLock);
185
+ if (fs.existsSync(pnpmLock)) fs.unlinkSync(pnpmLock);
186
+ log.step('🧹 Cleaned up lock files to ensure npm usage');
187
+ } catch {}
188
+
193
189
  // Patch package name
194
190
  log.step('📝 Updating project configuration...');
195
191
  const pkg = path.join(targetDir, 'package.json');
@@ -204,6 +200,15 @@ ${pc.bold('Repository:')} https://github.com/12-studio/tackl
204
200
  }
205
201
  }
206
202
 
203
+ // Create .npmrc to ensure npm is used
204
+ try {
205
+ const npmrcPath = path.join(targetDir, '.npmrc');
206
+ fs.writeFileSync(npmrcPath, 'package-lock=true\n');
207
+ log.step('📝 Created .npmrc to ensure npm usage');
208
+ } catch (e) {
209
+ log.warn(`Could not create .npmrc: ${e.message}`);
210
+ }
211
+
207
212
  if (doGit) {
208
213
  try {
209
214
  log.step('🔧 Initializing git repository...');
@@ -241,7 +246,6 @@ ${pc.bold('Repository:')} https://github.com/12-studio/tackl
241
246
  console.log(` ${doInstall ? '2' : '3'}) npm run dev`);
242
247
  }
243
248
 
244
-
245
249
  main().catch(e => {
246
250
  console.error(e);
247
251
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tackl",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "The ultimate Next.js starter kit with Waffl Grid system",
5
5
  "type": "module",
6
6
  "bin": {