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

[Chore] Rework temp config formatting #1787

Merged
merged 5 commits into from
Apr 30, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Our versioning strategy is as follows:

## Unreleased

### 🐛 Bug Fixes

* `[templates/nextjs]` `[templates/react]` `[templates/vue]` `[templates/angular]` Changed formatting in temp/config to prevent parse issues in Unix systems ([#1787](https://github.com/Sitecore/jss/pull/1787))
art-alexeyenko marked this conversation as resolved.
Show resolved Hide resolved

## 22.0.0

### 🛠 Breaking Changes
Expand Down
41 changes: 41 additions & 0 deletions docs/upgrades/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
## Unreleased

# react
art-alexeyenko marked this conversation as resolved.
Show resolved Hide resolved

* Replace `scripts/generate-config.js` if you have not modified it. Otherwise:
* Replace comma before a newline (`,`) with semicolon (`;`) in configText prop assignment so it would look like this:

```
configText += `config.${prop} = process.env.REACT_APP_${constantCase(prop)} || "${
config[prop]
}";\n`;
```

# angular

* Replace `scripts/generate-config.ts` if you have not modified it. Otherwise:
* Replace comma before a newline (`,`) with semicolon (`;`) in configText prop assignment so it would look like this:

```
configText += `config.${prop} = process.env.${constantCase(prop)} || "${config[prop]}";\n`;
```


# vue

* Replace `scripts/generate-config.js` if you have not modified it. Otherwise:
* Replace comma before a newline (`,`) with semicolon (`;`) in configText prop assignment so it would look like this:

```
configText += `config.${prop} = process.env.VUE_APP_${constantCase(prop)} || "${
config[prop]
}";\n`;
```

# nextjs

* Replace `scripts/generate-config.ts` if you have not modified it. Otherwise:
* Replace comma before a newline (`,`) with semicolon (`;`) in configText prop assignment so it would look like this:

```
configText += `config.${prop} = process.env.${constantCase(prop)} || '${config[prop]}';\n`;
```
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const config = {};\n`;

// Set base configuration values, allowing override with environment variables
Object.keys(config).forEach((prop) => {
configText += `config.${prop} = process.env.${constantCase(prop)} || "${config[prop]}",\n`;
configText += `config.${prop} = process.env.${constantCase(prop)} || "${config[prop]}";\n`;
});
// Set computed values, allowing override with environment variables
Object.keys(computedConfig).forEach((prop) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const config = {};\n`;

// Set configuration values, allowing override with environment variables
Object.keys(config).forEach(prop => {
configText += `config.${prop} = process.env.${constantCase(prop)} || '${config[prop]}',\n`;
configText += `config.${prop} = process.env.${constantCase(prop)} || '${config[prop]}';\n`;
});

configText += `module.exports = config;`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const config = {};\n`;
Object.keys(config).forEach(prop => {
configText += `config.${prop} = process.env.REACT_APP_${constantCase(prop)} || "${
config[prop]
}",\n`;
}";\n`;
});
configText += 'module.exports = config;';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const config = {};\n`;
Object.keys(config).forEach((prop) => {
configText += `config.${prop} = process.env.VUE_APP_${constantCase(prop)} || "${
config[prop]
}",\n`;
}";\n`;
});
// Set computed values, allowing override with environment variables
Object.keys(computedConfig).forEach((prop) => {
Expand Down