Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Move to npm run test in vscode launch config #1013

Merged
merged 2 commits into from
Oct 12, 2020

Conversation

joshgummersall
Copy link
Contributor

Fixes issues with package resolution.

Copy link
Contributor

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-test launch projects still fail.

@@ -9,16 +9,17 @@ import * as nuget from '@snyk/nuget-semver'
import * as os from 'os'
import * as ppath from 'path'
import * as xp from 'xml2js'
import Validator from 'ajv'
import glob from 'globby'
import Ajv = require('ajv');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is discussed here: ajv-validator/ajv#1230

It looks like upgrading to v7 would give us better ES import support, but it's not a trivial upgrade so I'm moving back to require for this (and globby which appears to have a similar problem).

Copy link
Contributor

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

AJV v7 beta has better support for ES style import but is not a trivial
upgrade to make.

This commit also upgrades `tslib` across all packages to maintain
consistency with latest typescript version.
@joshgummersall joshgummersall force-pushed the joshgummersall/fix-vscode-launch-json branch from 0a4ee6c to c0b9a20 Compare October 12, 2020 20:26
@@ -82,11 +81,15 @@ export class SchemaTracker {
this.validator.addSchema(metaSchema, metaSchemaName)
}
this.validator.addSchema(fullSchema, schemaPath)
validator = this.validator.getSchema(schemaPath) as ajv.ValidateFunction
validator = this.validator.getSchema(schemaPath)
if (!validator) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a bit of safety rather than relying on casting to implicitly remove the potential for an undefined result.

@joshgummersall joshgummersall merged commit bf8d2db into main Oct 12, 2020
@joshgummersall joshgummersall deleted the joshgummersall/fix-vscode-launch-json branch October 12, 2020 20:49
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.

2 participants