@outwalk/create-firefly 0.14.2 → 0.14.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.
package/README.md CHANGED
@@ -19,13 +19,15 @@ npm create @outwalk/firefly@latest
19
19
  You can also specify settings via command line options.
20
20
 
21
21
  ```
22
- npm create @outwalk/firefly@latest my-app --language typescript
22
+ npm create @outwalk/firefly@latest my-app -- --language typescript
23
23
  ```
24
24
 
25
25
  ### Command Line Options.
26
26
 
27
27
  The first argument passed to the command will be used as the project name/directory, Other settings can be configured using the following command line options:
28
28
 
29
+ NOTE: Command line options are only applied if used after an additional `--` marker.
30
+
29
31
  ```
30
32
  # Specify the language
31
33
  -l, --language
package/dist/index.js CHANGED
@@ -5,6 +5,8 @@ import path from 'node:path';
5
5
  import fs from 'node:fs';
6
6
  import chalk from 'chalk';
7
7
  import { exec, spawnSync } from 'node:child_process';
8
+ import path$1 from 'path';
9
+ import url from 'url';
8
10
 
9
11
  const firefly = chalk.hex("#ADFF2F");
10
12
  const logger = {
@@ -113,6 +115,15 @@ function intitializeGitRepository(directory) {
113
115
  });
114
116
  }
115
117
 
118
+ const Module = {
119
+ __filename: (fileUrl) => {
120
+ return import.meta.url ? url.fileURLToPath(fileUrl) : __filename;
121
+ },
122
+ __dirname: (fileUrl) => {
123
+ return import.meta.url ? path$1.dirname(Module.__filename(fileUrl)) : __dirname;
124
+ }
125
+ };
126
+
116
127
  const args = yargs(process.argv.slice(2));
117
128
  prompts.override({
118
129
  name: args._[0],
@@ -181,8 +192,8 @@ const questions = [
181
192
  }
182
193
  console.log("\n");
183
194
  logger.log(`creating ${config.name}...`);
184
- const templatePath = path.join(__dirname, "../templates/", config.language);
185
- const snippetPath = path.join(__dirname, "../templates/snippets");
195
+ const templatePath = path.join(Module.__dirname(import.meta.url), "../templates/", config.language);
196
+ const snippetPath = path.join(Module.__dirname(import.meta.url), "../templates/snippets");
186
197
  const projectPath = !settings.useCurrentDirectory ? config.name : ".";
187
198
  try {
188
199
  const template = new TemplateBuilder(templatePath, projectPath);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@outwalk/create-firefly",
3
3
  "type": "module",
4
- "version": "0.14.2",
4
+ "version": "0.14.3",
5
5
  "description": "Firefly - a modern scalable web framework.",
6
6
  "publishConfig": {
7
7
  "access": "public"