Skip to content

Conversation

@OwnageIsMagic
Copy link
Contributor

@OwnageIsMagic OwnageIsMagic commented Dec 31, 2017

nodejs/node#15606

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Follow the advice from the readme.
  • Run npm run lint package-name (or tsc if no tslint.json is present).
  • Avoid common mistakes.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: process: Send signal name to signal handlers nodejs/node#15606
  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Dec 31, 2017
@typescript-bot
Copy link
Contributor

@OwnageIsMagic The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks!

@OwnageIsMagic
Copy link
Contributor Author

OwnageIsMagic commented Dec 31, 2017

Unrelated build error #22569

	Error: /home/travis/build/DefinitelyTyped/DefinitelyTyped/types/koa-webpack/koa-webpack-tests.ts
ERROR: 15:9  expect  TypeScript@next compile error: 
Argument of type '{ compiler: Compiler; config: Configuration; dev: { noInfo: boolean; quiet: boolean; lazy: boolea...' is not assignable to parameter of type 'Options | undefined'.
  Type '{ compiler: Compiler; config: Configuration; dev: { noInfo: boolean; quiet: boolean; lazy: boolea...' is not assignable to type 'Options'.
    Types of property 'dev' are incompatible.
      Type '{ noInfo: boolean; quiet: boolean; lazy: boolean; watchOptions: { aggregateTimeout: number; poll:...' is not assignable to type 'Options | undefined'.
        Object literal may only specify known properties, and 'noInfo' does not exist in type 'Options | undefined'.
    at /home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/dtslint/bin/index.js:74:19
    at Generator.next (<anonymous>)
    at fulfilled (/home/travis/build/DefinitelyTyped/DefinitelyTyped/node_modules/dtslint/bin/index.js:5:58)
    at <anonymous>

And others.
Also The job exceeded the maximum time limit for jobs, and has been terminated.

@Flarna
Copy link
Contributor

Flarna commented Jan 2, 2018

The change itself looks fine but this is not part of NodeJs 8. Seems it's time to move current typings to v8 folder and increase version to v9.

@OwnageIsMagic
Copy link
Contributor Author

So, just wait?

@Flarna
Copy link
Contributor

Flarna commented Jan 2, 2018

I have just seen that the change in NodeJS is already included in 9.3.0 so no need to wait.

