Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance README #120

Merged
merged 3 commits into from
Jan 29, 2024
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
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# Starter
# Comet DXP Starter

# Development
In use by `@comet/create-app` to create new Comet DXP projects. Find more information in the [Comet DXP documentation](https://docs.comet-dxp.com).

## Requirements
<!-- PROJECT_README_BEGIN Everything below this line will go into the Readme of projects created by @comet/create-app -->

## Development

### Requirements

- [nvm](https://github.com/nvm-sh/nvm)
- [docker & docker-compose](https://docs.docker.com/compose/)

## Installation
### Installation

// Optionally set domain to use instead of localhost (add to ~/.bashrc)
export DEV_DOMAIN=myname.dev.vivid-planet.cloud // Vivid Planet network

// Execute following script
./install.sh

## Uninstallation
### Uninstallation

// Removes docker volumes and all files and folder which are not managed in the repo (node_modules, lib,...)
// If you want to reset your development environment totally, run this command and ./install.sh afterwards.

./uninstall.sh

## Run Services
### Run Services

// use correct npm version https://github.com/nvm-sh/nvm#deeper-shell-integration
nvm use
Expand Down
9 changes: 9 additions & 0 deletions create-app/src/scripts/create-app/cleanupReadme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as fs from "fs";

const readmePath = "README.md";

export function cleanupReadme() {
const originalReadme = fs.readFileSync(readmePath, "utf8").toString();
const newReadme = originalReadme.replace(/.+<!-- PROJECT_README_BEGIN.+-->\n\n/s, "");
fs.writeFileSync(readmePath, newReadme, "utf8");
}
2 changes: 2 additions & 0 deletions create-app/src/scripts/create-app/createApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import kleur from "kleur";
import process from "process";

import { replacePlaceholder } from "../../util/replacePlaceholder";
import { cleanupReadme } from "./cleanupReadme";
import { cleanupWorkingDirectory } from "./cleanupWorkingDirectory";
import { createInitialGitCommit } from "./createInitialGitCommit";
import { createWorkingDirectoryCopy } from "./createWorkingDirectoryCopy";
Expand All @@ -16,6 +17,7 @@ export async function createApp(projectConfiguration: ProjectConfiguration) {
if (!createWorkingDirectoryCopy(projectConfiguration.projectName, projectConfiguration.verbose)) {
return;
}
cleanupReadme();
cleanupWorkingDirectory(projectConfiguration.verbose);
replacePlaceholder(projectConfiguration.projectName, projectConfiguration.verbose);
createInitialGitCommit();
Expand Down
Loading