@solidstarters/create-solid-app 1.2.33 → 1.2.35
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/index.js
CHANGED
|
@@ -30,7 +30,7 @@ async function main() {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// Step 2: Setup the sub projects from the templates
|
|
33
|
-
console.log(prettyOutput('
|
|
33
|
+
console.log(prettyOutput('\nStep 1','Setting up boilerplate for the backend'));
|
|
34
34
|
const templatesPath = getSourceFolderPath('templates');
|
|
35
35
|
await copyTemplate(templatesPath, targetPath, EXCLUDED_DIRS_FOR_INITIAL_COPY);
|
|
36
36
|
|
|
@@ -59,22 +59,27 @@ async function main() {
|
|
|
59
59
|
console.log(chalk.green(`Project ${chalk.cyan(projectName)} created successfully!`));
|
|
60
60
|
console.log(chalk.cyan(`\nEnsure the database is created and connection is established correctly.`));
|
|
61
61
|
console.log(chalk.cyan(`\nNext steps:`));
|
|
62
|
-
console.log(chalk.cyan(
|
|
63
|
-
console.log(prettyOutput(
|
|
64
|
-
console.log(prettyOutput('
|
|
62
|
+
console.log(chalk.cyan(`\nRun the api:`));
|
|
63
|
+
console.log(prettyOutput(`cd ${projectName}/${TARGET_FOLDER_API}`,'Navigate into api directory'));
|
|
64
|
+
console.log(prettyOutput('solid seed','This will seed the database with the required metadata'));
|
|
65
65
|
|
|
66
66
|
// Development mode (with watch )
|
|
67
|
-
console.log(prettyOutput('
|
|
67
|
+
console.log(prettyOutput('npm run solidx:dev', `Starts the backend in development mode with live reload on @http://localhost:${answers.solidApiPort}`));
|
|
68
68
|
|
|
69
69
|
// Production mode
|
|
70
|
-
console.log(prettyOutput('
|
|
70
|
+
console.log(prettyOutput('npm run build && npm run start', `Builds and starts the backend in production mode on @http://localhost:${answers.solidApiPort}`));
|
|
71
71
|
|
|
72
|
-
console.log(
|
|
72
|
+
console.log(chalk.cyan(`Api documentation is available on @http://localhost:${answers.solidApiPort}/docs`));
|
|
73
73
|
|
|
74
|
-
// console.log(prettyOutput('
|
|
74
|
+
// console.log(prettyOutput('npm run start',`This will start the backend server @http://localhost:${answers.solidApiPort}`));
|
|
75
75
|
console.log(chalk.cyan(`\nRun the frontend:`));
|
|
76
|
-
console.log(prettyOutput(
|
|
77
|
-
|
|
76
|
+
console.log(prettyOutput(`cd ${projectName}/${TARGET_FOLDER_UI}`,'Navigate into ui directory'));
|
|
77
|
+
|
|
78
|
+
// Development mode (with watch )
|
|
79
|
+
console.log(prettyOutput('npm run dev',`Starts the frontend in development mode with live reload on @http://localhost:${answers.solidUiPort}`));
|
|
80
|
+
|
|
81
|
+
// Production mode
|
|
82
|
+
console.log(prettyOutput('npm run build && npm run start', `Builds and starts the frontend in production mode on @http://localhost:${answers.solidUiPort}`));
|
|
78
83
|
}
|
|
79
84
|
catch (err) {
|
|
80
85
|
console.error('Error:', err);
|
package/package.json
CHANGED
package/upgrade-local.sh
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
# Ensure required environment variables are set
|
|
6
|
+
if [[ -z "$SOLID_CORE_MODULE_PATH" || -z "$SOLID_UI_PATH" ]]; then
|
|
7
|
+
echo "Error: SOLID_CORE_MODULE_PATH and SOLID_UI_PATH environment variables must be set."
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
pack_and_install() {
|
|
12
|
+
local PACKAGE_PATH=$1
|
|
13
|
+
local INSTALL_PATH=$2
|
|
14
|
+
|
|
15
|
+
# 🔥 Delete old .tgz files before packing
|
|
16
|
+
rm -f *.tgz
|
|
17
|
+
|
|
18
|
+
echo "Packing $PACKAGE_PATH"
|
|
19
|
+
pushd "$PACKAGE_PATH" > /dev/null || exit 1
|
|
20
|
+
npm pack
|
|
21
|
+
local PACKAGE_TGZ=$(ls *.tgz | tail -n 1)
|
|
22
|
+
popd > /dev/null || exit 1
|
|
23
|
+
|
|
24
|
+
echo "Installing $PACKAGE_TGZ into $INSTALL_PATH"
|
|
25
|
+
pushd "$INSTALL_PATH" > /dev/null || exit 1
|
|
26
|
+
npm i "$PACKAGE_PATH/$PACKAGE_TGZ"
|
|
27
|
+
popd > /dev/null || exit 1
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# Handle arguments
|
|
31
|
+
build_core=false
|
|
32
|
+
build_ui=false
|
|
33
|
+
skip_seed=false
|
|
34
|
+
|
|
35
|
+
while [[ "$#" -gt 0 ]]; do
|
|
36
|
+
case "$1" in
|
|
37
|
+
--core) build_core=true ;;
|
|
38
|
+
--ui) build_ui=true ;;
|
|
39
|
+
--skip-seed) skip_seed=true ;;
|
|
40
|
+
*) echo "Unknown option: $1"; exit 1 ;;
|
|
41
|
+
esac
|
|
42
|
+
shift
|
|
43
|
+
done
|
|
44
|
+
|
|
45
|
+
# Default behavior: build both if no args given
|
|
46
|
+
if [[ $build_core == false && $build_ui == false ]]; then
|
|
47
|
+
build_core=true
|
|
48
|
+
build_ui=true
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
if [[ $build_core == true ]]; then
|
|
52
|
+
echo "=== Building & installing solid-core-module into solid-api ==="
|
|
53
|
+
pack_and_install "$SOLID_CORE_MODULE_PATH" "./solid-api"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
if [[ $build_ui == true ]]; then
|
|
57
|
+
echo "=== Building & installing solid-ui into solid-ui ==="
|
|
58
|
+
pack_and_install "$SOLID_UI_PATH" "./solid-ui"
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
echo "✅ Done, upgrading from local dependencies."
|
|
62
|
+
if [[ $build_core == true ]]; then
|
|
63
|
+
if [[ $skip_seed == false ]]; then
|
|
64
|
+
cd ./solid-api
|
|
65
|
+
./rebuild.sh
|
|
66
|
+
solid seed
|
|
67
|
+
echo "✅ Solid seed completed."
|
|
68
|
+
fi
|
|
69
|
+
fi
|