As far as I know the creation of v8 folder and increase the version to 9 to allow typings specific for NodeJS 9 is usually done once needed so you could do it in your PR. At least this is my understanding from the history (see #17027).

See also https://github.com/DefinitelyTyped/DefinitelyTyped#i-want-to-update-a-package-to-a-new-major-version

@Andy-MS any objections regarding creation of NodeJs 8 version folder?

@ghost
Copy link

ghost commented Jan 2, 2018

@Flarna No objections.

@OwnageIsMagic
Copy link
Contributor Author

OwnageIsMagic commented Jan 2, 2018

https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V9.md
Here is all changes that relate to type definitions for Node 9

  • remove added \t

9.0.0

  • - The os.EOL property is now read-only
  • - Domains The long-deprecated .dispose() method has been removed

9.2.0

  • - expose process.ppid
  • - fs.realpathSync.native and fs.realpath.native are now exposed

9.3.0

  • - console.debug can now be used outside of the inspector
  • - module.builtinModules will return a list of built in modules
  • - process.setUncaughtExceptionCaptureCallback can now be used to customize behavior for --abort-on-uncaught-exception
  • - A signal handler is now able to receive the signal code that triggered the handler. (This PR Node 9.3 #22593)
  • - writable.writableHighWaterMark and readable.readableHighWaterMark will return the values the stream object was instantiated with

@OwnageIsMagic
Copy link
Contributor Author

OwnageIsMagic commented Jan 3, 2018

I don't want to checkout repo to my pc to do this

@OwnageIsMagic OwnageIsMagic changed the title SignalsListener signal name Node 9 Jan 3, 2018
@OwnageIsMagic
Copy link
Contributor Author

@types/node/index.d.ts(1732,12): error TS1024: 'readonly' modifier can only appear on a property declaration or index signature.

Console: NodeJS.ConsoleConstructor;
assert(value: any, message?: string, ...optionalParams: any[]): void;
dir(obj: any, options?: NodeJS.InspectOptions): void;
debug(message?: any, ...optionalParams: any[]): void;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

GH inserts tabs instead of spaces :(

@OwnageIsMagic
Copy link
Contributor Author

Error: The latest major version is 8, but a directory v8 exists.

@typescript-bot typescript-bot added the New Definition This PR creates a new definition package. label Jan 3, 2018
@ghost
Copy link

ghost commented Jan 3, 2018

Need to update the header in node/index.d.ts to be for version 9.

/************************************************
* *
* Node.js v8.5.x API *
* Node.js v9.x.x API *
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Andy-MS already done that

Copy link

Choose a reason for hiding this comment

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

The actual header is on the first line -- don't know if this box is really necessary.

@OwnageIsMagic
Copy link
Contributor Author

OwnageIsMagic commented Jan 3, 2018

there are two more things to update #22593 (comment)
I have no time today for this, maybe tomorrow if nobody wants to do this

@OwnageIsMagic
Copy link
Contributor Author

Now it says Error: The latest major version is 0, but a directory v0 exists.
Also ci uses
$ node --version
v8.9.4

@@ -1,4 +1,4 @@
// Type definitions for Node.js 8.5.x
// Type definitions for Node.js 9.x.x
Copy link

@ghost ghost Jan 3, 2018

Choose a reason for hiding this comment

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

// Type definitions for Node.js 9.0

setegid(id: number | string): void;
getgroups(): number[];
setgroups(groups: Array<string | number>): void;
setUncaughtExceptionCaptureCallback((err: Error) => void | null): void
Copy link
Contributor

Choose a reason for hiding this comment

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

The name of the parameter is missing.
Additionally I think that this specifies a function which returns void | null and not a Function (err: Error) => void or null.

@Flarna
Copy link
Contributor

Flarna commented Jan 3, 2018

@types/node/index.d.ts(1732,12): error TS1024: 'readonly' modifier can only appear on a property declaration or index signature.

I think var ==> const should be the way to go here.

Flarna added 5 commits January 3, 2018 23:42
Add writableHighWaterMark/readableHighWaterMark to WriteStream/ReadStream
fixed setUncaughtExceptionCaptureCallback()
Add module.builtinModules
change os.EOL to const
add writableHighWaterMark to Duplex
writableHighWaterMark and readableHighWaterMark are readonly
@Flarna
Copy link
Contributor

Flarna commented Jan 4, 2018

@OwnageIsMagic I did some changes in this in my fork: https://github.com/Flarna/DefinitelyTyped/tree/patch-2 but somehow I'm not able to create a PR to your branch. Feel free to merge from there.
Still some points open but I have to stop for now.

@OwnageIsMagic
Copy link
Contributor Author

Now it looks good
Do you want I squash it?

@OwnageIsMagic
Copy link
Contributor Author

OwnageIsMagic commented Jan 5, 2018

Why tests not failing on 1860557 18a98ab?
but CI outputs error

Error: /home/travis/build/DefinitelyTyped/DefinitelyTyped/types/node/index.d.ts
ERROR: 3483:5   adjacent-overload-signatures  All 'realpath' signatures should be adjacent
ERROR: 3499:22  no-mergeable-namespace        Mergeable namespace 'realpath' found. Merge its contents with the namespace on line 3474.

@ghost
Copy link

ghost commented Jan 5, 2018

@OwnageIsMagic types-publisher bug, fixed
Ignore the react errors as they are due to microsoft/TypeScript#21028. And massive, v8-profiler, and webpack-dev-middleware already have fixes out. So just the node errors are relevant.

@OwnageIsMagic
Copy link
Contributor Author

ready to merge!

@OwnageIsMagic OwnageIsMagic changed the title Node 9 Node 9.3 Jan 5, 2018
.travis.yml Outdated
language: node_js
node_js:
- 8
- 9
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the nodejs version used to execute tests so not related to the typings version. Not sure if this is really intended to step to NodeJs 9 here. fyi @Andy-MS

Copy link

Choose a reason for hiding this comment

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

Yeah, this should be done in a separate PR if it is done. I brought it down to 8 when the new release started causing trouble, though it may be fixed now. (#21156)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

build was executing fine with node 9

Copy link
Contributor

@Flarna Flarna left a comment

Choose a reason for hiding this comment

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

Looks fine, just undo the change in .travis.yml

@OwnageIsMagic
Copy link
Contributor Author

Done

@ghost ghost merged commit ea2dc4d into DefinitelyTyped:master Jan 8, 2018
@OwnageIsMagic OwnageIsMagic deleted the patch-1 branch February 1, 2018 13:30
KSXGitHub pushed a commit to KSXGitHub/DefinitelyTyped that referenced this pull request May 12, 2018
* SignalsListener signal name

nodejs/node#15606

* created Node 8 folder

* Create tsconfig.json

* Create tslint.json

* Create node-tests.ts

* Node 9

* update node header

* Tabs to spaces

* copy inspector.d.ts to v8 folder

* correct path mapping for v8

* disable no-declare-current-package for v8 module

* Correct version to 9.3.x
Add writableHighWaterMark/readableHighWaterMark to WriteStream/ReadStream
fixed setUncaughtExceptionCaptureCallback()
Add module.builtinModules
change os.EOL to const
add writableHighWaterMark to Duplex
writableHighWaterMark and readableHighWaterMark are readonly

* fs.realpathSync.native and fs.realpath.native

* fs.realpath.native tests
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Definition This PR creates a new definition package. Popular package This PR affects a popular package (as counted by NPM download counts).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants