@idealyst/cli 1.0.2 → 1.0.3

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/dist/index.js +13 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { Command } from 'commander';
3
3
  import chalk from 'chalk';
4
4
  import path from 'path';
5
+ import { fileURLToPath } from 'url';
5
6
  import fs from 'fs-extra';
6
7
  import { spawn } from 'child_process';
7
8
  import ora from 'ora';
@@ -107,6 +108,8 @@ function getTemplateData(projectName, description) {
107
108
  };
108
109
  }
109
110
 
111
+ const __filename$3 = fileURLToPath(import.meta.url);
112
+ const __dirname$3 = path.dirname(__filename$3);
110
113
  async function generateNativeProject(options) {
111
114
  const { name, directory, skipInstall } = options;
112
115
  if (!validateProjectName(name)) {
@@ -114,7 +117,7 @@ async function generateNativeProject(options) {
114
117
  }
115
118
  console.log(chalk.blue(`📱 Creating React Native project: ${name}`));
116
119
  const projectPath = path.join(directory, name);
117
- const templatePath = path.join(__dirname, '..', '..', 'templates', 'native');
120
+ const templatePath = path.join(__dirname$3, '..', 'templates', 'native');
118
121
  const templateData = getTemplateData(name, `React Native app built with Idealyst Framework`);
119
122
  await copyTemplate(templatePath, projectPath, templateData);
120
123
  await installDependencies(projectPath, skipInstall);
@@ -129,6 +132,8 @@ async function generateNativeProject(options) {
129
132
  console.log(chalk.white(' • Babel configuration'));
130
133
  }
131
134
 
135
+ const __filename$2 = fileURLToPath(import.meta.url);
136
+ const __dirname$2 = path.dirname(__filename$2);
132
137
  async function generateWebProject(options) {
133
138
  const { name, directory, skipInstall } = options;
134
139
  if (!validateProjectName(name)) {
@@ -136,7 +141,7 @@ async function generateWebProject(options) {
136
141
  }
137
142
  console.log(chalk.blue(`🌐 Creating React Web project: ${name}`));
138
143
  const projectPath = path.join(directory, name);
139
- const templatePath = path.join(__dirname, '..', '..', 'templates', 'web');
144
+ const templatePath = path.join(__dirname$2, '..', 'templates', 'web');
140
145
  const templateData = getTemplateData(name, `React web app built with Idealyst Framework`);
141
146
  await copyTemplate(templatePath, projectPath, templateData);
142
147
  await installDependencies(projectPath, skipInstall);
@@ -151,6 +156,8 @@ async function generateWebProject(options) {
151
156
  console.log(chalk.white(' • React Router'));
152
157
  }
153
158
 
159
+ const __filename$1 = fileURLToPath(import.meta.url);
160
+ const __dirname$1 = path.dirname(__filename$1);
154
161
  async function generateSharedLibrary(options) {
155
162
  const { name, directory, skipInstall } = options;
156
163
  if (!validateProjectName(name)) {
@@ -158,7 +165,7 @@ async function generateSharedLibrary(options) {
158
165
  }
159
166
  console.log(chalk.blue(`📦 Creating shared library: ${name}`));
160
167
  const projectPath = path.join(directory, name);
161
- const templatePath = path.join(__dirname, '..', '..', 'templates', 'shared');
168
+ const templatePath = path.join(__dirname$1, '..', 'templates', 'shared');
162
169
  const templateData = getTemplateData(name, `Shared library built with Idealyst Framework`);
163
170
  await copyTemplate(templatePath, projectPath, templateData);
164
171
  await installDependencies(projectPath, skipInstall);
@@ -171,6 +178,8 @@ async function generateSharedLibrary(options) {
171
178
  console.log(chalk.white(' • React & React Native support'));
172
179
  }
173
180
 
181
+ const __filename = fileURLToPath(import.meta.url);
182
+ const __dirname = path.dirname(__filename);
174
183
  async function generateWorkspace(options) {
175
184
  const { name, directory, skipInstall } = options;
176
185
  if (!validateProjectName(name)) {
@@ -178,7 +187,7 @@ async function generateWorkspace(options) {
178
187
  }
179
188
  console.log(chalk.blue(`🏗️ Creating Idealyst workspace: ${name}`));
180
189
  const projectPath = path.join(directory, name);
181
- const templatePath = path.join(__dirname, '..', '..', 'templates', 'workspace');
190
+ const templatePath = path.join(__dirname, '..', 'templates', 'workspace');
182
191
  const templateData = getTemplateData(name, `Idealyst Framework monorepo workspace`);
183
192
  await copyTemplate(templatePath, projectPath, templateData);
184
193
  await installDependencies(projectPath, skipInstall);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "CLI tool for generating Idealyst Framework projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",