diff --git a/cookiecutter.yaml b/cookiecutter.yaml new file mode 100644 index 0000000..0b8fbdf --- /dev/null +++ b/cookiecutter.yaml @@ -0,0 +1,10 @@ +default_context: + project_name: "demo" + project_slug: "demo" + project_generated_name: "demo" + owner_email: "demo@crowdbotics.com" + custom_domain: "demo.botics.co" + repo_url: "https://github.com/crowdbotics/modules" + heroku_dyno_size: "free" + heroku_team: "" + is_mobile: "y" diff --git a/dist/cookie/{{cookiecutter.project_slug}}/.crowdbotics.json b/dist/cookie/{{cookiecutter.project_slug}}/.crowdbotics.json index 67d096c..ea747bf 100644 --- a/dist/cookie/{{cookiecutter.project_slug}}/.crowdbotics.json +++ b/dist/cookie/{{cookiecutter.project_slug}}/.crowdbotics.json @@ -1,7 +1,7 @@ { "scaffold": { "type": "react-native", - "version": "2.7.0", + "version": "2.7.1", "cookiecutter_context": { "project_name": "{{cookiecutter.project_name}}", "project_slug": "{{cookiecutter.project_slug}}", diff --git a/dist/cookie/{{cookiecutter.project_slug}}/Dockerfile b/dist/cookie/{{cookiecutter.project_slug}}/Dockerfile index 6c04ff3..1efc6e2 100644 --- a/dist/cookie/{{cookiecutter.project_slug}}/Dockerfile +++ b/dist/cookie/{{cookiecutter.project_slug}}/Dockerfile @@ -1,4 +1,4 @@ -FROM crowdbotics/cb-django:3.8-slim-buster AS build +FROM crowdbotics/cb-django:3.9-slim-buster AS build # Copy dependency management files and install app packages to /.venv COPY backend/Pipfile backend/Pipfile.lock / @@ -11,7 +11,7 @@ COPY . . RUN yarn install && yarn run web:build -FROM crowdbotics/cb-django:3.8-slim-buster AS release +FROM crowdbotics/cb-django:3.9-slim-buster AS release ARG SECRET_KEY # Set Working directory diff --git a/dist/react-native-demo.zip b/dist/react-native-demo.zip new file mode 100644 index 0000000..a6235b7 Binary files /dev/null and b/dist/react-native-demo.zip differ diff --git a/package.json b/package.json index 96c537c..aff419a 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "scripts": { "semver": "node scripts/semver.js", "cookie": "node scripts/cookie.js", + "demo": "node scripts/demo.js", "raw": "node scripts/raw.js", "template": "node scripts/template.js", "bootstrap": "npm run raw; npm run cookie", diff --git a/scaffold/template/custom/.crowdbotics.json b/scaffold/template/custom/.crowdbotics.json index 67d096c..ea747bf 100644 --- a/scaffold/template/custom/.crowdbotics.json +++ b/scaffold/template/custom/.crowdbotics.json @@ -1,7 +1,7 @@ { "scaffold": { "type": "react-native", - "version": "2.7.0", + "version": "2.7.1", "cookiecutter_context": { "project_name": "{{cookiecutter.project_name}}", "project_slug": "{{cookiecutter.project_slug}}", diff --git a/scaffold/template/custom/Dockerfile b/scaffold/template/custom/Dockerfile index 6c04ff3..1efc6e2 100644 --- a/scaffold/template/custom/Dockerfile +++ b/scaffold/template/custom/Dockerfile @@ -1,4 +1,4 @@ -FROM crowdbotics/cb-django:3.8-slim-buster AS build +FROM crowdbotics/cb-django:3.9-slim-buster AS build # Copy dependency management files and install app packages to /.venv COPY backend/Pipfile backend/Pipfile.lock / @@ -11,7 +11,7 @@ COPY . . RUN yarn install && yarn run web:build -FROM crowdbotics/cb-django:3.8-slim-buster AS release +FROM crowdbotics/cb-django:3.9-slim-buster AS release ARG SECRET_KEY # Set Working directory diff --git a/scripts/demo.js b/scripts/demo.js new file mode 100644 index 0000000..04e2f38 --- /dev/null +++ b/scripts/demo.js @@ -0,0 +1,33 @@ +import path from "path"; +import { execSync } from "child_process"; +import fs from "fs"; + +const demoPath = path.join(process.cwd(), "demo"); + +const options = { + encoding: "utf8", + stdio: "inherit", + cwd: path.dirname(demoPath) +}; +const yaml = path.join(process.cwd(), "cookiecutter.yaml"); + +function removeDir(dir) { + if (fs.existsSync(dir)) { + fs.rmSync(dir, { recursive: true }); + } +} + +removeDir(demoPath); + +const rnCookieCutterCommand = [ + "pipenv run cookiecutter", + "./dist/cookie", + `--config-file ${yaml}`, + "--no-input" +].join(" "); + +execSync(rnCookieCutterCommand, options); + +execSync(`cd ${demoPath} && zip -r ../dist/react-native-demo.zip .`, options); + +removeDir(demoPath);