Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

Based on [Common Changelog](https://common-changelog.org/).

## 3.0.2 - 2024-04-17

### Fixed

Fixed issues with `cookiecutter` commands not the finding `cookiecutter.yaml` file.

The file got removed and the configuration is now instead injected directly in the command arguments. The `demo` command should now be much more reliable across all combinations of operating system/package manager of choice.

## 3.0.1 - 2024-03-27

### Changed

The repository has moved from [crowdbotics/modules](https://github.com/crowdbotics/modules) to [crowdbotics/cli](https://github.com/crowdbotics/cli).

## 3.0.0-canary - 2024-03-21

_The project has been published to npm under the name ["crowdbotics"](https://www.npmjs.com/package/crowdbotics)._

### Changed

You can now install it directly:
```
npm install -g crowdbotics
```

And run it with the `cb` binary:
```
cb help
```

## 2.4.0 - 2023-12-21

### Added
Expand Down
10 changes: 0 additions & 10 deletions cookiecutter.yaml

This file was deleted.

18 changes: 1 addition & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ import { EVENT } from "./scripts/analytics/constants.js";
import { askOptIn } from "./scripts/analytics/scripts.js";
import { sentryMonitoring } from "./scripts/utils/sentry.js";

const pkg = JSON.parse(
fs.readFileSync(new URL("package.json", import.meta.url), "utf8")
);

let sourceDir = path.dirname(path.dirname(process.argv[1]));
if (fs.existsSync(path.join(sourceDir, pkg.name))) {
// npx lib directory
sourceDir = path.join(sourceDir, pkg.name);
} else {
// npm lib directory
sourceDir = path.join(sourceDir, "lib", "node_modules", pkg.name);
}

const gitRoot = () => {
try {
return path.dirname(findGitRoot(process.cwd()));
Expand Down Expand Up @@ -116,10 +103,7 @@ const commands = {
EnvironmentDependency.Python,
EnvironmentDependency.PipEnv
]);
createDemo(
path.join(gitRoot(), "demo"),
path.join(sourceDir, "cookiecutter.yaml")
);
createDemo(path.join(gitRoot(), "demo"));
valid("demo app successfully generated");
},
parse: () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crowdbotics",
"version": "3.0.1",
"version": "3.0.2",
"description": "A powerful command-line tool designed to streamline the management of your Crowdbotics applications",
"main": "index.js",
"license": "MIT",
Expand Down
25 changes: 20 additions & 5 deletions scripts/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,22 @@ import { section, generateCommand } from "../utils.js";
import { execSync } from "child_process";
import { configurePython, execOptions } from "./utils/environment.js";

export function createDemo(dir, yaml) {
const config = {
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",
is_mobile: "y"
};

const extraContext = Object.entries(config)
.map((cur) => `${cur[0]}=${cur[1]}`)
.join(" ");

export function createDemo(dir) {
const options = Object.assign(execOptions, {
cwd: path.dirname(dir)
});
Expand All @@ -25,8 +40,8 @@ export function createDemo(dir, yaml) {
"gh:crowdbotics/react-native-scaffold",
"--directory dist/cookie",
"--checkout master",
`--config-file ${yaml}`,
"--no-input"
"--no-input",
extraContext
]);
execSync(rnCookieCutterCommand, options);

Expand All @@ -42,9 +57,9 @@ export function createDemo(dir, yaml) {
"pipenv run cookiecutter",
"gh:crowdbotics/django-scaffold",
"--checkout master",
`--config-file ${yaml}`,
`--output-dir ${path.basename(dir)}`,
"--no-input"
"--no-input",
extraContext
]);
execSync(djangoCookieCutterCommand, options);
fse.moveSync(path.join(dir, path.basename(dir)), path.join(dir, "backend"));
Expand Down