diff --git a/jest.config.js b/jest.config.js index d719876..c51cd54 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,11 +5,12 @@ module.exports = { moduleFileExtensions: ['js', 'fnk'], transform: { '^.+\\.js$': 'babel-jest', - '^.+\\.fnk$': ['@fink/jest/transform'] + '^.+\\.fnk$': ['@fink/jest/transform.js'] }, transformIgnorePatterns: ['/node_modules/', '/build/'], - snapshotResolver: '@fink/jest/snapshot-resolver', + resolver: '@fink/jest/cjs/module-resolver.js', + snapshotResolver: '@fink/jest/snapshot-resolver.js', modulePathIgnorePatterns: ['/build/'], diff --git a/package-lock.json b/package-lock.json index 97690fe..259f34e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -417,32 +417,139 @@ "optional": true }, "@fink/cli": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@fink/cli/-/cli-6.2.1.tgz", - "integrity": "sha512-t1m0GLZEc9u+DFIJgbcWVvftR4OuWLbyK8H//iWDsc9nlj82Heobvqiw8gntIq4O0GGlHuuN2HU4834NhgE0MA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@fink/cli/-/cli-7.0.0.tgz", + "integrity": "sha512-lGzX4K/eJIeJrsGmqyXESwUEf/afsZLM0NY+byERzOPNF1yznk3ihhvrHtBopWZKXZNqQU+NGauyu7Doc7RjsQ==", "dev": true, "requires": { - "@fink/js-interop": "^1.1.0", - "@fink/std-lib": "^4.0.0", + "@fink/js-interop": "^1.1.1", + "@fink/std-lib": "^4.0.1", "minimatch": "^3.0.4", - "yargs": "^15.3.1" + "yargs": "^16.0.3" + }, + "dependencies": { + "@fink/js-interop": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@fink/js-interop/-/js-interop-1.1.1.tgz", + "integrity": "sha512-KNK1E7B8C5haHibJWIQvcHHpaoaKbD4jTmOxca5bRXEGZbzI5WlwJ/bdvXcVHajBpLkbGUPiUGTiE1h7kC4r2g==", + "dev": true + }, + "@fink/std-lib": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-4.0.1.tgz", + "integrity": "sha512-ZCC7SNe2uztnr1KNmi2yx/1XC7Y8kxcL3c3ZmjPAGPRW+7LCzs7+rmgNknftQCGi6DV2VG8TDr3QGAQm9srgjg==", + "dev": true, + "requires": { + "@fink/js-interop": "^1.1.0" + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.1.tgz", + "integrity": "sha512-rcvHOWyGyid6I1WjT/3NatKj2kDt9OdSHSXpyLXaMWFbKpGACNW8pRhhdPUq9MWUOdwn8Rz9AVETjF4105rZZQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.2.tgz", + "integrity": "sha512-CkwaeZw6dQgqgPGeTWKMXCRmMcBgETFlTml1+ZOO+q7kGst8NREJ+eWwFNPVUQ4QGdAaklbqCZHH6Zuep1RjiA==", + "dev": true + }, + "yargs": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.0.3.tgz", + "integrity": "sha512-6+nLw8xa9uK1BOEOykaiYAJVh6/CjxWXK/q9b5FpRgNslt8s22F2xMBqVIKgCRjNgGvGPBy8Vog7WN7yh4amtA==", + "dev": true, + "requires": { + "cliui": "^7.0.0", + "escalade": "^3.0.2", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.1", + "yargs-parser": "^20.0.0" + } + }, + "yargs-parser": { + "version": "20.2.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.1.tgz", + "integrity": "sha512-yYsjuSkjbLMBp16eaOt7/siKTjNVjMm3SoJnIg3sEh/JsvqVVDyjRKmaJV4cl+lNIgq6QEco2i3gDebJl7/vLA==", + "dev": true + } } }, "@fink/jest": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@fink/jest/-/jest-5.4.0.tgz", - "integrity": "sha512-LoBZZivJ3o38+hTJ7WQODX2s3y3T0l9fQaoYqr44DSVxK/hvG1YIlJ4WFuaUB5Ve67tLYq34+LHkPip+/Dd+bQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@fink/jest/-/jest-6.0.1.tgz", + "integrity": "sha512-Cm+YPfR3/j5G7OPbC7qC6tGVJVOqAlJIhMXmON8k2XhfjHaZPaOKY4EWtlCWNWKPssQqksuNo4bC0qsjvzKR0g==", "dev": true, "requires": { "@babel/core": "^7.11.6", "@fink/js-interop": "^1.1.1", "@fink/std-lib": "^4.0.1" + }, + "dependencies": { + "@fink/js-interop": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@fink/js-interop/-/js-interop-1.1.1.tgz", + "integrity": "sha512-KNK1E7B8C5haHibJWIQvcHHpaoaKbD4jTmOxca5bRXEGZbzI5WlwJ/bdvXcVHajBpLkbGUPiUGTiE1h7kC4r2g==", + "dev": true + }, + "@fink/std-lib": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-4.0.1.tgz", + "integrity": "sha512-ZCC7SNe2uztnr1KNmi2yx/1XC7Y8kxcL3c3ZmjPAGPRW+7LCzs7+rmgNknftQCGi6DV2VG8TDr3QGAQm9srgjg==", + "dev": true, + "requires": { + "@fink/js-interop": "^1.1.0" + } + } } }, "@fink/js-interop": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@fink/js-interop/-/js-interop-1.1.1.tgz", - "integrity": "sha512-KNK1E7B8C5haHibJWIQvcHHpaoaKbD4jTmOxca5bRXEGZbzI5WlwJ/bdvXcVHajBpLkbGUPiUGTiE1h7kC4r2g==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@fink/js-interop/-/js-interop-2.0.0.tgz", + "integrity": "sha512-o1E1TSVyB0qCABzBAazTpXe7Fb7KPGi5buyUX0TCm3feHOQMpH/o+Kx32z47pRPnYo6RsimTuYLspVxtVOk4Yg==" }, "@fink/larix": { "version": "12.3.0", @@ -452,19 +559,63 @@ "requires": { "@fink/prattler": "^5.3.1", "@fink/std-lib": "^4.0.1" + }, + "dependencies": { + "@fink/js-interop": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@fink/js-interop/-/js-interop-1.1.1.tgz", + "integrity": "sha512-KNK1E7B8C5haHibJWIQvcHHpaoaKbD4jTmOxca5bRXEGZbzI5WlwJ/bdvXcVHajBpLkbGUPiUGTiE1h7kC4r2g==", + "dev": true + }, + "@fink/std-lib": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-4.0.1.tgz", + "integrity": "sha512-ZCC7SNe2uztnr1KNmi2yx/1XC7Y8kxcL3c3ZmjPAGPRW+7LCzs7+rmgNknftQCGi6DV2VG8TDr3QGAQm9srgjg==", + "dev": true, + "requires": { + "@fink/js-interop": "^1.1.0" + } + } } }, "@fink/loxia": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/@fink/loxia/-/loxia-12.4.0.tgz", - "integrity": "sha512-K7LOR/oHFpse2IbsALdWQVW2oF4fqJfmr+3CnhBwbrea3I4Zn5hg355YEPjCH7O3Y8dQwPRe2JAa5I6xZarqUw==", + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@fink/loxia/-/loxia-13.0.1.tgz", + "integrity": "sha512-YumiqpL4olz6LCxFl8sD+UmfKfCOst+acuwhmMKZY9Edu+9d3Svk7GLThrtw7zyH2ilkZ2Kxjxsn4uoO4R5BOQ==", "dev": true, "requires": { "@babel/core": "^7.10.5", "@babel/traverse": "^7.10.5", "@babel/types": "^7.10.5", "@fink/js-interop": "^1.1.1", + "@fink/snippet": "^1.0.0", "@fink/std-lib": "^4.0.1" + }, + "dependencies": { + "@fink/js-interop": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@fink/js-interop/-/js-interop-1.1.1.tgz", + "integrity": "sha512-KNK1E7B8C5haHibJWIQvcHHpaoaKbD4jTmOxca5bRXEGZbzI5WlwJ/bdvXcVHajBpLkbGUPiUGTiE1h7kC4r2g==", + "dev": true + }, + "@fink/snippet": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@fink/snippet/-/snippet-1.2.1.tgz", + "integrity": "sha512-WARvWOaGYPNJu/vQgoO/fGT9L5Z5lYjeVVSwS8vjG/gPH09u4V4gmBtKR10Gw8eiKbE5kwCj+e6WGQAZbqajSQ==", + "dev": true, + "requires": { + "@fink/std-lib": "^4.0.0" + } + }, + "@fink/std-lib": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-4.0.1.tgz", + "integrity": "sha512-ZCC7SNe2uztnr1KNmi2yx/1XC7Y8kxcL3c3ZmjPAGPRW+7LCzs7+rmgNknftQCGi6DV2VG8TDr3QGAQm9srgjg==", + "dev": true, + "requires": { + "@fink/js-interop": "^1.1.0" + } + } } }, "@fink/prattler": { @@ -475,22 +626,48 @@ "requires": { "@fink/snippet": "^1.2.0", "@fink/std-lib": "^4.0.0" + }, + "dependencies": { + "@fink/js-interop": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@fink/js-interop/-/js-interop-1.1.1.tgz", + "integrity": "sha512-KNK1E7B8C5haHibJWIQvcHHpaoaKbD4jTmOxca5bRXEGZbzI5WlwJ/bdvXcVHajBpLkbGUPiUGTiE1h7kC4r2g==", + "dev": true + }, + "@fink/snippet": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@fink/snippet/-/snippet-1.2.1.tgz", + "integrity": "sha512-WARvWOaGYPNJu/vQgoO/fGT9L5Z5lYjeVVSwS8vjG/gPH09u4V4gmBtKR10Gw8eiKbE5kwCj+e6WGQAZbqajSQ==", + "dev": true, + "requires": { + "@fink/std-lib": "^4.0.0" + } + }, + "@fink/std-lib": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-4.0.1.tgz", + "integrity": "sha512-ZCC7SNe2uztnr1KNmi2yx/1XC7Y8kxcL3c3ZmjPAGPRW+7LCzs7+rmgNknftQCGi6DV2VG8TDr3QGAQm9srgjg==", + "dev": true, + "requires": { + "@fink/js-interop": "^1.1.0" + } + } } }, "@fink/snippet": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@fink/snippet/-/snippet-1.2.1.tgz", - "integrity": "sha512-WARvWOaGYPNJu/vQgoO/fGT9L5Z5lYjeVVSwS8vjG/gPH09u4V4gmBtKR10Gw8eiKbE5kwCj+e6WGQAZbqajSQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@fink/snippet/-/snippet-2.0.0.tgz", + "integrity": "sha512-hmOfFzThoamd1DKhd5Se7YpNnt7za+7VKa2+CEoWHcD4GopeVRS+BPNvMAN/Jl14M9N928T04swJE7BmBXHo8Q==", "requires": { - "@fink/std-lib": "^4.0.0" + "@fink/std-lib": "^5.0.0" } }, "@fink/std-lib": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-4.0.1.tgz", - "integrity": "sha512-ZCC7SNe2uztnr1KNmi2yx/1XC7Y8kxcL3c3ZmjPAGPRW+7LCzs7+rmgNknftQCGi6DV2VG8TDr3QGAQm9srgjg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-5.0.0.tgz", + "integrity": "sha512-bcxg8DcsAxalb2ekEH4q1W3Ud5DtZ0ud3L0OfD+TnAVtNWzUl8q03AaAbmfebjjrGHQfV1c1djW+6FJw8Tc1zA==", "requires": { - "@fink/js-interop": "^1.1.0" + "@fink/js-interop": "^2.0.0" } }, "@istanbuljs/load-nyc-config": { @@ -513,16 +690,16 @@ "dev": true }, "@jest/console": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.5.0.tgz", - "integrity": "sha512-oh59scth4yf8XUgMJb8ruY7BHm0X5JZDNgGGsVnlOt2XQuq9s2NMllIrN4n70Yds+++bjrTGZ9EoOKraaPKPlg==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.5.2.tgz", + "integrity": "sha512-lJELzKINpF1v74DXHbCRIkQ/+nUV1M+ntj+X1J8LxCgpmJZjfLmhFejiMSbjjD66fayxl5Z06tbs3HMyuik6rw==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^26.5.0", - "jest-util": "^26.5.0", + "jest-message-util": "^26.5.2", + "jest-util": "^26.5.2", "slash": "^3.0.0" }, "dependencies": { @@ -578,34 +755,34 @@ } }, "@jest/core": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.5.0.tgz", - "integrity": "sha512-hDtgfzYxnrQn54+0JlbqpXM4+bqDfK0ooMlNE4Nn3VBsB4RbmytAn4/kVVIcMa+aYwRr/fwzWuGJwBETVg1sDw==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.5.2.tgz", + "integrity": "sha512-LLTo1LQMg7eJjG/+P1NYqFof2B25EV1EqzD5FonklihG4UJKiK2JBIvWonunws6W7e+DhNLoFD+g05tCY03eyA==", "dev": true, "requires": { - "@jest/console": "^26.5.0", - "@jest/reporters": "^26.5.0", - "@jest/test-result": "^26.5.0", - "@jest/transform": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/console": "^26.5.2", + "@jest/reporters": "^26.5.2", + "@jest/test-result": "^26.5.2", + "@jest/transform": "^26.5.2", + "@jest/types": "^26.5.2", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.5.0", - "jest-config": "^26.5.0", - "jest-haste-map": "^26.5.0", - "jest-message-util": "^26.5.0", + "jest-changed-files": "^26.5.2", + "jest-config": "^26.5.2", + "jest-haste-map": "^26.5.2", + "jest-message-util": "^26.5.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.5.0", - "jest-resolve-dependencies": "^26.5.0", - "jest-runner": "^26.5.0", - "jest-runtime": "^26.5.0", - "jest-snapshot": "^26.5.0", - "jest-util": "^26.5.0", - "jest-validate": "^26.5.0", - "jest-watcher": "^26.5.0", + "jest-resolve": "^26.5.2", + "jest-resolve-dependencies": "^26.5.2", + "jest-runner": "^26.5.2", + "jest-runtime": "^26.5.2", + "jest-snapshot": "^26.5.2", + "jest-util": "^26.5.2", + "jest-validate": "^26.5.2", + "jest-watcher": "^26.5.2", "micromatch": "^4.0.2", "p-each-series": "^2.1.0", "rimraf": "^3.0.0", @@ -717,53 +894,53 @@ } }, "@jest/environment": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.5.0.tgz", - "integrity": "sha512-0F3G9EyZU2NAP0/c/5EqVx4DmldQtRxj0gMl3p3ciSCdyMiCyDmpdE7O0mKTSiFDyl1kU4TfgEVf0r0vMkmYcw==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.5.2.tgz", + "integrity": "sha512-YjhCD/Zhkz0/1vdlS/QN6QmuUdDkpgBdK4SdiVg4Y19e29g4VQYN5Xg8+YuHjdoWGY7wJHMxc79uDTeTOy9Ngw==", "dev": true, "requires": { - "@jest/fake-timers": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/fake-timers": "^26.5.2", + "@jest/types": "^26.5.2", "@types/node": "*", - "jest-mock": "^26.5.0" + "jest-mock": "^26.5.2" } }, "@jest/fake-timers": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.5.0.tgz", - "integrity": "sha512-sQK6xUembaZ0qLnZpSjJJuJiKvyrjCJhaYjbmatFpj5+cM8h2D7YEkeEBC26BMzvF1O3tNM9OL7roqyBmom0KA==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.5.2.tgz", + "integrity": "sha512-09Hn5Oraqt36V1akxQeWMVL0fR9c6PnEhpgLaYvREXZJAh2H2Y+QLCsl0g7uMoJeoWJAuz4tozk1prbR1Fc1sw==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "@sinonjs/fake-timers": "^6.0.1", "@types/node": "*", - "jest-message-util": "^26.5.0", - "jest-mock": "^26.5.0", - "jest-util": "^26.5.0" + "jest-message-util": "^26.5.2", + "jest-mock": "^26.5.2", + "jest-util": "^26.5.2" } }, "@jest/globals": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.5.0.tgz", - "integrity": "sha512-TCKx3XWR9h/yyhQbz0C1sXkK2e8WJOnkP40T9bewNpf2Ahr1UEyKXnCoQO0JCpXFkWGTXBNo1QAgTQ3+LhXfcA==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.5.2.tgz", + "integrity": "sha512-9PmnFsAUJxpPt1s/stq02acS1YHliVBDNfAWMe1bwdRr1iTCfhbNt3ERQXrO/ZfZSweftoA26Q/2yhSVSWQ3sw==", "dev": true, "requires": { - "@jest/environment": "^26.5.0", - "@jest/types": "^26.5.0", - "expect": "^26.5.0" + "@jest/environment": "^26.5.2", + "@jest/types": "^26.5.2", + "expect": "^26.5.2" } }, "@jest/reporters": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.5.0.tgz", - "integrity": "sha512-lUl5bbTHflDO9dQa85ZTHasPBVsyC48t9sg/VN2wC3OJryclFNqN4Xfo2FgnNl/pzCnzO2MVgMyIij5aNkod2w==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.5.2.tgz", + "integrity": "sha512-zvq6Wvy6MmJq/0QY0YfOPb49CXKSf42wkJbrBPkeypVa8I+XDxijvFuywo6TJBX/ILPrdrlE/FW9vJZh6Rf9vA==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.5.0", - "@jest/test-result": "^26.5.0", - "@jest/transform": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/console": "^26.5.2", + "@jest/test-result": "^26.5.2", + "@jest/transform": "^26.5.2", + "@jest/types": "^26.5.2", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", @@ -774,9 +951,9 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.5.0", - "jest-resolve": "^26.5.0", - "jest-util": "^26.5.0", + "jest-haste-map": "^26.5.2", + "jest-resolve": "^26.5.2", + "jest-util": "^26.5.2", "jest-worker": "^26.5.0", "node-notifier": "^8.0.0", "slash": "^3.0.0", @@ -863,46 +1040,46 @@ } }, "@jest/test-result": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.5.0.tgz", - "integrity": "sha512-CaVXxDQi31LPOsz5/+iajNHQlA1Je/jQ8uYH/lCa6Y/UrkO+sDHeEH3x/inbx06PctVDnTwIlCcBvNNbC4FCvQ==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.5.2.tgz", + "integrity": "sha512-E/Zp6LURJEGSCWpoMGmCFuuEI1OWuI3hmZwmULV0GsgJBh7u0rwqioxhRU95euUuviqBDN8ruX/vP/4bwYolXw==", "dev": true, "requires": { - "@jest/console": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/console": "^26.5.2", + "@jest/types": "^26.5.2", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.5.0.tgz", - "integrity": "sha512-23oofRXqPEy37HyHWIYf7lzzOqtGBkai5erZiL6RgxlyXE7a0lCihf6b5DfAvcD3yUtbXmh3EzpjJDVH57zQrg==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.5.2.tgz", + "integrity": "sha512-XmGEh7hh07H2B8mHLFCIgr7gA5Y6Hw1ZATIsbz2fOhpnQ5AnQtZk0gmP0Q5/+mVB2xygO64tVFQxOajzoptkNA==", "dev": true, "requires": { - "@jest/test-result": "^26.5.0", + "@jest/test-result": "^26.5.2", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.5.0", - "jest-runner": "^26.5.0", - "jest-runtime": "^26.5.0" + "jest-haste-map": "^26.5.2", + "jest-runner": "^26.5.2", + "jest-runtime": "^26.5.2" } }, "@jest/transform": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.5.0.tgz", - "integrity": "sha512-Kt4WciOruTyTkJ2DZ+xtZiejRj3v22BrXCYZoGRbI0N6Q6tt2HdsWrrEtn6nlK24QWKC389xKkVk4Xr2gWBZQA==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.5.2.tgz", + "integrity": "sha512-AUNjvexh+APhhmS8S+KboPz+D3pCxPvEAGduffaAJYxIFxGi/ytZQkrqcKDUU0ERBAo5R7087fyOYr2oms1seg==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "babel-plugin-istanbul": "^6.0.0", "chalk": "^4.0.0", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.5.0", + "jest-haste-map": "^26.5.2", "jest-regex-util": "^26.0.0", - "jest-util": "^26.5.0", + "jest-util": "^26.5.2", "micromatch": "^4.0.2", "pirates": "^4.0.1", "slash": "^3.0.0", @@ -1011,9 +1188,9 @@ } }, "@jest/types": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.5.0.tgz", - "integrity": "sha512-nH9DFLqaIhB+RVgjivemvMiFSWw/BKwbZGxBAMv8CCTvUyFoK8RwHhAlmlXIvMBrf5Z3YQ4p9cq3Qh9EDctGvA==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.5.2.tgz", + "integrity": "sha512-QDs5d0gYiyetI8q+2xWdkixVQMklReZr4ltw7GFDtb4fuJIBCE6mzj2LnitGqCuAlLap6wPyb8fpoHgwZz5fdg==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", @@ -1988,13 +2165,13 @@ "dev": true }, "babel-jest": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.5.0.tgz", - "integrity": "sha512-Cy16ZJrds81C+JASaOIGNlpCeqW3PTOq36owv+Zzwde5NiWz+zNduwxUNF57vxc/3SnIWo8HHqTczhN8GLoXTw==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.5.2.tgz", + "integrity": "sha512-U3KvymF3SczA3vOL/cgiUFOznfMET+XDIXiWnoJV45siAp2pLMG8i2+/MGZlAC3f/F6Q40LR4M4qDrWZ9wkK8A==", "dev": true, "requires": { - "@jest/transform": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/transform": "^26.5.2", + "@jest/types": "^26.5.2", "@types/babel__core": "^7.1.7", "babel-plugin-istanbul": "^6.0.0", "babel-preset-jest": "^26.5.0", @@ -3330,16 +3507,16 @@ } }, "expect": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.5.0.tgz", - "integrity": "sha512-oIOy3mHWjnF5ZICuaui5kdtJZQ+D7XHWyUQDxk1WhIRCkcIYc24X23bOfikgCNU6i9wcSqLQhwPOqeRp09naxg==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.5.2.tgz", + "integrity": "sha512-ccTGrXZd8DZCcvCz4htGXTkd/LOoy6OEtiDS38x3/VVf6E4AQL0QoeksBiw7BtGR5xDNiRYPB8GN6pfbuTOi7w==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "ansi-styles": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.5.0", - "jest-message-util": "^26.5.0", + "jest-matcher-utils": "^26.5.2", + "jest-message-util": "^26.5.2", "jest-regex-util": "^26.0.0" }, "dependencies": { @@ -4618,12 +4795,12 @@ "dev": true }, "jest-changed-files": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.5.0.tgz", - "integrity": "sha512-RAHoXqxa7gO1rZz88qpsLpzJ2mQU12UaFWadacKHuMbBZwFK+yl0j9YoD9Y/wBpv1ILG2SdCuxFHggX+9VU7qA==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.5.2.tgz", + "integrity": "sha512-qSmssmiIdvM5BWVtyK/nqVpN3spR5YyvkvPqz1x3BR1bwIxsWmU/MGwLoCrPNLbkG2ASAKfvmJpOduEApBPh2w==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "execa": "^4.0.0", "throat": "^5.0.0" }, @@ -4728,24 +4905,24 @@ } }, "jest-cli": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.5.0.tgz", - "integrity": "sha512-bI0h6GQGbyN0SSZu3nPilwrkrZ8dBC93erwTiEoJ+kGjtNuXsB183hTZ0HCiHLzf88oE0SQB1hYp8RgyytH+Bg==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.5.2.tgz", + "integrity": "sha512-usm48COuUvRp8YEG5OWOaxbSM0my7eHn3QeBWxiGUuFhvkGVBvl1fic4UjC02EAEQtDv8KrNQUXdQTV6ZZBsoA==", "dev": true, "requires": { - "@jest/core": "^26.5.0", - "@jest/test-result": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/core": "^26.5.2", + "@jest/test-result": "^26.5.2", + "@jest/types": "^26.5.2", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", "import-local": "^3.0.2", "is-ci": "^2.0.0", - "jest-config": "^26.5.0", - "jest-util": "^26.5.0", - "jest-validate": "^26.5.0", + "jest-config": "^26.5.2", + "jest-util": "^26.5.2", + "jest-validate": "^26.5.2", "prompts": "^2.0.1", - "yargs": "^16.0.3" + "yargs": "^15.4.1" }, "dependencies": { "ansi-styles": { @@ -4767,17 +4944,6 @@ "supports-color": "^7.1.0" } }, - "cliui": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.1.tgz", - "integrity": "sha512-rcvHOWyGyid6I1WjT/3NatKj2kDt9OdSHSXpyLXaMWFbKpGACNW8pRhhdPUq9MWUOdwn8Rz9AVETjF4105rZZQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -4807,71 +4973,33 @@ "requires": { "has-flag": "^4.0.0" } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.2.tgz", - "integrity": "sha512-CkwaeZw6dQgqgPGeTWKMXCRmMcBgETFlTml1+ZOO+q7kGst8NREJ+eWwFNPVUQ4QGdAaklbqCZHH6Zuep1RjiA==", - "dev": true - }, - "yargs": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.0.3.tgz", - "integrity": "sha512-6+nLw8xa9uK1BOEOykaiYAJVh6/CjxWXK/q9b5FpRgNslt8s22F2xMBqVIKgCRjNgGvGPBy8Vog7WN7yh4amtA==", - "dev": true, - "requires": { - "cliui": "^7.0.0", - "escalade": "^3.0.2", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.1", - "yargs-parser": "^20.0.0" - } - }, - "yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-yYsjuSkjbLMBp16eaOt7/siKTjNVjMm3SoJnIg3sEh/JsvqVVDyjRKmaJV4cl+lNIgq6QEco2i3gDebJl7/vLA==", - "dev": true } } }, "jest-config": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.5.0.tgz", - "integrity": "sha512-OM6eXIEmQXAuonCk8aNPMRjPFcKWa3IIoSlq5BPgIflmQBzM/COcI7XsWSIEPWPa9WcYTJBWj8kNqEYjczmIFw==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.5.2.tgz", + "integrity": "sha512-dqJOnSegNdE5yDiuGHsjTM5gec7Z4AcAMHiW+YscbOYJAlb3LEtDSobXCq0or9EmGQI5SFmKy4T7P1FxetJOfg==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.5.0", - "@jest/types": "^26.5.0", - "babel-jest": "^26.5.0", + "@jest/test-sequencer": "^26.5.2", + "@jest/types": "^26.5.2", + "babel-jest": "^26.5.2", "chalk": "^4.0.0", "deepmerge": "^4.2.2", "glob": "^7.1.1", "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.5.0", - "jest-environment-node": "^26.5.0", + "jest-environment-jsdom": "^26.5.2", + "jest-environment-node": "^26.5.2", "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.5.0", + "jest-jasmine2": "^26.5.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.5.0", - "jest-util": "^26.5.0", - "jest-validate": "^26.5.0", + "jest-resolve": "^26.5.2", + "jest-util": "^26.5.2", + "jest-validate": "^26.5.2", "micromatch": "^4.0.2", - "pretty-format": "^26.5.0" + "pretty-format": "^26.5.2" }, "dependencies": { "ansi-styles": { @@ -4969,15 +5097,15 @@ } }, "jest-diff": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.5.0.tgz", - "integrity": "sha512-CmDMMPkVMxrrh0Dv/4M9kh1tsYsZnYTQMMTvIFpePBSk9wMVfcyfg30TCq+oR9AzGbw8vsI50Gk1HmlMMlhoJg==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.5.2.tgz", + "integrity": "sha512-HCSWDUGwsov5oTlGzrRM+UPJI/Dpqi9jzeV0fdRNi3Ch5bnoXhnyJMmVg2juv9081zLIy3HGPI5mcuGgXM2xRA==", "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^26.5.0", "jest-get-type": "^26.3.0", - "pretty-format": "^26.5.0" + "pretty-format": "^26.5.2" }, "dependencies": { "ansi-styles": { @@ -5041,16 +5169,16 @@ } }, "jest-each": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.5.0.tgz", - "integrity": "sha512-+oO3ykDgypHSyyK2xOsh8XDUwMtg3HoJ4wMNFNHxhcACFbUgaCOfLy+eTCn5pIKhtigU3BmkYt7k3MtTb5pJOQ==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.5.2.tgz", + "integrity": "sha512-w7D9FNe0m2D3yZ0Drj9CLkyF/mGhmBSULMQTypzAKR746xXnjUrK8GUJdlLTWUF6dd0ks3MtvGP7/xNFr9Aphg==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-util": "^26.5.0", - "pretty-format": "^26.5.0" + "jest-util": "^26.5.2", + "pretty-format": "^26.5.2" }, "dependencies": { "ansi-styles": { @@ -5105,32 +5233,32 @@ } }, "jest-environment-jsdom": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.5.0.tgz", - "integrity": "sha512-Xuqh3bx8egymaJR566ECkiztIIVOIWWPGIxo++ziWyCOqQChUguRCH1hRXBbfINPbb/SRFe7GCD+SunaUgTmCw==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.5.2.tgz", + "integrity": "sha512-fWZPx0bluJaTQ36+PmRpvUtUlUFlGGBNyGX1SN3dLUHHMcQ4WseNEzcGGKOw4U5towXgxI4qDoI3vwR18H0RTw==", "dev": true, "requires": { - "@jest/environment": "^26.5.0", - "@jest/fake-timers": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/environment": "^26.5.2", + "@jest/fake-timers": "^26.5.2", + "@jest/types": "^26.5.2", "@types/node": "*", - "jest-mock": "^26.5.0", - "jest-util": "^26.5.0", + "jest-mock": "^26.5.2", + "jest-util": "^26.5.2", "jsdom": "^16.4.0" } }, "jest-environment-node": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.5.0.tgz", - "integrity": "sha512-LaYl/ek5mb1VDP1/+jMH2N1Ec4fFUhSYmc8EZqigBgMov/2US8U5l7D3IlOf78e+wARUxPxUpTcybVVzAOu3jg==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.5.2.tgz", + "integrity": "sha512-YHjnDsf/GKFCYMGF1V+6HF7jhY1fcLfLNBDjhAOvFGvt6d8vXvNdJGVM7uTZ2VO/TuIyEFhPGaXMX5j3h7fsrA==", "dev": true, "requires": { - "@jest/environment": "^26.5.0", - "@jest/fake-timers": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/environment": "^26.5.2", + "@jest/fake-timers": "^26.5.2", + "@jest/types": "^26.5.2", "@types/node": "*", - "jest-mock": "^26.5.0", - "jest-util": "^26.5.0" + "jest-mock": "^26.5.2", + "jest-util": "^26.5.2" } }, "jest-get-type": { @@ -5140,12 +5268,12 @@ "dev": true }, "jest-haste-map": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.5.0.tgz", - "integrity": "sha512-AjB1b53uqN7Cf2VN80x0wJajVZ+BMZC+G2CmWoG143faaMw7IhIcs3FTPuSgOx7cn3/bag7lgCq93naAvLO6EQ==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.5.2.tgz", + "integrity": "sha512-lJIAVJN3gtO3k4xy+7i2Xjtwh8CfPcH08WYjZpe9xzveDaqGw9fVNCpkYu6M525wKFVkLmyi7ku+DxCAP1lyMA==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "@types/graceful-fs": "^4.1.2", "@types/node": "*", "anymatch": "^3.0.3", @@ -5154,7 +5282,7 @@ "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.5.0", - "jest-util": "^26.5.0", + "jest-util": "^26.5.2", "jest-worker": "^26.5.0", "micromatch": "^4.0.2", "sane": "^4.0.3", @@ -5207,28 +5335,28 @@ } }, "jest-jasmine2": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.5.0.tgz", - "integrity": "sha512-NOA6PLORHTRTROOp5VysKCUVpFAjMMXUS1Xw7FvTMeYK5Ewx4rpxhFqiJ7JT4pENap9g9OuXo4cWR/MwCDTEeQ==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.5.2.tgz", + "integrity": "sha512-2J+GYcgLVPTkpmvHEj0/IDTIAuyblGNGlyGe4fLfDT2aktEPBYvoxUwFiOmDDxxzuuEAD2uxcYXr0+1Yw4tjFA==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.5.0", + "@jest/environment": "^26.5.2", "@jest/source-map": "^26.5.0", - "@jest/test-result": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/test-result": "^26.5.2", + "@jest/types": "^26.5.2", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "expect": "^26.5.0", + "expect": "^26.5.2", "is-generator-fn": "^2.0.0", - "jest-each": "^26.5.0", - "jest-matcher-utils": "^26.5.0", - "jest-message-util": "^26.5.0", - "jest-runtime": "^26.5.0", - "jest-snapshot": "^26.5.0", - "jest-util": "^26.5.0", - "pretty-format": "^26.5.0", + "jest-each": "^26.5.2", + "jest-matcher-utils": "^26.5.2", + "jest-message-util": "^26.5.2", + "jest-runtime": "^26.5.2", + "jest-snapshot": "^26.5.2", + "jest-util": "^26.5.2", + "pretty-format": "^26.5.2", "throat": "^5.0.0" }, "dependencies": { @@ -5284,25 +5412,25 @@ } }, "jest-leak-detector": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.5.0.tgz", - "integrity": "sha512-xZHvvTBbj3gUTtunLjPqP594BT6IUEpwA0AQpEQjVR8eBq8+R3qgU/KhoAcVcV0iqRM6pXtX7hKPZ5mLdynVSQ==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.5.2.tgz", + "integrity": "sha512-h7ia3dLzBFItmYERaLPEtEKxy3YlcbcRSjj0XRNJgBEyODuu+3DM2o62kvIFvs3PsaYoIIv+e+nLRI61Dj1CNw==", "dev": true, "requires": { "jest-get-type": "^26.3.0", - "pretty-format": "^26.5.0" + "pretty-format": "^26.5.2" } }, "jest-matcher-utils": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.5.0.tgz", - "integrity": "sha512-QgbbxqFT8wiTi4o/7MWj2vHlcmMjACG8vnJ9pJ7svVDmkzEnTUGdHXWLKB1aZhbnyXetMNRF+TSMcDS9aGfuzA==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.5.2.tgz", + "integrity": "sha512-W9GO9KBIC4gIArsNqDUKsLnhivaqf8MSs6ujO/JDcPIQrmY+aasewweXVET8KdrJ6ADQaUne5UzysvF/RR7JYA==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^26.5.0", + "jest-diff": "^26.5.2", "jest-get-type": "^26.3.0", - "pretty-format": "^26.5.0" + "pretty-format": "^26.5.2" }, "dependencies": { "ansi-styles": { @@ -5357,13 +5485,13 @@ } }, "jest-message-util": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.5.0.tgz", - "integrity": "sha512-UEOqdoTfX0AFyReL4q5N3CfDBWt+AtQzeszZuuGapU39vwEk90rTSBghCA/3FFEZzvGfH2LE4+0NaBI81Cu2Ow==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.5.2.tgz", + "integrity": "sha512-Ocp9UYZ5Jl15C5PNsoDiGEk14A4NG0zZKknpWdZGoMzJuGAkVt10e97tnEVMYpk7LnQHZOfuK2j/izLBMcuCZw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", @@ -5467,12 +5595,12 @@ } }, "jest-mock": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.5.0.tgz", - "integrity": "sha512-8D1UmbnmjdkvTdYygTW26KZr95Aw0/3gEmMZQWkxIEAgEESVDbwDG8ygRlXSY214x9hFjtKezvfQUp36Ogl75w==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.5.2.tgz", + "integrity": "sha512-9SiU4b5PtO51v0MtJwVRqeGEroH66Bnwtq4ARdNP7jNXbpT7+ByeWNAk4NeT/uHfNSVDXEXgQo1XRuwEqS6Rdw==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "@types/node": "*" } }, @@ -5489,17 +5617,17 @@ "dev": true }, "jest-resolve": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.5.0.tgz", - "integrity": "sha512-c34L8Lrw4fFzRiCLzwePziKRfHitjsAnY15ID0e9Se4ISikmZ5T9icLEFAGHnfaxfb+9r8EKdrbg89gjRdrQvw==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.5.2.tgz", + "integrity": "sha512-XsPxojXGRA0CoDD7Vis59ucz2p3cQFU5C+19tz3tLEAlhYKkK77IL0cjYjikY9wXnOaBeEdm1rOgSJjbZWpcZg==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "chalk": "^4.0.0", - "escalade": "^3.1.0", "graceful-fs": "^4.2.4", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.5.0", + "jest-util": "^26.5.2", + "read-pkg-up": "^7.0.1", "resolve": "^1.17.0", "slash": "^3.0.0" }, @@ -5556,39 +5684,39 @@ } }, "jest-resolve-dependencies": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.5.0.tgz", - "integrity": "sha512-2e3YdS+dlTY00s0CEiMAa7Ap/mPfPaQV7d6Fzp7BQqHXO/2QhXn/yVTxnxR+dOIo/NOh7pqXZTQSn+2iWwPQQA==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.5.2.tgz", + "integrity": "sha512-LLkc8LuRtxqOx0AtX/Npa2C4I23WcIrwUgNtHYXg4owYF/ZDQShcwBAHjYZIFR06+HpQcZ43+kCTMlQ3aDCYTg==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.5.0" + "jest-snapshot": "^26.5.2" } }, "jest-runner": { - "version": "26.5.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.5.1.tgz", - "integrity": "sha512-gFHXehvMZD8qwNzaIl2MDFFI99m4kKk06H2xh2u4IkC+tHYIJjE5J175l9cbL3RuU2slfS2m57KZgcPZfbTavQ==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.5.2.tgz", + "integrity": "sha512-GKhYxtSX5+tXZsd2QwfkDqPIj5C2HqOdXLRc2x2qYqWE26OJh17xo58/fN/mLhRkO4y6o60ZVloan7Kk5YA6hg==", "dev": true, "requires": { - "@jest/console": "^26.5.0", - "@jest/environment": "^26.5.0", - "@jest/test-result": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/console": "^26.5.2", + "@jest/environment": "^26.5.2", + "@jest/test-result": "^26.5.2", + "@jest/types": "^26.5.2", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.7.1", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-config": "^26.5.0", + "jest-config": "^26.5.2", "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.5.0", - "jest-leak-detector": "^26.5.0", - "jest-message-util": "^26.5.0", - "jest-resolve": "^26.5.0", - "jest-runtime": "^26.5.0", - "jest-util": "^26.5.0", + "jest-haste-map": "^26.5.2", + "jest-leak-detector": "^26.5.2", + "jest-message-util": "^26.5.2", + "jest-resolve": "^26.5.2", + "jest-runtime": "^26.5.2", + "jest-util": "^26.5.2", "jest-worker": "^26.5.0", "source-map-support": "^0.5.6", "throat": "^5.0.0" @@ -5646,37 +5774,37 @@ } }, "jest-runtime": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.5.0.tgz", - "integrity": "sha512-CujjQWpMcsvSg0L+G3iEz6s7Th5IbiZseAaw/5R7Eb+IfnJdyPdjJ+EoXNV8n07snvW5nZTwV9QIfy6Vjris8A==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.5.2.tgz", + "integrity": "sha512-zArr4DatX/Sn0wswX/AnAuJgmwgAR5rNtrUz36HR8BfMuysHYNq5sDbYHuLC4ICyRdy5ae/KQ+sczxyS9G6Qvw==", "dev": true, "requires": { - "@jest/console": "^26.5.0", - "@jest/environment": "^26.5.0", - "@jest/fake-timers": "^26.5.0", - "@jest/globals": "^26.5.0", + "@jest/console": "^26.5.2", + "@jest/environment": "^26.5.2", + "@jest/fake-timers": "^26.5.2", + "@jest/globals": "^26.5.2", "@jest/source-map": "^26.5.0", - "@jest/test-result": "^26.5.0", - "@jest/transform": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/test-result": "^26.5.2", + "@jest/transform": "^26.5.2", + "@jest/types": "^26.5.2", "@types/yargs": "^15.0.0", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.2.4", - "jest-config": "^26.5.0", - "jest-haste-map": "^26.5.0", - "jest-message-util": "^26.5.0", - "jest-mock": "^26.5.0", + "jest-config": "^26.5.2", + "jest-haste-map": "^26.5.2", + "jest-message-util": "^26.5.2", + "jest-mock": "^26.5.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.5.0", - "jest-snapshot": "^26.5.0", - "jest-util": "^26.5.0", - "jest-validate": "^26.5.0", + "jest-resolve": "^26.5.2", + "jest-snapshot": "^26.5.2", + "jest-util": "^26.5.2", + "jest-validate": "^26.5.2", "slash": "^3.0.0", "strip-bom": "^4.0.0", - "yargs": "^16.0.3" + "yargs": "^15.4.1" }, "dependencies": { "ansi-styles": { @@ -5698,17 +5826,6 @@ "supports-color": "^7.1.0" } }, - "cliui": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.1.tgz", - "integrity": "sha512-rcvHOWyGyid6I1WjT/3NatKj2kDt9OdSHSXpyLXaMWFbKpGACNW8pRhhdPUq9MWUOdwn8Rz9AVETjF4105rZZQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -5738,44 +5855,6 @@ "requires": { "has-flag": "^4.0.0" } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.2.tgz", - "integrity": "sha512-CkwaeZw6dQgqgPGeTWKMXCRmMcBgETFlTml1+ZOO+q7kGst8NREJ+eWwFNPVUQ4QGdAaklbqCZHH6Zuep1RjiA==", - "dev": true - }, - "yargs": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.0.3.tgz", - "integrity": "sha512-6+nLw8xa9uK1BOEOykaiYAJVh6/CjxWXK/q9b5FpRgNslt8s22F2xMBqVIKgCRjNgGvGPBy8Vog7WN7yh4amtA==", - "dev": true, - "requires": { - "cliui": "^7.0.0", - "escalade": "^3.0.2", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.1", - "yargs-parser": "^20.0.0" - } - }, - "yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-yYsjuSkjbLMBp16eaOt7/siKTjNVjMm3SoJnIg3sEh/JsvqVVDyjRKmaJV4cl+lNIgq6QEco2i3gDebJl7/vLA==", - "dev": true } } }, @@ -5790,26 +5869,26 @@ } }, "jest-snapshot": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.5.0.tgz", - "integrity": "sha512-WTNJef67o7cCvwAe5foVCNqG3MzIW/CyU4FZvMrhBPZsJeXwfBY7kfOlydZigxtcytnvmNE2pqznOfD5EcQgrQ==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.5.2.tgz", + "integrity": "sha512-MkXIDvEefzDubI/WaDVSRH4xnkuirP/Pz8LhAIDXcVQTmcEfwxywj5LGwBmhz+kAAIldA7XM4l96vbpzltSjqg==", "dev": true, "requires": { "@babel/types": "^7.0.0", - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "@types/babel__traverse": "^7.0.4", "@types/prettier": "^2.0.0", "chalk": "^4.0.0", - "expect": "^26.5.0", + "expect": "^26.5.2", "graceful-fs": "^4.2.4", - "jest-diff": "^26.5.0", + "jest-diff": "^26.5.2", "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.5.0", - "jest-matcher-utils": "^26.5.0", - "jest-message-util": "^26.5.0", - "jest-resolve": "^26.5.0", + "jest-haste-map": "^26.5.2", + "jest-matcher-utils": "^26.5.2", + "jest-message-util": "^26.5.2", + "jest-resolve": "^26.5.2", "natural-compare": "^1.4.0", - "pretty-format": "^26.5.0", + "pretty-format": "^26.5.2", "semver": "^7.3.2" }, "dependencies": { @@ -5871,12 +5950,12 @@ } }, "jest-util": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.5.0.tgz", - "integrity": "sha512-CSQ0uzE7JdHDCQo3K8jlyWRIF2xNLdpu9nbjo8okGDanaNsF7WonhusFvjOg7QiWn1SThe7wFRh8Jx2ls1Gx4Q==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.5.2.tgz", + "integrity": "sha512-WTL675bK+GSSAYgS8z9FWdCT2nccO1yTIplNLPlP0OD8tUk/H5IrWKMMRudIQQ0qp8bb4k+1Qa8CxGKq9qnYdg==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "@types/node": "*", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", @@ -5979,17 +6058,17 @@ } }, "jest-validate": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.5.0.tgz", - "integrity": "sha512-603+CHUJD4nAZ+tY/A+wu3g8KEcBey2a7YOMU9W8e4u7mCezhaDasw20ITaZHoR2R2MZhThL6jApPSj0GvezrQ==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.5.2.tgz", + "integrity": "sha512-FmJks0zY36mp6Af/5sqO6CTL9bNMU45yKCJk3hrz8d2aIqQIlN1pr9HPIwZE8blLaewOla134nt5+xAmWsx3SQ==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "camelcase": "^6.0.0", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", "leven": "^3.1.0", - "pretty-format": "^26.5.0" + "pretty-format": "^26.5.2" }, "dependencies": { "ansi-styles": { @@ -6050,17 +6129,17 @@ } }, "jest-watcher": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.5.0.tgz", - "integrity": "sha512-INLKhpc9QbO5zy2HkS1CJUncByrCLFDZQOY30d9ojiuGO02ofL1BygDRDRtFvT/oWSZ8Y0fbkrr1oXU2ay/MqA==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.5.2.tgz", + "integrity": "sha512-i3m1NtWzF+FXfJ3ljLBB/WQEp4uaNhX7QcQUWMokcifFTUQBDFyUMEwk0JkJ1kopHbx7Een3KX0Q7+9koGM/Pw==", "dev": true, "requires": { - "@jest/test-result": "^26.5.0", - "@jest/types": "^26.5.0", + "@jest/test-result": "^26.5.2", + "@jest/types": "^26.5.2", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "jest-util": "^26.5.0", + "jest-util": "^26.5.2", "string-length": "^4.0.1" }, "dependencies": { @@ -10962,12 +11041,12 @@ "dev": true }, "pretty-format": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.5.0.tgz", - "integrity": "sha512-NcgRuuTutUJ9+Br4P19DFThpJYnYBiugfRmZEA6pXrUeG+IcMSmppb88rU+iPA+XAJcjTYlCb5Ed6miHg/Qqqw==", + "version": "26.5.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.5.2.tgz", + "integrity": "sha512-VizyV669eqESlkOikKJI8Ryxl/kPpbdLwNdPs2GrbQs18MpySB5S0Yo0N7zkg2xTRiFq4CFw8ct5Vg4a0xP0og==", "dev": true, "requires": { - "@jest/types": "^26.5.0", + "@jest/types": "^26.5.2", "ansi-regex": "^5.0.0", "ansi-styles": "^4.0.0", "react-is": "^16.12.0" diff --git a/package.json b/package.json index eb23d19..13f196b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "clean": "rimraf ./build", "build": "run build:*", "build:dir": "mkdir -p ./build/pkg/", - "build:fnk": "fnk --src ./src --out-dir ./build/pkg --ignore '**/*.test.fnk'", + "build:fnk": "fnk --module-type cjs --src ./src --out-dir ./build/pkg --ignore '**/*.test.fnk'", "build:files": "cp package.json ./README.md ./LICENSE ./build/pkg/", "test": "run jest", "jest": "jest --verbose --runInBand --no-cache ", @@ -36,13 +36,13 @@ } }, "devDependencies": { - "@fink/cli": "^6.2.1", - "@fink/jest": "^5.4.0", + "@fink/cli": "^7.0.0", + "@fink/jest": "^6.0.0", "@fink/larix": "^12.3.0", - "@fink/loxia": "^12.4.0", + "@fink/loxia": "^13.0.1", "commitizen": "^4.1.2", "cz-conventional-changelog": "^3.1.0", - "jest-cli": "^26.1.0", + "jest-cli": "^26.5.2", "npx-run": "^2.1.2", "semantic-release": "^17.1.2" }, @@ -50,8 +50,8 @@ "@babel/core": "^7.10.5", "@babel/traverse": "^7.10.5", "@babel/types": "^7.10.5", - "@fink/js-interop": "^1.1.1", - "@fink/std-lib": "^4.0.1", - "@fink/snippet": "^1.0.0" + "@fink/js-interop": "^2.0.0", + "@fink/std-lib": "^5.0.0", + "@fink/snippet": "^2.0.0" } } diff --git a/src/index.fnk b/src/index.fnk index e99c407..01b07f9 100644 --- a/src/index.fnk +++ b/src/index.fnk @@ -1,12 +1,12 @@ {default: traverse} = import '@babel/traverse' {transformFromAstSync} = import '@babel/core' -{is_empty} = import '@fink/std-lib/iter' +{is_empty} = import '@fink/std-lib/iter.fnk' -{transform_ast} = import './lang' +{transform_ast} = import './lang/index.fnk' -{transform_do_expr} = import './js/do-expression' -{transform_async} = import './js/async' -{module_transforms} = import './js/module' +{transform_do_expr} = import './js/do-expression.fnk' +{transform_async} = import './js/async.fnk' +{module_transforms} = import './js/module.fnk' diff --git a/src/index.test.fnk b/src/index.test.fnk index 630d0cd..d16b399 100644 --- a/src/index.test.fnk +++ b/src/index.test.fnk @@ -1,8 +1,9 @@ -{describe, it, expect, to_equal, to_match_snapshot} = import '@fink/jest' -{slice} = import '@fink/std-lib/str' +{describe, it, expect, to_equal, to_match_snapshot} = import '@fink/jest/test.fnk' +{slice} = import '@fink/std-lib/str.fnk' + +{generate} = import './index.fnk' +{fink2js} = import './testing/index.fnk' -{generate} = import '.' -{fink2js} = import './testing' describe 'module types', fn: diff --git a/src/js/async.fnk b/src/js/async.fnk index 3724557..505fe30 100644 --- a/src/js/async.fnk +++ b/src/js/async.fnk @@ -1,5 +1,5 @@ {isArrowFunctionExpression, isFunctionExpression, isForOfStatement} = import '@babel/types' -{set_props} = import '@fink/js-interop/reflect' +{set_props} = import '@fink/js-interop/reflect.fnk' [no_result] = [] diff --git a/src/js/do-expression.fnk b/src/js/do-expression.fnk index e015a52..a1696ff 100644 --- a/src/js/do-expression.fnk +++ b/src/js/do-expression.fnk @@ -4,21 +4,23 @@ isVariableDeclarator, isArrowFunctionExpression, isExpressionStatement isReturnStatement, arrowFunctionExpression, callExpression } = import '@babel/types' -{set_props} = import '@fink/js-interop/reflect' -{undefined} = import '@fink/js-interop/nullish' -{is_empty} = import '@fink/std-lib/iter' -{wrap_with_comment_loc} = import '../lang/comments' +{set_props} = import '@fink/js-interop/reflect.fnk' +{undefined} = import '@fink/js-interop/nullish.fnk' +{is_empty} = import '@fink/std-lib/iter.fnk' +{wrap_with_comment_loc} = import '../lang/comments/index.fnk' +{lets, assign, undef} = import './types.fnk' -{lets, assign, undef} = import './types' get_body = fn path: path.get 'body' + # TODO: suport _ or nothing instead of having to use item consume_all = fold item: undefined + simple = fn body, sl=false: match body: isBlockStatement ?: @@ -41,6 +43,7 @@ simple = fn body, sl=false: body.node + last_expressions = fn path: match path: isDoExpression ?: @@ -90,6 +93,7 @@ last_expressions = fn path: ...last_expressions body + replace_with_return = fn path: pipe last_expressions path: map expr: @@ -115,6 +119,7 @@ replace_with_return = fn path: consume_all + replace_with_assign = fn target, path: id = path.parentPath.scope.generateUidIdentifier 'do_result' #TODO: don't mutate @@ -135,6 +140,7 @@ replace_with_assign = fn target, path: consume_all + transform_do_expr = fn path: {parentPath: parent} = path diff --git a/src/js/identifier.fnk b/src/js/identifier.fnk index 304a855..8e35d91 100644 --- a/src/js/identifier.fnk +++ b/src/js/identifier.fnk @@ -1,8 +1,8 @@ -{char_code, slice} = import '@fink/std-lib/str' -{rx , matches} = import '@fink/std-lib/regex' +{char_code, slice} = import '@fink/std-lib/str.fnk' +{rx , matches} = import '@fink/std-lib/regex.fnk' +{length} = import '@fink/std-lib/iter.fnk' +{base_n} = import '@fink/std-lib/num.fnk' -{length} = import '@fink/std-lib/iter' -{base_n} = import '@fink/std-lib/num' check_ident = rx' @@ -15,11 +15,13 @@ check_ident = rx' [_$\p{L}][_$\p{L}\p{N}]*$' + var_prefix = 'ˆ' str_36 = base_n ?, 36 + replace_chars = fn name, idx=0: prefixed_name = '${var_prefix}${name}' @@ -36,6 +38,7 @@ replace_chars = fn name, idx=0: replace_chars new_name, idx + length char_replacement + escape_ident = fn name: match name: matches ?, check_ident: diff --git a/src/js/types.fnk b/src/js/types.fnk index 6ada8ee..0d11a5f 100644 --- a/src/js/types.fnk +++ b/src/js/types.fnk @@ -6,10 +6,10 @@ logicalExpression, binaryExpression, unaryExpression doExpression, assignmentExpression, isIdentifier } = import'@babel/types' -{is_empty} = import '@fink/std-lib/iter' +{is_empty} = import '@fink/std-lib/iter.fnk' -{escape_ident} = import'./identifier' +{escape_ident} = import'./identifier.fnk' wrap = fn larix_node, js_node: diff --git a/src/lang/arithmitic/index.fnk b/src/lang/arithmitic/index.fnk index 1326f3b..babe9bd 100644 --- a/src/lang/arithmitic/index.fnk +++ b/src/lang/arithmitic/index.fnk @@ -1,5 +1,5 @@ {binaryExpression, unaryExpression} = import '@babel/types' -{add, any} = import '../context' +{add, any} = import '../context.fnk' transform_op = dict: diff --git a/src/lang/arithmitic/index.test.fnk b/src/lang/arithmitic/index.test.fnk index 8368127..bcfee37 100644 --- a/src/lang/arithmitic/index.test.fnk +++ b/src/lang/arithmitic/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'binary', fn: diff --git a/src/lang/assignment/index.fnk b/src/lang/assignment/index.fnk index 53838df..c8af3a7 100644 --- a/src/lang/assignment/index.fnk +++ b/src/lang/assignment/index.fnk @@ -4,13 +4,13 @@ memberExpression, identifier, expressionStatement, arrayPattern, restElement numericLiteral } = import '@babel/types' -{length, is_empty} = import '@fink/std-lib/iter' -{wrap_with_comment_loc} = import '../comments' +{length, is_empty} = import '@fink/std-lib/iter.fnk' +{wrap_with_comment_loc} = import '../comments/index.fnk' -{transform_left} = import '../../js/left' -{add, any} = import '../context' -{transform_value} = import '../partial' +{transform_left} = import '../../js/left.fnk' +{add, any} = import '../context.fnk' +{transform_value} = import '../partial/index.fnk' # TODO: std-lib @@ -20,7 +20,7 @@ find_index = fn iterable, func: has_spread_not_last = fn {left}: match left: - {type: 'array', exprs: 1 < length ?}: + {type: ? in ['array', 'list'], exprs: 1 < length ?}: idx = find_index left.exprs, fn expr: match expr: {type: 'spread'}: true @@ -50,10 +50,10 @@ transform_spread_left = fn {left}, {transform}: exprs = match before: is_empty ?: # TODO missing loc - [middle, {type: 'array', exprs: end}] + [middle, {type: 'list', exprs: end}] else: # TODO missing loc - [{type: 'array', exprs: before}, middle, {type: 'array', exprs: end}] + [{type: 'list', exprs: before}, middle, {type: 'list', exprs: end}] transform_left transform {...left, exprs} diff --git a/src/lang/assignment/index.test.fnk b/src/lang/assignment/index.test.fnk index a95ed56..820eb08 100644 --- a/src/lang/assignment/index.test.fnk +++ b/src/lang/assignment/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'assignment', fn: diff --git a/src/lang/async/index.fnk b/src/lang/async/index.fnk index 963fa20..61c2381 100644 --- a/src/lang/async/index.fnk +++ b/src/lang/async/index.fnk @@ -1,5 +1,5 @@ {awaitExpression} = import '@babel/types' -{add, any} = import '../context' +{add, any} = import '../context.fnk' transform_await = fn node, {transform}: diff --git a/src/lang/async/index.test.fnk b/src/lang/async/index.test.fnk index bbef3d1..ad78ff0 100644 --- a/src/lang/async/index.test.fnk +++ b/src/lang/async/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'await', fn: diff --git a/src/lang/block/index.fnk b/src/lang/block/index.fnk index 138d053..693b596 100644 --- a/src/lang/block/index.fnk +++ b/src/lang/block/index.fnk @@ -2,10 +2,10 @@ doExpression, blockStatement, isAssignmentExpression, expressionStatement variableDeclaration, variableDeclarator } = import '@babel/types' -{length} = import '@fink/std-lib/iter' +{length} = import '@fink/std-lib/iter.fnk' -{add, any} = import '../context' -{wrap_with_comment_loc} = import '../comments' +{add, any} = import '../context.fnk' +{wrap_with_comment_loc} = import '../comments/index.fnk' block_statement = fn expr, {transform}: diff --git a/src/lang/call/call.fnk b/src/lang/call/call.fnk index f309630..529b08d 100644 --- a/src/lang/call/call.fnk +++ b/src/lang/call/call.fnk @@ -1,5 +1,5 @@ {callExpression, identifier} = import '@babel/types' -{is_empty, length} = import '@fink/std-lib/iter' +{is_empty, length} = import '@fink/std-lib/iter.fnk' transform_args = fn args, {transform}: diff --git a/src/lang/call/call.test.fnk b/src/lang/call/call.test.fnk index 41c3b5d..b9b9202 100644 --- a/src/lang/call/call.test.fnk +++ b/src/lang/call/call.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'call', fn: diff --git a/src/lang/call/index.fnk b/src/lang/call/index.fnk index 98414d8..a953d13 100644 --- a/src/lang/call/index.fnk +++ b/src/lang/call/index.fnk @@ -1,6 +1,6 @@ -{add, any} = import '../context' -{transform_call} = import './call' -{transform_pipe} = import './pipe' +{add, any} = import '../context.fnk' +{transform_call} = import './call.fnk' +{transform_pipe} = import './pipe.fnk' add_call = fn ctx: diff --git a/src/lang/call/pipe.fnk b/src/lang/call/pipe.fnk index 4306836..21ef718 100644 --- a/src/lang/call/pipe.fnk +++ b/src/lang/call/pipe.fnk @@ -1,9 +1,10 @@ {callExpression} = import'@babel/types' {is_empty} = import'@fink/std-lib/iter' -{assign, lets, expr_block, undef} = import '../../js/types' -{transform_value} = import '../partial' -{wrap_with_comment_loc} = import '../comments' +{assign, lets, expr_block, undef} = import '../../js/types.fnk' +{transform_value} = import '../partial/index.fnk' +{wrap_with_comment_loc} = import '../comments/index.fnk' + transform_pipe = fn node, ctx: diff --git a/src/lang/call/pipe.test.fnk b/src/lang/call/pipe.test.fnk index 719808c..f7d99cf 100644 --- a/src/lang/call/pipe.test.fnk +++ b/src/lang/call/pipe.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'pipe', fn: diff --git a/src/lang/comments/index.test.fnk b/src/lang/comments/index.test.fnk index eacce9e..7054686 100644 --- a/src/lang/comments/index.test.fnk +++ b/src/lang/comments/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'comment', fn: diff --git a/src/lang/comparison/index.fnk b/src/lang/comparison/index.fnk index ce5d5c2..5661068 100644 --- a/src/lang/comparison/index.fnk +++ b/src/lang/comparison/index.fnk @@ -1,6 +1,7 @@ {binaryExpression, logicalExpression} = import '@babel/types' -{add, any} = import '../context' +{add, any} = import '../context.fnk' + transform_op = dict: @@ -8,6 +9,7 @@ transform_op = dict: '!=': '!==' + transform_comp = fn {op, left, right}, {transform}: {(op): operator=op} = transform_op @@ -26,6 +28,7 @@ transform_comp = fn {op, left, right}, {transform}: binaryExpression operator, bin_left, bin_right + add_comparison = fn ctx: pipe ctx: add 'comp', any, transform_comp diff --git a/src/lang/comparison/index.test.fnk b/src/lang/comparison/index.test.fnk index 1bf38a7..98b54ed 100644 --- a/src/lang/comparison/index.test.fnk +++ b/src/lang/comparison/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'comparison', fn: diff --git a/src/lang/conditionals/index.fnk b/src/lang/conditionals/index.fnk index 17e9b87..fbced63 100644 --- a/src/lang/conditionals/index.fnk +++ b/src/lang/conditionals/index.fnk @@ -1,5 +1,6 @@ -{add, any} = import '../context' -{transform_match} = import './match' +{add, any} = import '../context.fnk' +{transform_match} = import './match.fnk' + add_conditionals = fn ctx: diff --git a/src/lang/conditionals/match.fnk b/src/lang/conditionals/match.fnk index d2177f8..05a32e8 100644 --- a/src/lang/conditionals/match.fnk +++ b/src/lang/conditionals/match.fnk @@ -4,13 +4,13 @@ doExpression, stringLiteral, memberExpression, restElement identifier } = import '@babel/types' -{length, is_empty} = import '@fink/std-lib/iter' +{length, is_empty} = import '@fink/std-lib/iter.fnk' -{and, eq, not_nullish, typof, consts} = import '../../js/types' +{and, eq, not_nullish, typof, consts} = import '../../js/types.fnk' -{get_key} = import '../literals/object' -{is_partial} = import '../partial' -{wrap_with_comment_loc} = import'../comments' +{get_key} = import '../literals/object.fnk' +{is_partial} = import '../partial/index.fnk' +{wrap_with_comment_loc} = import'../comments/index.fnk' iter = fn value: @@ -112,7 +112,7 @@ get_array_decl = fn arr, id_elems, right, ctx: else: {type: 'ident', value: id.name} - left = {type: 'array', exprs, loc: arr.loc} + left = {type: 'list', exprs, loc: arr.loc} decl = ctx.transform dict: type: 'assign' @@ -161,10 +161,10 @@ match_simple = fn value, expr, emit_result, ctx: match_condition = fn value, expr, emit_result, ctx, cond: js_expr = match expr: - {type: 'object'}: + {type: ? in ['object', 'rec']}: match_obj value, expr, emit_result, ctx, cond - {type: 'array'}: + {type: ? in ['array', 'list']}: match_array value, expr, emit_result, ctx, cond {type: 'spread', right: {}}: diff --git a/src/lang/conditionals/match.test.fnk b/src/lang/conditionals/match.test.fnk index b5120bc..c5c90d6 100644 --- a/src/lang/conditionals/match.test.fnk +++ b/src/lang/conditionals/match.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'match', fn: diff --git a/src/lang/errors.fnk b/src/lang/errors.fnk index ea0882a..a7d7c5e 100644 --- a/src/lang/errors.fnk +++ b/src/lang/errors.fnk @@ -1,5 +1,6 @@ -{highlight_code_loc} = import '@fink/snippet' -{stack_trace} = import '@fink/std-lib/stack-trace' +{highlight_code_loc} = import '@fink/snippet/highlight.fnk' +{stack_trace} = import '@fink/std-lib/stack-trace.fnk' + transform_error = fn {message}, expr, {code, filename}: diff --git a/src/lang/func/index.fnk b/src/lang/func/index.fnk index b96cf7a..fa58670 100644 --- a/src/lang/func/index.fnk +++ b/src/lang/func/index.fnk @@ -1,8 +1,9 @@ {arrowFunctionExpression} = import '@babel/types' -{transform_left} = import '../../js/left' -{add, any} = import '../context' -{transform_block} = import '../block' +{transform_left} = import '../../js/left.fnk' +{add, any} = import '../context.fnk' +{transform_block} = import '../block/index.fnk' + transform_func = fn node, ctx: @@ -20,6 +21,7 @@ transform_func = fn node, ctx: arrowFunctionExpression params, body + add_func = fn ctx: pipe ctx: add any, 'fn', transform_func diff --git a/src/lang/func/index.test.fnk b/src/lang/func/index.test.fnk index 03fac66..1f12b42 100644 --- a/src/lang/func/index.test.fnk +++ b/src/lang/func/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'func', fn: diff --git a/src/lang/group/index.fnk b/src/lang/group/index.fnk index 3237ad4..40ae719 100644 --- a/src/lang/group/index.fnk +++ b/src/lang/group/index.fnk @@ -1,4 +1,5 @@ -{add, any} = import '../context' +{add, any} = import '../context.fnk' + transform_group = fn node, {transform}: @@ -7,6 +8,7 @@ transform_group = fn node, {transform}: transform expr + add_group = fn ctx: pipe ctx: add 'group', any, transform_group diff --git a/src/lang/identifier/index.fnk b/src/lang/identifier/index.fnk index 755c713..555f1f1 100644 --- a/src/lang/identifier/index.fnk +++ b/src/lang/identifier/index.fnk @@ -1,7 +1,8 @@ {identifier} = import '@babel/types' -{escape_ident} = import '../../js/identifier' -{add, any} = import '../context' +{escape_ident} = import '../../js/identifier.fnk' +{add, any} = import '../context.fnk' + transform_ident = fn {value}: @@ -9,6 +10,7 @@ transform_ident = fn {value}: identifier name + add_ident = fn ctx: pipe ctx: add 'ident', any, transform_ident diff --git a/src/lang/identifier/index.test.fnk b/src/lang/identifier/index.test.fnk index a54c1ad..b81592e 100644 --- a/src/lang/identifier/index.test.fnk +++ b/src/lang/identifier/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'identifiers', fn: diff --git a/src/lang/index.fnk b/src/lang/index.fnk index 1fdf8de..d9a5402 100644 --- a/src/lang/index.fnk +++ b/src/lang/index.fnk @@ -1,31 +1,31 @@ -{count} = import '@fink/std-lib/iter' - -{ident, wrap} = import '../js/types' -{var_prefix} = import '../js/identifier' - -{transform_error} = import './errors' -{get_transformer} = import './context' - -{add_assignment} = import './assignment' -{add_func} = import './func' -{add_conditionals} = import './conditionals' -{add_iterables} = import './iterable' -{add_call} = import './call' -{add_literals} = import './literals' -{add_spread} = import './spread' -{add_async} = import './async' -{add_logical} = import './logical' -{add_group} = import './group' -{add_module} = import './module' -{add_member} = import './prop-access' -{add_ident} = import './identifier' -{add_comparison} = import './comparison' -{add_jsx} = import './jsx' -{add_js_compat} = import './js-compat' -{add_arithmitic} = import './arithmitic' -{add_block} = import './block' -{add_partial} = import './partial' -{wrap_with_comment_loc} = import './comments' +{count} = import '@fink/std-lib/iter.fnk' + +{ident, wrap} = import '../js/types.fnk' +{var_prefix} = import '../js/identifier.fnk' + +{transform_error} = import './errors.fnk' +{get_transformer} = import './context.fnk' + +{add_assignment} = import './assignment/index.fnk' +{add_func} = import './func/index.fnk' +{add_conditionals} = import './conditionals/index.fnk' +{add_iterables} = import './iterable/index.fnk' +{add_call} = import './call/index.fnk' +{add_literals} = import './literals/index.fnk' +{add_spread} = import './spread/index.fnk' +{add_async} = import './async/index.fnk' +{add_logical} = import './logical/index.fnk' +{add_group} = import './group/index.fnk' +{add_module} = import './module/index.fnk' +{add_member} = import './prop-access/index.fnk' +{add_ident} = import './identifier/index.fnk' +{add_comparison} = import './comparison/index.fnk' +{add_jsx} = import './jsx/index.fnk' +{add_js_compat} = import './js-compat/index.fnk' +{add_arithmitic} = import './arithmitic/index.fnk' +{add_block} = import './block/index.fnk' +{add_partial} = import './partial/index.fnk' +{wrap_with_comment_loc} = import './comments/index.fnk' add_transformers = fn ctx: diff --git a/src/lang/iterable/common.fnk b/src/lang/iterable/common.fnk index 600bd47..7517f3c 100644 --- a/src/lang/iterable/common.fnk +++ b/src/lang/iterable/common.fnk @@ -1,7 +1,8 @@ -{length} = import '@fink/std-lib/iter' +{length} = import '@fink/std-lib/iter.fnk' + +{consts, yields, lets, assign} = import '../../js/types.fnk' +{block_statement} = import '../block/index.fnk' -{consts, yields, lets, assign} = import '../../js/types' -{block_statement} = import '../block' transform_init = fn left, right, {transform}: @@ -50,6 +51,7 @@ get_accs = fn node, last_expr, ctx: [[], [], last_expr, []] + get_item = fn node, ctx: {unique_ident} = ctx diff --git a/src/lang/iterable/filter.fnk b/src/lang/iterable/filter.fnk index 6915521..984bbd2 100644 --- a/src/lang/iterable/filter.fnk +++ b/src/lang/iterable/filter.fnk @@ -1,8 +1,9 @@ {ifStatement} = import'@babel/types' -{generator, for_of, yields} = import '../../js/types' +{generator, for_of, yields} = import '../../js/types.fnk' + +{get_iter_helpers} = import './common.fnk' -{get_iter_helpers} = import './common' transform_filter = fn node, ctx: diff --git a/src/lang/iterable/filter.test.fnk b/src/lang/iterable/filter.test.fnk index d48424f..0ca058a 100644 --- a/src/lang/iterable/filter.test.fnk +++ b/src/lang/iterable/filter.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'filter', fn: diff --git a/src/lang/iterable/find.fnk b/src/lang/iterable/find.fnk index 7042e0b..9e4c0db 100644 --- a/src/lang/iterable/find.fnk +++ b/src/lang/iterable/find.fnk @@ -1,8 +1,9 @@ {returnStatement, ifStatement} = import'@babel/types' -{func, for_of, undef} = import '../../js/types' +{func, for_of, undef} = import '../../js/types.fnk' + +{get_iter_helpers} = import './common.fnk' -{get_iter_helpers} = import './common' transform_find = fn node, ctx: diff --git a/src/lang/iterable/find.test.fnk b/src/lang/iterable/find.test.fnk index d7498fe..44d634c 100644 --- a/src/lang/iterable/find.test.fnk +++ b/src/lang/iterable/find.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'find', fn: diff --git a/src/lang/iterable/fold.fnk b/src/lang/iterable/fold.fnk index 8ca9c8a..7ea4bee 100644 --- a/src/lang/iterable/fold.fnk +++ b/src/lang/iterable/fold.fnk @@ -1,6 +1,6 @@ -{assign, for_of, func, lets, undef} = import '../../js/types' -{block_statement} = import '../block' -{transform_init} = import './common' +{assign, for_of, func, lets, undef} = import '../../js/types.fnk' +{block_statement} = import '../block/index.fnk' +{transform_init} = import './common.fnk' diff --git a/src/lang/iterable/fold.test.fnk b/src/lang/iterable/fold.test.fnk index 6264513..c9116f2 100644 --- a/src/lang/iterable/fold.test.fnk +++ b/src/lang/iterable/fold.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'fold', fn: diff --git a/src/lang/iterable/index.fnk b/src/lang/iterable/index.fnk index 5a365a6..9382082 100644 --- a/src/lang/iterable/index.fnk +++ b/src/lang/iterable/index.fnk @@ -1,11 +1,12 @@ -{add, any} = import '../context' -{transform_fold} = import './fold' -{transform_unfold} = import './unfold' -{transform_map} = import './map' -{transform_filter} = import './filter' -{transform_while} = import './while' -{transform_until} = import './until' -{transform_find} = import './find' +{add, any} = import '../context.fnk' +{transform_fold} = import './fold.fnk' +{transform_unfold} = import './unfold.fnk' +{transform_map} = import './map.fnk' +{transform_filter} = import './filter.fnk' +{transform_while} = import './while.fnk' +{transform_until} = import './until.fnk' +{transform_find} = import './find.fnk' + add_iterables = fn ctx: diff --git a/src/lang/iterable/map.fnk b/src/lang/iterable/map.fnk index b3c7b1e..cb00137 100644 --- a/src/lang/iterable/map.fnk +++ b/src/lang/iterable/map.fnk @@ -1,6 +1,6 @@ -{generator, for_of, yields} = import '../../js/types' +{generator, for_of, yields} = import '../../js/types.fnk' -{get_iter_helpers} = import './common' +{get_iter_helpers} = import './common.fnk' diff --git a/src/lang/iterable/map.test.fnk b/src/lang/iterable/map.test.fnk index f7d3274..4ed0d4c 100644 --- a/src/lang/iterable/map.test.fnk +++ b/src/lang/iterable/map.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'map', fn: diff --git a/src/lang/iterable/unfold.fnk b/src/lang/iterable/unfold.fnk index 03a5b47..3b5da00 100644 --- a/src/lang/iterable/unfold.fnk +++ b/src/lang/iterable/unfold.fnk @@ -1,11 +1,12 @@ {whileStatement, blockStatement} = import '@babel/types' -{is_empty} = import '@fink/std-lib/iter' +{is_empty} = import '@fink/std-lib/iter.fnk' -{assign, generator, true_, lets} = import '../../js/types' +{assign, generator, true_, lets} = import '../../js/types.fnk' + +{block_statement} = import '../block/index.fnk' +{transform_init, yield_expr} = import './common.fnk' -{block_statement} = import '../block' -{transform_init, yield_expr} = import './common' loop = fn ...body: @@ -14,6 +15,7 @@ loop = fn ...body: blockStatement body + get_acc_exprs = fn node, next_value, ctx: {transform, unique_ident} = ctx @@ -33,6 +35,7 @@ get_acc_exprs = fn node, next_value, ctx: [[initial], [acc_init], [acc_assign], [acc_result]] + get_accs = fn node, next_value, ctx: match node.args: is_empty ?: @@ -41,6 +44,7 @@ get_accs = fn node, next_value, ctx: get_acc_exprs node, next_value, ctx + transform_unfold = fn node, ctx: {transform, unique_ident} = ctx diff --git a/src/lang/iterable/unfold.test.fnk b/src/lang/iterable/unfold.test.fnk index 95b248f..76965d8 100644 --- a/src/lang/iterable/unfold.test.fnk +++ b/src/lang/iterable/unfold.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'unfold', fn: diff --git a/src/lang/iterable/until.fnk b/src/lang/iterable/until.fnk index 9d47c34..cbadbf3 100644 --- a/src/lang/iterable/until.fnk +++ b/src/lang/iterable/until.fnk @@ -1,8 +1,8 @@ {returnStatement, ifStatement} = import'@babel/types' -{generator, for_of, yields, eq, true_} = import '../../js/types' +{generator, for_of, yields, eq, true_} = import '../../js/types.fnk' -{get_iter_helpers} = import './common' +{get_iter_helpers} = import './common.fnk' diff --git a/src/lang/iterable/until.test.fnk b/src/lang/iterable/until.test.fnk index 06e3879..f83e4c4 100644 --- a/src/lang/iterable/until.test.fnk +++ b/src/lang/iterable/until.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'until', fn: diff --git a/src/lang/iterable/while.fnk b/src/lang/iterable/while.fnk index 9cc94b7..1730c99 100644 --- a/src/lang/iterable/while.fnk +++ b/src/lang/iterable/while.fnk @@ -1,8 +1,8 @@ {returnStatement, ifStatement} = import'@babel/types' -{generator, for_of, yields, neq, true_} = import '../../js/types' +{generator, for_of, yields, neq, true_} = import '../../js/types.fnk' -{get_iter_helpers} = import './common' +{get_iter_helpers} = import './common.fnk' diff --git a/src/lang/iterable/while.test.fnk b/src/lang/iterable/while.test.fnk index 881a280..ba1dc68 100644 --- a/src/lang/iterable/while.test.fnk +++ b/src/lang/iterable/while.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'while', fn: diff --git a/src/lang/js-compat/index.fnk b/src/lang/js-compat/index.fnk index d6f2945..bf1d5a0 100644 --- a/src/lang/js-compat/index.fnk +++ b/src/lang/js-compat/index.fnk @@ -1,6 +1,7 @@ -{add, any} = import '../context' -{transform_throw} = import './throw' -{transform_try} = import './try' +{add, any} = import '../context.fnk' +{transform_throw} = import './throw.fnk' +{transform_try} = import './try.fnk' + add_js_compat = fn ctx: diff --git a/src/lang/js-compat/throw.fnk b/src/lang/js-compat/throw.fnk index acf6b72..9d04438 100644 --- a/src/lang/js-compat/throw.fnk +++ b/src/lang/js-compat/throw.fnk @@ -1,5 +1,6 @@ {unaryExpression} = import '@babel/types' -{wrap} = import '../../js/types' +{wrap} = import '../../js/types.fnk' + transform_throw = fn node, {transform}: diff --git a/src/lang/js-compat/throw.test.fnk b/src/lang/js-compat/throw.test.fnk index 61a5854..97f9520 100644 --- a/src/lang/js-compat/throw.test.fnk +++ b/src/lang/js-compat/throw.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'throw', fn: diff --git a/src/lang/js-compat/try.fnk b/src/lang/js-compat/try.fnk index c4e475d..2ce3490 100644 --- a/src/lang/js-compat/try.fnk +++ b/src/lang/js-compat/try.fnk @@ -3,9 +3,10 @@ expressionStatement, doExpression, isDoExpression } = import '@babel/types' -{false_} = import '../../js/types' +{false_} = import '../../js/types.fnk' + +{transform_block} = import '../block/index.fnk' -{transform_block} = import '../block' transform_try = fn node, ctx: diff --git a/src/lang/js-compat/try.test.fnk b/src/lang/js-compat/try.test.fnk index 3a6b2e1..0832177 100644 --- a/src/lang/js-compat/try.test.fnk +++ b/src/lang/js-compat/try.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'try', fn: diff --git a/src/lang/jsx/index.fnk b/src/lang/jsx/index.fnk index 4c4bae4..47e808c 100644 --- a/src/lang/jsx/index.fnk +++ b/src/lang/jsx/index.fnk @@ -3,7 +3,7 @@ stringLiteral, jsxExpressionContainer, jsxText, jsxFragment, jsxOpeningFragment jsxClosingFragment } = import '@babel/types' -{add, any} = import '../context' +{add, any} = import '../context.fnk' @@ -58,6 +58,7 @@ transform_jsx_expr_container = fn node, {transform}: jsxExpressionContainer transform node.expr + add_jsx = fn ctx: pipe ctx: add 'jsx:frag', any, transform_jsx_frag diff --git a/src/lang/jsx/index.test.fnk b/src/lang/jsx/index.test.fnk index eba27ed..16b060a 100644 --- a/src/lang/jsx/index.test.fnk +++ b/src/lang/jsx/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'jsx', fn: diff --git a/src/lang/literals/array.fnk b/src/lang/literals/array.fnk index 3a1c317..2870b2b 100644 --- a/src/lang/literals/array.fnk +++ b/src/lang/literals/array.fnk @@ -1,5 +1,6 @@ {arrayExpression} = import '@babel/types' -{null} = import '@fink/js-interop/nullish' +{null} = import '@fink/js-interop/nullish.fnk' + transform_array = fn node, {transform}: diff --git a/src/lang/literals/array.test.fnk b/src/lang/literals/array.test.fnk index 3b9abd1..79c547a 100644 --- a/src/lang/literals/array.test.fnk +++ b/src/lang/literals/array.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'array', fn: diff --git a/src/lang/literals/index.fnk b/src/lang/literals/index.fnk index fc2da65..9e705cd 100644 --- a/src/lang/literals/index.fnk +++ b/src/lang/literals/index.fnk @@ -1,10 +1,10 @@ -{any, add} = import '../context' +{any, add} = import '../context.fnk' -{transform_number} = import './number' -{transform_string} = import './string' -{transform_array} = import './array' -{transform_object, transform_prop} = import './object' -{transform_keyword} = import './keywords' +{transform_number} = import './number.fnk' +{transform_string} = import './string.fnk' +{transform_array} = import './array.fnk' +{transform_object, transform_prop} = import './object.fnk' +{transform_keyword} = import './keywords.fnk' @@ -13,7 +13,10 @@ add_literals = fn ctx: add 'number', any, transform_number add 'string', any, transform_string add 'array', any, transform_array + add 'list', any, transform_array add 'object', any, transform_object add 'object:prop', any, transform_prop + add 'rec', any, transform_object + add 'rec:kv', any, transform_prop add 'literal', any, transform_keyword add 'literal', any, transform_keyword \ No newline at end of file diff --git a/src/lang/literals/keywords.test.fnk b/src/lang/literals/keywords.test.fnk index 7acb6a3..eff1f29 100644 --- a/src/lang/literals/keywords.test.fnk +++ b/src/lang/literals/keywords.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'keywords', fn: diff --git a/src/lang/literals/number.fnk b/src/lang/literals/number.fnk index 2ecb860..5a525e9 100644 --- a/src/lang/literals/number.fnk +++ b/src/lang/literals/number.fnk @@ -1,6 +1,7 @@ {numericLiteral} = import '@babel/types' -{rx, matches} = import '@fink/std-lib/regex' -{parse_float, parse_int} = import '@fink/std-lib/num' +{rx, matches} = import '@fink/std-lib/regex.fnk' +{parse_float, parse_int} = import '@fink/std-lib/num.fnk' + transform_number = fn {value}: diff --git a/src/lang/literals/number.test.fnk b/src/lang/literals/number.test.fnk index 97f759f..2a653a5 100644 --- a/src/lang/literals/number.test.fnk +++ b/src/lang/literals/number.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'numbers', fn: diff --git a/src/lang/literals/object.fnk b/src/lang/literals/object.fnk index 15d5419..e869bff 100644 --- a/src/lang/literals/object.fnk +++ b/src/lang/literals/object.fnk @@ -1,6 +1,7 @@ {objectExpression, objectProperty, assignmentPattern} = import '@babel/types' -{raw_str} = import '../../js/types' +{raw_str} = import '../../js/types.fnk' + transform_object = fn node, {transform}: @@ -15,6 +16,7 @@ str_key = fn {value, loc}: {...str, loc} + get_key = fn {left: key}, ctx: match key: {type: 'group'}: @@ -25,6 +27,7 @@ get_key = fn {left: key}, ctx: [false, str_key key] + get_value = fn {right}, ctx: match right: {type: 'empty'}: @@ -33,6 +36,7 @@ get_value = fn {right}, ctx: ctx.transform right + transform_prop = fn node, ctx: match node: {left: {type: 'spread'}}: diff --git a/src/lang/literals/object.test.fnk b/src/lang/literals/object.test.fnk index 77b89c6..21bdf54 100644 --- a/src/lang/literals/object.test.fnk +++ b/src/lang/literals/object.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'object', fn: diff --git a/src/lang/literals/regex.test.fnk b/src/lang/literals/regex.test.fnk index 5003bc6..898c98a 100644 --- a/src/lang/literals/regex.test.fnk +++ b/src/lang/literals/regex.test.fnk @@ -1,7 +1,8 @@ -{describe, it, expect, to_match_snapshot} = import '@fink/jest' -{raw} = import '@fink/std-lib/str' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' +{raw} = import '@fink/std-lib/str.fnk' + +{fink2js} = import '../../testing/index.fnk' -{fink2js} = import '../../testing' describe 'regex', fn: diff --git a/src/lang/literals/string.fnk b/src/lang/literals/string.fnk index 0b1be88..a93665b 100644 --- a/src/lang/literals/string.fnk +++ b/src/lang/literals/string.fnk @@ -1,10 +1,12 @@ {templateElement, templateLiteral, taggedTemplateExpression} = import '@babel/types' -{rx, replace_all} = import '@fink/std-lib/regex' +{rx, replace_all} = import '@fink/std-lib/regex.fnk' + not_tagged = {tagged: false} + transform_string = fn node, {transform}: {exprs: parts, tag=not_tagged} = node diff --git a/src/lang/literals/string.test.fnk b/src/lang/literals/string.test.fnk index 345c5ce..0c206e4 100644 --- a/src/lang/literals/string.test.fnk +++ b/src/lang/literals/string.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'string', fn: diff --git a/src/lang/logical/in.fnk b/src/lang/logical/in.fnk index dbebaec..b95195b 100644 --- a/src/lang/logical/in.fnk +++ b/src/lang/logical/in.fnk @@ -6,7 +6,7 @@ transform_in = fn node, ctx: {left, right} = node match right: - {type: 'array'}: + {type: ? in ['array', 'list']}: callExpression memberExpression transform right @@ -20,7 +20,7 @@ transform_in = fn node, ctx: identifier 'includes' [transform left] - {type: 'object'}: + {type: ? in ['object', 'rec']}: callExpression memberExpression transform right diff --git a/src/lang/logical/in.test.fnk b/src/lang/logical/in.test.fnk index 0d958f8..eb0ea3d 100644 --- a/src/lang/logical/in.test.fnk +++ b/src/lang/logical/in.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'in', fn: diff --git a/src/lang/logical/index.fnk b/src/lang/logical/index.fnk index 9234337..ce45f30 100644 --- a/src/lang/logical/index.fnk +++ b/src/lang/logical/index.fnk @@ -1,6 +1,6 @@ {logicalExpression, unaryExpression} = import '@babel/types' -{add, any} = import '../context' -{transform_in} = import './in' +{add, any} = import '../context.fnk' +{transform_in} = import './in.fnk' @@ -10,6 +10,7 @@ transform_op = dict: 'not': '!' + transform_not = fn node, {transform}: {(node.op): op} = transform_op right = transform node.right @@ -17,6 +18,7 @@ transform_not = fn node, {transform}: unaryExpression op, right + transform_logical = fn node, {transform}: {(node.op): op} = transform_op left = transform node.left @@ -25,6 +27,7 @@ transform_logical = fn node, {transform}: logicalExpression op, left, right + add_logical = fn ctx: pipe ctx: add any, 'and', transform_logical diff --git a/src/lang/logical/index.test.fnk b/src/lang/logical/index.test.fnk index aab157c..9daa1d0 100644 --- a/src/lang/logical/index.test.fnk +++ b/src/lang/logical/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'logical', fn: diff --git a/src/lang/module/import.fnk b/src/lang/module/import.fnk index 060b866..ddc0584 100644 --- a/src/lang/module/import.fnk +++ b/src/lang/module/import.fnk @@ -1,5 +1,5 @@ {callExpression, Import: async_import} = import '@babel/types' -{ends_with, starts_with, slice, is_str} = import '@fink/std-lib/str' +{ends_with, starts_with, slice, is_str} = import '@fink/std-lib/str.fnk' diff --git a/src/lang/module/import.test.fnk b/src/lang/module/import.test.fnk index 74d98a4..3b38e3f 100644 --- a/src/lang/module/import.test.fnk +++ b/src/lang/module/import.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'import', fn: diff --git a/src/lang/module/index.fnk b/src/lang/module/index.fnk index 0476bfa..19d3ec0 100644 --- a/src/lang/module/index.fnk +++ b/src/lang/module/index.fnk @@ -3,13 +3,12 @@ importDeclaration, importSpecifier, importDefaultSpecifier exportNamedDeclaration, exportDefaultDeclaration, identifier } = import '@babel/types' -{starts_with, slice} = import '@fink/std-lib/str' +{starts_with, slice} = import '@fink/std-lib/str.fnk' -{add, any} = import '../context' - -{wrap_with_comment_loc} = import '../comments' -{block_statement} = import '../block' -{transform_import: transform_async_import, resolve_ext} = import './import' +{add, any} = import '../context.fnk' +{wrap_with_comment_loc} = import '../comments/index.fnk' +{block_statement} = import '../block/index.fnk' +{transform_import: transform_async_import, resolve_ext} = import './import.fnk' @@ -31,7 +30,7 @@ transform_import = fn node, {transform, options}: {type: 'ident'}: [importDefaultSpecifier transform node.left] - {type: 'object'}: + {type: ? in ['object', 'rec']}: pipe node.left.exprs: map prop: match prop: @@ -94,6 +93,7 @@ transform_module = fn node, ctx: ...interpreter + add_module = fn ctx: pipe ctx: add 'module', any, transform_module diff --git a/src/lang/module/index.test.fnk b/src/lang/module/index.test.fnk index e0ce0a6..31a70ec 100644 --- a/src/lang/module/index.test.fnk +++ b/src/lang/module/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'module', fn: diff --git a/src/lang/partial/index.fnk b/src/lang/partial/index.fnk index ee8932b..072dae6 100644 --- a/src/lang/partial/index.fnk +++ b/src/lang/partial/index.fnk @@ -1,7 +1,8 @@ {identifier} = import '@babel/types' -{escape_ident} = import '../../js/identifier' -{add} = import '../context' +{escape_ident} = import '../../js/identifier.fnk' +{add} = import '../context.fnk' + has_partial = fn exprs: @@ -10,6 +11,7 @@ has_partial = fn exprs: find partial: partial + is_partial = fn node: match node: {type: 'partial'}: true @@ -17,11 +19,12 @@ is_partial = fn node: {right: is_partial ?}: true {type: 'call', callee: is_partial ?}: true {type: 'call'}: has_partial node.args - {type: 'array'}: has_partial node.exprs - {type: 'object'}: has_partial node.exprs + {type: ? in ['array', 'list']}: has_partial node.exprs + {type: ? in ['object', 'rec']}: has_partial node.exprs else: false + transform_value = fn node, {transform}: partial_or_node = match node: is_partial ?: @@ -38,6 +41,7 @@ transform_value = fn node, {transform}: transform partial_or_node + transform_partial = fn {value}, {partial_ident}: name = match partial_ident: {name: {}}: @@ -48,6 +52,7 @@ transform_partial = fn {value}, {partial_ident}: identifier name + add_partial = fn ctx: pipe ctx: add 'partial', '?', transform_partial diff --git a/src/lang/partial/index.test.fnk b/src/lang/partial/index.test.fnk index bd2e559..989f447 100644 --- a/src/lang/partial/index.test.fnk +++ b/src/lang/partial/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'partial', fn: diff --git a/src/lang/prop-access/index.fnk b/src/lang/prop-access/index.fnk index 3a96d48..c891f47 100644 --- a/src/lang/prop-access/index.fnk +++ b/src/lang/prop-access/index.fnk @@ -1,9 +1,9 @@ {memberExpression, identifier} = import '@babel/types' -{rx, matches} = import '@fink/std-lib/regex' +{rx, matches} = import '@fink/std-lib/regex.fnk' -{raw_str} = import '../../js/types' +{raw_str} = import '../../js/types.fnk' -{add, any} = import '../context' +{add, any} = import '../context.fnk' @@ -22,6 +22,7 @@ transform_member = fn {left, right}, {transform}: memberExpression memb_left, memb_right, computed + add_member = fn ctx: pipe ctx: add any, '.', transform_member diff --git a/src/lang/prop-access/index.test.fnk b/src/lang/prop-access/index.test.fnk index e953223..c91b98b 100644 --- a/src/lang/prop-access/index.test.fnk +++ b/src/lang/prop-access/index.test.fnk @@ -1,5 +1,5 @@ -{fink2js} = import '../../testing' -{describe, it, expect, to_match_snapshot} = import '@fink/jest' +{fink2js} = import '../../testing/index.fnk' +{describe, it, expect, to_match_snapshot} = import '@fink/jest/test.fnk' describe 'member', fn: diff --git a/src/lang/spread/index.fnk b/src/lang/spread/index.fnk index 9bd75c9..48808cb 100644 --- a/src/lang/spread/index.fnk +++ b/src/lang/spread/index.fnk @@ -1,5 +1,5 @@ {spreadElement} = import '@babel/types' -{add, any} = import '../context' +{add, any} = import '../context.fnk' transform_spread = fn node, {transform}: diff --git a/src/testing/index.fnk b/src/testing/index.fnk index 1e94ca1..4de9404 100644 --- a/src/testing/index.fnk +++ b/src/testing/index.fnk @@ -1,7 +1,7 @@ {parse} = import '@fink/larix' -{is_empty} = import '@fink/std-lib/iter' +{is_empty} = import '@fink/std-lib/iter.fnk' -{generate} = import '..' +{generate} = import '../index.fnk' fink2js = fn source, options: