frontfire 0.8.0 → 0.8.2
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/package.json +1 -1
- package/src/DefaultConfig.js +0 -9
- package/src/index.js +14 -14
package/package.json
CHANGED
package/src/DefaultConfig.js
CHANGED
|
@@ -48,14 +48,6 @@ for ( let ri = 0; ri < rootFiles.length; ri++ )
|
|
|
48
48
|
|
|
49
49
|
const buildDir = `build`;
|
|
50
50
|
const entryPoints = [
|
|
51
|
-
/*
|
|
52
|
-
"src/app/main.js",
|
|
53
|
-
"src/app/main.css"
|
|
54
|
-
*/
|
|
55
|
-
/*
|
|
56
|
-
path.resolve( './src/app/main.js' ),
|
|
57
|
-
path.resolve( './src/app/main.css' )
|
|
58
|
-
*/
|
|
59
51
|
`./src/app/main.js`,
|
|
60
52
|
`./src/app/main.css`
|
|
61
53
|
];
|
|
@@ -139,7 +131,6 @@ export default {
|
|
|
139
131
|
recursive: true
|
|
140
132
|
})
|
|
141
133
|
]
|
|
142
|
-
|
|
143
134
|
}
|
|
144
135
|
}
|
|
145
136
|
};
|
package/src/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import ejs from "ejs";
|
|
|
6
6
|
import chalk from "chalk";
|
|
7
7
|
import download from "download-git-repo";
|
|
8
8
|
import { promisify } from "util";
|
|
9
|
+
import { exec } from "child_process";
|
|
10
|
+
import pkg from "./../package.json" with { type: "json" };
|
|
9
11
|
|
|
10
12
|
import _ from "lodash";
|
|
11
13
|
import prettier from "prettier";
|
|
@@ -16,7 +18,6 @@ import { stdin as input, stdout as output } from "node:process";
|
|
|
16
18
|
import slugify from "slugify";
|
|
17
19
|
|
|
18
20
|
import frontFire from "./FrontFire.js";
|
|
19
|
-
import defaultConfig from "./DefaultConfig.js";
|
|
20
21
|
|
|
21
22
|
import wcIndex from "./templates/wc-index.js";
|
|
22
23
|
import wcTemplate from "./templates/wc-template.html.js";
|
|
@@ -36,6 +37,8 @@ async function askYesNo(question) {
|
|
|
36
37
|
|
|
37
38
|
async function performInit()
|
|
38
39
|
{
|
|
40
|
+
const { default: defaultConfig } = await import("./DefaultConfig.js" );
|
|
41
|
+
|
|
39
42
|
// Deep Copy
|
|
40
43
|
const initConfig = JSON.parse( JSON.stringify( defaultConfig ) );
|
|
41
44
|
|
|
@@ -67,7 +70,6 @@ async function createInfrontJsStarter( appName, appPath )
|
|
|
67
70
|
async function downloadRepo(repo, targetDir) {
|
|
68
71
|
try {
|
|
69
72
|
await downloadAsync(repo, targetDir, { clone: false });
|
|
70
|
-
console.log(`✅ Repo erfolgreich geladen nach ${targetDir}`);
|
|
71
73
|
} catch (err) {
|
|
72
74
|
console.error("❌ Fehler beim Laden des Repos:", err);
|
|
73
75
|
}
|
|
@@ -86,7 +88,6 @@ async function createInfrontJsStarter( appName, appPath )
|
|
|
86
88
|
pkg.name = newName;
|
|
87
89
|
|
|
88
90
|
await writeFile(fullPath, JSON.stringify(pkg, null, 2) + "\n", "utf-8");
|
|
89
|
-
console.log(`✅ Updated package.json name to "${newName}"`);
|
|
90
91
|
} else {
|
|
91
92
|
console.log(`ℹ️ package.json name is not "infrontjs-starter" (found "${pkg.name}"), no change made.`);
|
|
92
93
|
}
|
|
@@ -96,17 +97,22 @@ async function createInfrontJsStarter( appName, appPath )
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
// Deep Copy
|
|
101
|
+
/*
|
|
100
102
|
const initConfig = JSON.parse( JSON.stringify( defaultConfig ) );
|
|
101
103
|
|
|
102
104
|
_.unset( initConfig, 'debug.esbuild.plugins' );
|
|
103
105
|
_.unset( initConfig, 'release.esbuild.plugins' );
|
|
106
|
+
*/
|
|
104
107
|
|
|
105
108
|
await downloadRepo("github:infrontjs/starter", appPath );
|
|
106
109
|
await updatePackageName( appName, `${appPath}/package.json` );
|
|
107
110
|
await unlink( `${appPath}/LICENSE` );
|
|
108
111
|
|
|
109
|
-
|
|
112
|
+
const execAsync = promisify(exec);
|
|
113
|
+
await execAsync( "frontfire init", { cwd: appPath } );
|
|
114
|
+
|
|
115
|
+
//await writeFile( `${appPath}/frontfire.json`, JSON.stringify(initConfig, null, 2) + "\n", "utf8");
|
|
110
116
|
|
|
111
117
|
console.log(chalk.green.bold(`\nInfrontJS project "${appName}" successfully created at ${appPath}\n`));
|
|
112
118
|
|
|
@@ -186,15 +192,9 @@ async function generatesWebComponent( name = null )
|
|
|
186
192
|
let className = null;
|
|
187
193
|
let wcName = null;
|
|
188
194
|
|
|
189
|
-
// Deep Copy
|
|
190
|
-
const initConfig = JSON.parse( JSON.stringify( defaultConfig ) );
|
|
191
|
-
|
|
192
|
-
_.unset( initConfig, 'debug.esbuild.plugins' );
|
|
193
|
-
_.unset( initConfig, 'release.esbuild.plugins' );
|
|
194
|
-
|
|
195
195
|
if ( null === name || name.length === 0 )
|
|
196
196
|
{
|
|
197
|
-
console.error( '
|
|
197
|
+
console.error( 'Empty web component name.')
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
fileName = name.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
|
|
@@ -363,7 +363,7 @@ program
|
|
|
363
363
|
const finalName = appName ?? "InfrontJS Starter";
|
|
364
364
|
if ( !appPath )
|
|
365
365
|
{
|
|
366
|
-
appPath =
|
|
366
|
+
appPath = process.cwd();
|
|
367
367
|
appPath = path.join( appPath, slugify( finalName, { lower: true , strict: true } ) );
|
|
368
368
|
}
|
|
369
369
|
|
|
@@ -424,7 +424,7 @@ program
|
|
|
424
424
|
program
|
|
425
425
|
.command( 'version' )
|
|
426
426
|
.description( 'Prints the version number.' )
|
|
427
|
-
.action( function() { console.log(
|
|
427
|
+
.action( function() { console.log( pkg.version ); } );
|
|
428
428
|
|
|
429
429
|
|
|
430
430
|
program.parse();
|