mirror of
https://github.com/chenasraf/dotfiles.git
synced 2026-05-17 17:28:07 +00:00
update nextjs tpl
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -2,5 +2,6 @@
|
||||
"cSpell.words": [
|
||||
"dotfiles"
|
||||
],
|
||||
"python.linting.enabled": true
|
||||
"python.linting.enabled": true,
|
||||
"i18next.i18nPaths": "/Users/chen/.dotfiles/scaffolds/nextjs/public/locales"
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"body": [
|
||||
"export async function getStaticProps({ locale }: NextPageContext) {",
|
||||
" return {",
|
||||
" props: await getI18nProps(locale ?? 'he', ['${1:{{ hyphenCase name }}}']),",
|
||||
" props: await getI18nProps(locale ?? 'he', ['${1:{{ hyphenCase name }} }']),",
|
||||
" }",
|
||||
"}",
|
||||
],
|
||||
|
||||
@@ -5,7 +5,12 @@ tpl() {
|
||||
|
||||
case $tpl_name in
|
||||
nextjs | cra)
|
||||
app_name="$1"
|
||||
shift
|
||||
tpl_data=""
|
||||
mkdir $app_name
|
||||
cd $app_name
|
||||
echo "Creating '$tpl_name' app in directory: '$(pwd)'"
|
||||
case $tpl_name in
|
||||
nextjs)
|
||||
tpl_data='{"nextComponents":true}'
|
||||
@@ -19,8 +24,8 @@ tpl() {
|
||||
yes | rm -rf ./src/
|
||||
;;
|
||||
esac
|
||||
npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/$tpl_name" -w 1 -o . -d $tpl_data $@
|
||||
npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/react-app-common" -w 1 -o $src_dir -d $tpl_data $@
|
||||
npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/$tpl_name" -w 1 -o . -d $tpl_data $app_name
|
||||
npx -y simple-scaffold@latest -t "$SCAFFOLDS_DIR/react-app-common" -w 1 -o $src_dir -d $tpl_data $app_name
|
||||
echo_gray "Merging package.json..."
|
||||
jq 'reduce inputs as $s (.; .*$s)' ./package.json $SCAFFOLDS_DIR/_merge/$tpl_name/package.json >./package.json.tmp
|
||||
mv -f ./package.json.tmp ./package.json && rm -f ./package.json.tmp
|
||||
|
||||
Reference in New Issue
Block a user