Skip to content

Commit e5eb488

Browse files
authored
Merge pull request #766 from postmanlabs/release/v1.13.0
Release version v1.13.0
2 parents 3ee8d7c + 59fd9dc commit e5eb488

File tree

6 files changed

+46
-15
lines changed

6 files changed

+46
-15
lines changed

CHANGELOG.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22

33
## [Unreleased]
44

5+
## [v1.13.0] - 2024-09-11
6+
7+
### Fixed
8+
9+
- Fix for - [#760](https://github.com/postmanlabs/postman-code-generators/issues/760) Fixed package installation issues with yarn (v4) and pnpm.
10+
511
## [v1.12.0] - 2024-07-22
612

713
### Chore
814

9-
- Updated postman-collection sdk to version 4.4.0 in missing codegens.
15+
- Updated postman-collection sdk to version 4.4.0 in missing codegens.
1016

1117
### Fixed
1218

13-
- Fix typo in Content-Header for audio/midi files in codegens.
14-
- Added support for NTLM auth support in cURL codegen.
19+
- Fix typo in Content-Header for audio/midi files in codegens.
20+
- Added support for NTLM auth support in cURL codegen.
1521

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

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

173-
[Unreleased]: https://github.com/postmanlabs/postman-code-generators/compare/v1.12.0...HEAD
179+
[Unreleased]: https://github.com/postmanlabs/postman-code-generators/compare/v1.13.0...HEAD
180+
181+
[v1.13.0]: https://github.com/postmanlabs/postman-code-generators/compare/v1.12.0...v1.13.0
174182

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

codegens/golang/lib/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ self = module.exports = {
238238
}
239239
if (isFile) {
240240
codeSnippet += `${indent}"os"\n${indent}"path/filepath"\n`;
241-
codeSnippet += `${indent}"io"\n`;
241+
242242
// Setting isFile as false for further calls to this function
243243
isFile = false;
244244
}
245-
codeSnippet += `${indent}"net/http"\n${indent}"io/ioutil"\n)\n\n`;
245+
codeSnippet += `${indent}"net/http"\n${indent}"io"\n)\n\n`;
246246

247247
codeSnippet += `func main() {\n\n${indent}url := "${getUrlStringfromUrlObject(request.url)}"\n`;
248248
codeSnippet += `${indent}method := "${request.method}"\n\n`;
@@ -297,7 +297,7 @@ self = module.exports = {
297297
responseSnippet = `${indent}res, err := client.Do(req)\n`;
298298
responseSnippet += `${indent}if err != nil {\n${indent.repeat(2)}fmt.Println(err)\n`;
299299
responseSnippet += `${indent.repeat(2)}return\n${indent}}\n`;
300-
responseSnippet += `${indent}defer res.Body.Close()\n\n${indent}body, err := ioutil.ReadAll(res.Body)\n`;
300+
responseSnippet += `${indent}defer res.Body.Close()\n\n${indent}body, err := io.ReadAll(res.Body)\n`;
301301
responseSnippet += `${indent}if err != nil {\n${indent.repeat(2)}fmt.Println(err)\n`;
302302
responseSnippet += `${indent.repeat(2)}return\n${indent}}\n`;
303303
responseSnippet += `${indent}fmt.Println(string(body))\n}`;

npm/ci-requirements.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pushd ./codegens/csharp-restsharp &>/dev/null;
3939
sudo apt-get install dotnet-sdk-6.0
4040
dotnet new console -o testProject -f net6.0
4141
pushd ./testProject &>/dev/null;
42-
dotnet add package RestSharp --version 110.0.0
42+
dotnet add package RestSharp --version 112.0.0
4343
popd &>/dev/null;
4444
popd &>/dev/null;
4545

npm/deepinstall.js

+28-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
var shell = require('shelljs'),
22
path = require('path'),
33
async = require('async'),
4-
{ detect } = require('detect-package-manager'),
4+
{ detect, getNpmVersion } = require('detect-package-manager'),
55
pm,
6-
PRODUCTION_FLAG = '',
6+
ver,
7+
command,
78
getSubfolders,
89
fs = require('fs'),
910
pwd = shell.pwd();
@@ -24,12 +25,34 @@ async.series([
2425
return next();
2526
});
2627
},
28+
function (next) {
29+
getNpmVersion(pm).then((res) => {
30+
ver = res;
31+
console.log('Detected ' + pm + ' version: ' + ver);
32+
return next();
33+
});
34+
},
2735
function (next) {
2836
if (args[2] && args[2] === 'dev') {
2937
console.log('Dev flag detected running ' + pm + ' install');
38+
command = pm + ' install';
3039
}
3140
else {
32-
PRODUCTION_FLAG = '--no-audit --production';
41+
switch (pm) {
42+
case 'yarn':
43+
if (ver.startsWith('1')) {
44+
command = 'yarn install --production --frozen-lockfile';
45+
}
46+
else {
47+
command = 'touch yarn.lock && yarn workspaces focus --all --production'
48+
}
49+
break;
50+
case 'pnpm':
51+
command = 'pnpm install --prod';
52+
break;
53+
default:
54+
command = pm + ' install --no-audit --production';
55+
}
3356
}
3457

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

5275
var commandOut;
5376

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

5780
if (commandOut.code !== 0) {
5881
console.error('Failed to run ' + pm + ' install on codegen ' + codegen.name + ', here is the error:');

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postman-code-generators",
3-
"version": "1.12.0",
3+
"version": "1.13.0",
44
"description": "Generates code snippets for a postman collection",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)