Skip to content

Commit

Permalink
GH-2233: As a developer I want type definitions for runtime libraries…
Browse files Browse the repository at this point in the history
… imported from standard documents (#2234)

* remove scope folder @n4js-temp

* switch from npm to yarn

Now "preinstall": "npx npm-force-resolutions" is no longer required
in package.json, because yarn supports resolutions out-of-the-box.

* add support for type alias

* add tests

* support for read-only fields and getter in interfaces

* minor improvement

* support for type parameters of classes and interfaces

* add cmd line option --runtime-libs

* do not include TS built-in libs when --runtime-libs is specified

* support the "ctor/instance type pattern" in runtime lib .d.ts files

* support construct and call signature declarations

* some features and improvements (e.g. annotations, illegal member names)

* tests

* remove an unused import

* add support for static members

* support for generic methods

* some adjustments in runtimeLibs.n4js to reflect recent changes in N4JS

* add first support for converting type references from .d.ts to .n4jsd

* temporary: ignore folder TEMP

* support for object types

* temporary: minor changes for ease of debugging

* support for 'this' type

* support for type operators (e.g. readonly) - ignored on N4JS side

* add test for type operators

* add place-holder support for type predicates and mapped types

* skip ignored elements as early as possible

* add place-holder support for index signatures

* support for JSDoc comments

* minor fix

* avoid "this" as parameter name + support for additional members

* support multiple declarations for the same interface

* better support for prefix/suffix of scripts

* replace builtin_js.n4jsd (without jsdoc)

* handling of parameterized call signatures (not supported in N4JS)

* re-generated builtin_js.n4jsd

* strip 'undefined' from unions

* re-generated builtin_js.n4jsd

* support for member replacement in runtimeLibs mode

* re-generated builtin_js.n4jsd

* support for extends/implements clauses of classifiers

* fix some tests

* more fixes to get tests green

* even more fixes to get tests green

* some changes to make n4js-libs compile (partial)

* Squashed commit of the following (GH-2224):

commit 8d0f49c
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 13:49:58 2021 +0200

    minor: improve wording of some comments

commit aa40a90
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 13:42:24 2021 +0200

    more tests

commit 8cfd1c4
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 13:35:05 2021 +0200

    fix bug in n4js-runtime-html5

commit a7d4258
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 13:11:05 2021 +0200

    add a validation

commit 7b8d5bd
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 12:52:19 2021 +0200

    clean up: remove two obsolete FIXMEs

commit 6e9178f
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 12:46:08 2021 +0200

    yet more tests

commit 74ffddf
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 12:31:50 2021 +0200

    more tests

commit 180b137
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 12:20:55 2021 +0200

    more validations

commit 61781b8
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 11:35:06 2021 +0200

    add/adjust some validations

commit 05a72f1
Author: Mark-Oliver Reiser <[email protected]>
Date:   Thu Oct 7 09:56:15 2021 +0200

    support (non-static) polyfills for interfaces (pending: validations)

* misc. fixes to avoid compile errors in n4js-libs

* move runtimeLib configuration to separate file

* adjust some test

* add option for not emitting JSDoc comments

* support more cases of declaration merging + better approach

* process runtime libs in the order they are defined in the config file

* refactoring: change from functions to class methods

* minor clean up

* support for handling ctor/instance type pattern across file boundaries

* registration of remaining runtime library files

* fixes in handling of multiple declarations across files

* replace .n4jsd files in n4js-libs by generated files

* initial version of script for generating built-in types

* minor unrelated fix in MWE2 workflow for building n4js-libs

* minor fix

* change temporary handling of overloading

Emit signature "(...args: any+): any+" instead of arbitrarily emitting
the first signature.

* support symbols as member names

* ctor/instance type pattern: create type alias for removed ctor type

* more improvements and adjustments

* support for generic type aliases

* more patching

* more improvements and patching (now es2015 compiles)

* yet more improvements and patching (now esnext compiles)

* add support for tuple types

* add place-holder functionality for indexed access types

* improvements and more patching to resolve compile errors in nj4s-libs

* minor clean up

* Merge branch GH-2230 (squashed).

* slightly more patching

* support ignoring individual signatures + type parameters per signature

* more patching + some fixes and improvements

* prepare conversion of DOM API in shell script

* adjustment in n4js-runtime-html5 for compatibility with new built-ins

* experimental: 1st approach of bug fix to avoid failure on GitLab CI

* experimental: continues previous commit

* more improvements, fixes, patching to get stdlib to compile

* more improvements, fixes, patching to get OPR to compile

* fix scoping tests

* improve BuiltInTypesDefinitionTest + fix validation issues in built-ins

* fix more tests + minor improvement of patching

* bump version from 0.28.x to 0.29.x

* remove a few obsolete FIXME markers

* fix fix scoping tests (again)

* allow custom runtime library generation config in tests + clean up

* resolve/remove a few more FIXMEs

* review feedback

* revert experimental commits a40d991 f07b8ff

* add temporary work-around for GH-2235
  • Loading branch information
mor-n4 authored Oct 20, 2021
1 parent 2b9bdaa commit 4145dbd
Show file tree
Hide file tree
Showing 120 changed files with 6,238 additions and 3,231 deletions.
4 changes: 2 additions & 2 deletions n4js-libs/packages/n4js-runtime-ecma402/src/n4js/Number.n4jsd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
*
* @see https://www.ecma-international.org/ecma-402/4.0/
*/
@Override
public toLocaleString (locales: string | string[]=, options: ~r~NumberFormatOptions=): string
// @Override
// public toLocaleString (locales: string | string[]=, options: ~r~NumberFormatOptions=): string
}
33 changes: 0 additions & 33 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/Array.n4jsd

This file was deleted.

25 changes: 0 additions & 25 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/ArrayBuffer.n4jsd

This file was deleted.

15 changes: 0 additions & 15 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/Function.n4jsd

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
*/
@@ProvidedByRuntime

// TODO remove this file (after updating the @n4jsd packages)

/**
* Use this interface type to denote common ES2015 work-around cases
* used to make Iterators compatible with for..of loops.
*
* Dirty, but properly represents the ES2015 work-around.
* Deprecated! Use IterableIterator instead.
*/
export public interface ~IteratorExt<out T> extends Iterator<T>, Iterable<T> {
// @Override
Expand Down
70 changes: 0 additions & 70 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/Map.n4jsd

This file was deleted.

31 changes: 0 additions & 31 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/Math.n4jsd

This file was deleted.

25 changes: 0 additions & 25 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/Number.n4jsd

This file was deleted.

18 changes: 0 additions & 18 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/Object.n4jsd

This file was deleted.

45 changes: 0 additions & 45 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/Proxy.n4jsd

This file was deleted.

15 changes: 0 additions & 15 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/RegExp.n4jsd

This file was deleted.

68 changes: 0 additions & 68 deletions n4js-libs/packages/n4js-runtime-es2015/src/n4js/Set.n4jsd

This file was deleted.

Loading

0 comments on commit 4145dbd

Please sign in to comment.