frontfire 0.8.0 → 0.8.1
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 -13
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";
|
|
@@ -36,6 +38,8 @@ async function askYesNo(question) {
|
|
|
36
38
|
|
|
37
39
|
async function performInit()
|
|
38
40
|
{
|
|
41
|
+
const { default: defaultConfig } = await import("./DefaultConfig.js" );
|
|
42
|
+
|
|
39
43
|
// Deep Copy
|
|
40
44
|
const initConfig = JSON.parse( JSON.stringify( defaultConfig ) );
|
|
41
45
|
|
|
@@ -67,7 +71,6 @@ async function createInfrontJsStarter( appName, appPath )
|
|
|
67
71
|
async function downloadRepo(repo, targetDir) {
|
|
68
72
|
try {
|
|
69
73
|
await downloadAsync(repo, targetDir, { clone: false });
|
|
70
|
-
console.log(`✅ Repo erfolgreich geladen nach ${targetDir}`);
|
|
71
74
|
} catch (err) {
|
|
72
75
|
console.error("❌ Fehler beim Laden des Repos:", err);
|
|
73
76
|
}
|
|
@@ -86,7 +89,6 @@ async function createInfrontJsStarter( appName, appPath )
|
|
|
86
89
|
pkg.name = newName;
|
|
87
90
|
|
|
88
91
|
await writeFile(fullPath, JSON.stringify(pkg, null, 2) + "\n", "utf-8");
|
|
89
|
-
console.log(`✅ Updated package.json name to "${newName}"`);
|
|
90
92
|
} else {
|
|
91
93
|
console.log(`ℹ️ package.json name is not "infrontjs-starter" (found "${pkg.name}"), no change made.`);
|
|
92
94
|
}
|
|
@@ -96,17 +98,22 @@ async function createInfrontJsStarter( appName, appPath )
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
|
|
99
|
-
|
|
101
|
+
// Deep Copy
|
|
102
|
+
/*
|
|
100
103
|
const initConfig = JSON.parse( JSON.stringify( defaultConfig ) );
|
|
101
104
|
|
|
102
105
|
_.unset( initConfig, 'debug.esbuild.plugins' );
|
|
103
106
|
_.unset( initConfig, 'release.esbuild.plugins' );
|
|
107
|
+
*/
|
|
104
108
|
|
|
105
109
|
await downloadRepo("github:infrontjs/starter", appPath );
|
|
106
110
|
await updatePackageName( appName, `${appPath}/package.json` );
|
|
107
111
|
await unlink( `${appPath}/LICENSE` );
|
|
108
112
|
|
|
109
|
-
|
|
113
|
+
const execAsync = promisify(exec);
|
|
114
|
+
await execAsync( "frontfire init", { cwd: appPath } );
|
|
115
|
+
|
|
116
|
+
//await writeFile( `${appPath}/frontfire.json`, JSON.stringify(initConfig, null, 2) + "\n", "utf8");
|
|
110
117
|
|
|
111
118
|
console.log(chalk.green.bold(`\nInfrontJS project "${appName}" successfully created at ${appPath}\n`));
|
|
112
119
|
|
|
@@ -186,15 +193,9 @@ async function generatesWebComponent( name = null )
|
|
|
186
193
|
let className = null;
|
|
187
194
|
let wcName = null;
|
|
188
195
|
|
|
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
196
|
if ( null === name || name.length === 0 )
|
|
196
197
|
{
|
|
197
|
-
console.error( '
|
|
198
|
+
console.error( 'Empty web component name.')
|
|
198
199
|
}
|
|
199
200
|
|
|
200
201
|
fileName = name.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
|
|
@@ -363,7 +364,7 @@ program
|
|
|
363
364
|
const finalName = appName ?? "InfrontJS Starter";
|
|
364
365
|
if ( !appPath )
|
|
365
366
|
{
|
|
366
|
-
appPath =
|
|
367
|
+
appPath = process.cwd();
|
|
367
368
|
appPath = path.join( appPath, slugify( finalName, { lower: true , strict: true } ) );
|
|
368
369
|
}
|
|
369
370
|
|
|
@@ -424,7 +425,7 @@ program
|
|
|
424
425
|
program
|
|
425
426
|
.command( 'version' )
|
|
426
427
|
.description( 'Prints the version number.' )
|
|
427
|
-
.action( function() { console.log(
|
|
428
|
+
.action( function() { console.log( pkg.version ); } );
|
|
428
429
|
|
|
429
430
|
|
|
430
431
|
program.parse();
|