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

Introduce notification after uninstallation #289

Conversation

hiroppy
Copy link
Contributor

@hiroppy hiroppy commented Mar 6, 2016

Hello :)

I added a log after uninstallation.

if a file exists

[main.d.ts] unbuild jquery
[browser.d.ts] unbuild jquery

if a file does not exist

[main.d.ts] not installed in jquery
[browser.d.ts] not installed in jquery

Please give me words if an upper sentence is not good :)

I will modify the following PR.
#15
#177

thanks.

@hiroppy
Copy link
Contributor Author

hiroppy commented Mar 6, 2016

Ummm.... I do not know why this test fails when only stable.
Why does this test become the build error? :(

This test passes in my local environment... (bootstrap , test, install and build)

@blakeembrey
Copy link
Member

The build failure has been fixed, I've noticed some random failures lately but haven't been able to test them thoroughly.

As for the PR, the work will need to be ported to https://github.com/typings/core. However, it should be simpler to build the feature there, since I've enabled a messaging pipeline for use during installation/uninstall/etc.

@@ -278,8 +278,18 @@ export function removeDependency (options: DefinitionOptions) {

// Remove the dependency from typings.
function remove (path: string, file: string, dtsFile: string) {
return promiseFinally(rimraf(path), () => {
return transformDtsFile(dtsFile, typings => typings.filter(x => x !== file))
const libName: string = path.split('/').slice(-1)[0]
Copy link
Member

Choose a reason for hiding this comment

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

We can't just split on / because Windows uses a different separator. It'd probably be easier to just get the options passed through.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

const obj: any = require('path').parse(file)
const dir: string = obj.dir
const libName: string = obj.name.split('.')[0]

console.log(dir, libName);
output

/Users/hoge/typings/typings/main/definitions/jquery jquery
/Users/hoge/typings/typings/browser/definitions/jquery jquery

Would this be ok?

Copy link
Member

Choose a reason for hiding this comment

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

The name is already available from the passed in options in the outer scope. It's probably easier to use that instead of trying to parse it yourself.

@blakeembrey
Copy link
Member

Ok, it's done and will be released with 0.7. It looks like:

image

@blakeembrey blakeembrey closed this Mar 8, 2016
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.

None yet

2 participants