Skip to content

Commit

Permalink
Merge pull request #766 from postmanlabs/release/v1.13.0
Browse files Browse the repository at this point in the history
Release version v1.13.0
  • Loading branch information
VShingala committed Sep 11, 2024
2 parents 3ee8d7c + 59fd9dc commit e5eb488
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 15 deletions.
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

## [Unreleased]

## [v1.13.0] - 2024-09-11

### Fixed

- Fix for - [#760](https://github.com/postmanlabs/postman-code-generators/issues/760) Fixed package installation issues with yarn (v4) and pnpm.

## [v1.12.0] - 2024-07-22

### Chore

- Updated postman-collection sdk to version 4.4.0 in missing codegens.
- Updated postman-collection sdk to version 4.4.0 in missing codegens.

### Fixed

- Fix typo in Content-Header for audio/midi files in codegens.
- Added support for NTLM auth support in cURL codegen.
- Fix typo in Content-Header for audio/midi files in codegens.
- Added support for NTLM auth support in cURL codegen.

## [v1.11.0] - 2024-07-10

Expand Down Expand Up @@ -170,7 +176,9 @@ v1.0.0 (May 29, 2020)
- Add ES6 syntax support for NodeJS Request, NodeJS Native and NodeJS Unirest
- Fix snippet generation for powershell and jquery, where form data params had no type field

[Unreleased]: https://github.com/postmanlabs/postman-code-generators/compare/v1.12.0...HEAD
[Unreleased]: https://github.com/postmanlabs/postman-code-generators/compare/v1.13.0...HEAD

[v1.13.0]: https://github.com/postmanlabs/postman-code-generators/compare/v1.12.0...v1.13.0

[v1.12.0]: https://github.com/postmanlabs/postman-code-generators/compare/v1.11.0...v1.12.0

Expand Down
6 changes: 3 additions & 3 deletions codegens/golang/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ self = module.exports = {
}
if (isFile) {
codeSnippet += `${indent}"os"\n${indent}"path/filepath"\n`;
codeSnippet += `${indent}"io"\n`;

// Setting isFile as false for further calls to this function
isFile = false;
}
codeSnippet += `${indent}"net/http"\n${indent}"io/ioutil"\n)\n\n`;
codeSnippet += `${indent}"net/http"\n${indent}"io"\n)\n\n`;

codeSnippet += `func main() {\n\n${indent}url := "${getUrlStringfromUrlObject(request.url)}"\n`;
codeSnippet += `${indent}method := "${request.method}"\n\n`;
Expand Down Expand Up @@ -297,7 +297,7 @@ self = module.exports = {
responseSnippet = `${indent}res, err := client.Do(req)\n`;
responseSnippet += `${indent}if err != nil {\n${indent.repeat(2)}fmt.Println(err)\n`;
responseSnippet += `${indent.repeat(2)}return\n${indent}}\n`;
responseSnippet += `${indent}defer res.Body.Close()\n\n${indent}body, err := ioutil.ReadAll(res.Body)\n`;
responseSnippet += `${indent}defer res.Body.Close()\n\n${indent}body, err := io.ReadAll(res.Body)\n`;
responseSnippet += `${indent}if err != nil {\n${indent.repeat(2)}fmt.Println(err)\n`;
responseSnippet += `${indent.repeat(2)}return\n${indent}}\n`;
responseSnippet += `${indent}fmt.Println(string(body))\n}`;
Expand Down
2 changes: 1 addition & 1 deletion npm/ci-requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pushd ./codegens/csharp-restsharp &>/dev/null;
sudo apt-get install dotnet-sdk-6.0
dotnet new console -o testProject -f net6.0
pushd ./testProject &>/dev/null;
dotnet add package RestSharp --version 110.0.0
dotnet add package RestSharp --version 112.0.0
popd &>/dev/null;
popd &>/dev/null;

Expand Down
33 changes: 28 additions & 5 deletions npm/deepinstall.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
var shell = require('shelljs'),
path = require('path'),
async = require('async'),
{ detect } = require('detect-package-manager'),
{ detect, getNpmVersion } = require('detect-package-manager'),
pm,
PRODUCTION_FLAG = '',
ver,
command,
getSubfolders,
fs = require('fs'),
pwd = shell.pwd();
Expand All @@ -24,12 +25,34 @@ async.series([
return next();
});
},
function (next) {
getNpmVersion(pm).then((res) => {
ver = res;
console.log('Detected ' + pm + ' version: ' + ver);
return next();
});
},
function (next) {
if (args[2] && args[2] === 'dev') {
console.log('Dev flag detected running ' + pm + ' install');
command = pm + ' install';
}
else {
PRODUCTION_FLAG = '--no-audit --production';
switch (pm) {
case 'yarn':
if (ver.startsWith('1')) {
command = 'yarn install --production --frozen-lockfile';
}
else {
command = 'touch yarn.lock && yarn workspaces focus --all --production'
}
break;
case 'pnpm':
command = 'pnpm install --prod';
break;
default:
command = pm + ' install --no-audit --production';
}
}

console.log('Running pre-package script');
Expand All @@ -51,8 +74,8 @@ async.series([

var commandOut;

console.log(codegen.name + ': ' + pm + ' install ' + PRODUCTION_FLAG);
commandOut = shell.exec(pm + ' install ' + PRODUCTION_FLAG, { silent: true });
console.log(codegen.name + ': ' + command);
commandOut = shell.exec(command, { silent: true });

if (commandOut.code !== 0) {
console.error('Failed to run ' + pm + ' install on codegen ' + codegen.name + ', here is the error:');
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postman-code-generators",
"version": "1.12.0",
"version": "1.13.0",
"description": "Generates code snippets for a postman collection",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit e5eb488

Please sign in to comment.