Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Add upper bound for parse-duration package version #97

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

priitlatt
Copy link
Contributor

NPM package parse-duration version was bumped from 1.1.0 to 2.1.3 In PR #95 for CodePush CLI. This caused the build to fail with the following error:

% npm run build

> [email protected] build
> tsc

script/command-parser.ts:1321:21 - error TS2349: This expression is not callable.
  Type 'typeof import("/private/tmp/ms-code-push-server/cli/node_modules/parse-duration/index")' has no call signatures.

1321   return Math.floor(parseDuration(durationString));
                         ~~~~~~~~~~~~~


Found 1 error in script/command-parser.ts:1321

As current code-base is not compatible with parse-duration versions 2.0.0+, restrict parse-duration to use version 1.x.y.

@priitlatt
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Codemagic"

@icarusdust
Copy link

@lucen-ms if you can approve this please

@lucen-ms lucen-ms merged commit 5b42222 into microsoft:main Feb 14, 2025
2 checks passed
@lucen-ms
Copy link
Collaborator

Thank you @icarusdust - we will fix it properly soon.

@icarusdust
Copy link

Huge thanks to @priitlatt 🙏

itujo pushed a commit to Idea-Maker/code-push-server that referenced this pull request Feb 21, 2025
NPM package
[parse-duration](https://www.npmjs.com/package/parse-duration) version
was bumped from `1.1.0` to `2.1.3` In PR microsoft#95 for CodePush CLI. This
caused the build to fail with the following error:

```shell
% npm run build

> [email protected] build
> tsc

script/command-parser.ts:1321:21 - error TS2349: This expression is not callable.
  Type 'typeof import("/private/tmp/ms-code-push-server/cli/node_modules/parse-duration/index")' has no call signatures.

1321   return Math.floor(parseDuration(durationString));
                         ~~~~~~~~~~~~~


Found 1 error in script/command-parser.ts:1321
```

As current code-base is not compatible with `parse-duration` versions
`2.0.0+`, restrict `parse-duration` to use version `1.x.y`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants