diff --git a/.pnp.cjs b/.pnp.cjs index 4139659..adca24b 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -43,6 +43,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/node", "npm:17.0.18"], ["@types/prop-types", "npm:15.7.4"], ["@types/react", "npm:17.0.39"], + ["@types/react-calendar", "npm:3.5.0"], ["@types/react-cookies", "npm:0.1.0"], ["@types/react-dom", "npm:17.0.11"], ["@types/react-is", "npm:17.0.3"], @@ -50,6 +51,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/recharts", "npm:1.8.23"], ["@walkhub/recharts", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:2.1.13"], ["axios", "npm:0.25.0"], + ["dayjs", "npm:1.11.2"], ["eslint", "npm:8.5.0"], ["eslint-config-next", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:12.0.7"], ["next", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:12.0.4"], @@ -58,6 +60,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["postinstall-postinstall", "npm:2.1.0"], ["prop-types", "npm:15.8.1"], ["react", "npm:17.0.2"], + ["react-calendar", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:3.7.0"], ["react-cookies", "npm:0.1.1"], ["react-dom", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:17.0.2"], ["react-is", "npm:17.0.2"], @@ -1015,6 +1018,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["@types/react-calendar", [ + ["npm:3.5.0", { + "packageLocation": "./.yarn/cache/@types-react-calendar-npm-3.5.0-2cd1b01015-0dc7eadd0b.zip/node_modules/@types/react-calendar/", + "packageDependencies": [ + ["@types/react-calendar", "npm:3.5.0"], + ["@types/react", "npm:17.0.39"] + ], + "linkType": "HARD", + }] + ]], ["@types/react-cookies", [ ["npm:0.1.0", { "packageLocation": "./.yarn/cache/@types-react-cookies-npm-0.1.0-b56bf6191f-a7d18ad17e.zip/node_modules/@types/react-cookies/", @@ -1226,6 +1239,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["@wojtekmaj/date-utils", [ + ["npm:1.0.3", { + "packageLocation": "./.yarn/cache/@wojtekmaj-date-utils-npm-1.0.3-66943d4ae0-70b7152160.zip/node_modules/@wojtekmaj/date-utils/", + "packageDependencies": [ + ["@wojtekmaj/date-utils", "npm:1.0.3"] + ], + "linkType": "HARD", + }] + ]], ["@yarnpkg/lockfile", [ ["npm:1.1.0", { "packageLocation": "./.yarn/cache/@yarnpkg-lockfile-npm-1.1.0-6e0da4acd2-05b881b486.zip/node_modules/@yarnpkg/lockfile/", @@ -2455,6 +2477,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["dayjs", [ + ["npm:1.11.2", { + "packageLocation": "./.yarn/cache/dayjs-npm-1.11.2-644b12fe04-78f8bd04a9.zip/node_modules/dayjs/", + "packageDependencies": [ + ["dayjs", "npm:1.11.2"] + ], + "linkType": "HARD", + }] + ]], ["debug", [ ["npm:2.6.9", { "packageLocation": "./.yarn/cache/debug-npm-2.6.9-7d4cb597dc-d2f51589ca.zip/node_modules/debug/", @@ -3564,6 +3595,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["get-user-locale", [ + ["npm:1.4.0", { + "packageLocation": "./.yarn/cache/get-user-locale-npm-1.4.0-5b0d4b8a21-d27a6cf7b1.zip/node_modules/get-user-locale/", + "packageDependencies": [ + ["get-user-locale", "npm:1.4.0"], + ["lodash.once", "npm:4.1.1"] + ], + "linkType": "HARD", + }] + ]], ["glob", [ ["npm:7.1.7", { "packageLocation": "./.yarn/cache/glob-npm-7.1.7-5698ad9c48-b61f48973b.zip/node_modules/glob/", @@ -4453,6 +4494,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["lodash.once", [ + ["npm:4.1.1", { + "packageLocation": "./.yarn/cache/lodash.once-npm-4.1.1-d8ba329ead-d768fa9f9b.zip/node_modules/lodash.once/", + "packageDependencies": [ + ["lodash.once", "npm:4.1.1"] + ], + "linkType": "HARD", + }] + ]], ["lodash.sortby", [ ["npm:4.7.0", { "packageLocation": "./.yarn/cache/lodash.sortby-npm-4.7.0-fda8ab950d-db170c9396.zip/node_modules/lodash.sortby/", @@ -4529,6 +4579,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["merge-class-names", [ + ["npm:1.4.2", { + "packageLocation": "./.yarn/cache/merge-class-names-npm-1.4.2-aa575a4fce-569c333ab0.zip/node_modules/merge-class-names/", + "packageDependencies": [ + ["merge-class-names", "npm:1.4.2"] + ], + "linkType": "HARD", + }] + ]], ["merge-stream", [ ["npm:2.0.0", { "packageLocation": "./.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip/node_modules/merge-stream/", @@ -5609,6 +5668,36 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD", }] ]], + ["react-calendar", [ + ["npm:3.7.0", { + "packageLocation": "./.yarn/cache/react-calendar-npm-3.7.0-1b9ffc08c6-368084515b.zip/node_modules/react-calendar/", + "packageDependencies": [ + ["react-calendar", "npm:3.7.0"] + ], + "linkType": "SOFT", + }], + ["virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:3.7.0", { + "packageLocation": "./.yarn/__virtual__/react-calendar-virtual-76f272f28c/0/cache/react-calendar-npm-3.7.0-1b9ffc08c6-368084515b.zip/node_modules/react-calendar/", + "packageDependencies": [ + ["react-calendar", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:3.7.0"], + ["@types/react", "npm:17.0.39"], + ["@types/react-dom", "npm:17.0.11"], + ["@wojtekmaj/date-utils", "npm:1.0.3"], + ["get-user-locale", "npm:1.4.0"], + ["merge-class-names", "npm:1.4.2"], + ["prop-types", "npm:15.8.1"], + ["react", "npm:17.0.2"], + ["react-dom", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:17.0.2"] + ], + "packagePeers": [ + "@types/react-dom", + "@types/react", + "react-dom", + "react" + ], + "linkType": "HARD", + }] + ]], ["react-cookies", [ ["npm:0.1.1", { "packageLocation": "./.yarn/cache/react-cookies-npm-0.1.1-f9d7099eb7-a31a7f5e43.zip/node_modules/react-cookies/", @@ -6606,6 +6695,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/node", "npm:17.0.18"], ["@types/prop-types", "npm:15.7.4"], ["@types/react", "npm:17.0.39"], + ["@types/react-calendar", "npm:3.5.0"], ["@types/react-cookies", "npm:0.1.0"], ["@types/react-dom", "npm:17.0.11"], ["@types/react-is", "npm:17.0.3"], @@ -6613,6 +6703,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/recharts", "npm:1.8.23"], ["@walkhub/recharts", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:2.1.13"], ["axios", "npm:0.25.0"], + ["dayjs", "npm:1.11.2"], ["eslint", "npm:8.5.0"], ["eslint-config-next", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:12.0.7"], ["next", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:12.0.4"], @@ -6621,6 +6712,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["postinstall-postinstall", "npm:2.1.0"], ["prop-types", "npm:15.8.1"], ["react", "npm:17.0.2"], + ["react-calendar", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:3.7.0"], ["react-cookies", "npm:0.1.1"], ["react-dom", "virtual:e55f5d8a64d261101d4ce49052d1b4e178c551e22c9d001620c4808dceb69acff3dc375e5436e3048d50cf62bcfeb3a8c2631e92fab243033d7734adf684bf67#npm:17.0.2"], ["react-is", "npm:17.0.2"], diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 875f63d..8e8adf9 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,6 @@ { - "recommendations": ["arcanis.vscode-zipfs", "dbaeumer.vscode-eslint"] + "recommendations": [ + "arcanis.vscode-zipfs", + "dbaeumer.vscode-eslint" + ] } diff --git a/.yarn/cache/dayjs-npm-1.11.2-644b12fe04-78f8bd04a9.zip b/.yarn/cache/dayjs-npm-1.11.2-644b12fe04-78f8bd04a9.zip new file mode 100644 index 0000000..9e09205 Binary files /dev/null and b/.yarn/cache/dayjs-npm-1.11.2-644b12fe04-78f8bd04a9.zip differ diff --git a/.yarn/sdks/eslint/bin/eslint.js b/.yarn/sdks/eslint/bin/eslint.js old mode 100644 new mode 100755 diff --git a/.yarn/sdks/typescript/bin/tsc b/.yarn/sdks/typescript/bin/tsc old mode 100644 new mode 100755 diff --git a/.yarn/sdks/typescript/bin/tsserver b/.yarn/sdks/typescript/bin/tsserver old mode 100644 new mode 100755 diff --git a/.yarn/sdks/typescript/lib/tsserver.js b/.yarn/sdks/typescript/lib/tsserver.js index 71e35cf..830ad9f 100644 --- a/.yarn/sdks/typescript/lib/tsserver.js +++ b/.yarn/sdks/typescript/lib/tsserver.js @@ -18,6 +18,7 @@ const moduleWrapper = tsserver => { const pnpApi = require(`pnpapi`); const isVirtual = str => str.match(/\/(\$\$virtual|__virtual__)\//); + const isPortal = str => str.startsWith("portal:/"); const normalize = str => str.replace(/\\/g, `/`).replace(/^\/?/, `/`); const dependencyTreeRoots = new Set(pnpApi.getDependencyTreeRoots().map(locator => { @@ -44,7 +45,7 @@ const moduleWrapper = tsserver => { const resolved = isVirtual(str) ? pnpApi.resolveVirtual(str) : str; if (resolved) { const locator = pnpApi.findPackageLocator(resolved); - if (locator && dependencyTreeRoots.has(`${locator.name}@${locator.reference}`)) { + if (locator && (dependencyTreeRoots.has(`${locator.name}@${locator.reference}`) || isPortal(locator.reference))) { str = resolved; } } @@ -60,18 +61,26 @@ const moduleWrapper = tsserver => { // // Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910 // - // Update Oct 8 2021: VSCode changed their format in 1.61. + // Update 2021-10-08: VSCode changed their format in 1.61. // Before | ^zip:/c:/foo/bar.zip/package.json // After | ^/zip//c:/foo/bar.zip/package.json // + // Update 2022-04-06: VSCode changed the format in 1.66. + // Before | ^/zip//c:/foo/bar.zip/package.json + // After | ^/zip/c:/foo/bar.zip/package.json + // case `vscode <1.61`: { str = `^zip:${str}`; } break; - case `vscode`: { + case `vscode <1.66`: { str = `^/zip/${str}`; } break; + case `vscode`: { + str = `^/zip${str}`; + } break; + // To make "go to definition" work, // We have to resolve the actual file system path from virtual path // and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip) @@ -85,7 +94,7 @@ const moduleWrapper = tsserver => { // everything else is up to neovim case `neovim`: { str = normalize(resolved).replace(/\.zip\//, `.zip::`); - str = `zipfile:${str}`; + str = `zipfile://${str}`; } break; default: { @@ -100,8 +109,7 @@ const moduleWrapper = tsserver => { function fromEditorPath(str) { switch (hostInfo) { - case `coc-nvim`: - case `neovim`: { + case `coc-nvim`: { str = str.replace(/\.zip::/, `.zip/`); // The path for coc-nvim is in format of //zipfile://.yarn/... // So in order to convert it back, we use .* to match all the thing @@ -111,6 +119,12 @@ const moduleWrapper = tsserver => { : str.replace(/^.*zipfile:/, ``); } break; + case `neovim`: { + str = str.replace(/\.zip::/, `.zip/`); + // The path for neovim is in format of zipfile:////.yarn/... + return str.replace(/^zipfile:\/\//, ``); + } break; + case `vscode`: default: { return process.platform === `win32` @@ -143,8 +157,9 @@ const moduleWrapper = tsserver => { let hostInfo = `unknown`; Object.assign(Session.prototype, { - onMessage(/** @type {string} */ message) { - const parsedMessage = JSON.parse(message) + onMessage(/** @type {string | object} */ message) { + const isStringMessage = typeof message === 'string'; + const parsedMessage = isStringMessage ? JSON.parse(message) : message; if ( parsedMessage != null && @@ -153,14 +168,23 @@ const moduleWrapper = tsserver => { typeof parsedMessage.arguments.hostInfo === `string` ) { hostInfo = parsedMessage.arguments.hostInfo; - if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK && process.env.VSCODE_IPC_HOOK.match(/Code\/1\.([1-5][0-9]|60)\./)) { - hostInfo += ` <1.61`; + if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) { + if (/(\/|-)1\.([1-5][0-9]|60)\./.test(process.env.VSCODE_IPC_HOOK)) { + hostInfo += ` <1.61`; + } else if (/(\/|-)1\.(6[1-5])\./.test(process.env.VSCODE_IPC_HOOK)) { + hostInfo += ` <1.66`; + } } } - return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => { - return typeof value === `string` ? fromEditorPath(value) : value; - })); + const processedMessageJSON = JSON.stringify(parsedMessage, (key, value) => { + return typeof value === 'string' ? fromEditorPath(value) : value; + }); + + return originalOnMessage.call( + this, + isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON) + ); }, send(/** @type {any} */ msg) { diff --git a/.yarn/sdks/typescript/lib/tsserverlibrary.js b/.yarn/sdks/typescript/lib/tsserverlibrary.js index 7a2d65e..0f7084c 100644 --- a/.yarn/sdks/typescript/lib/tsserverlibrary.js +++ b/.yarn/sdks/typescript/lib/tsserverlibrary.js @@ -18,6 +18,7 @@ const moduleWrapper = tsserver => { const pnpApi = require(`pnpapi`); const isVirtual = str => str.match(/\/(\$\$virtual|__virtual__)\//); + const isPortal = str => str.startsWith("portal:/"); const normalize = str => str.replace(/\\/g, `/`).replace(/^\/?/, `/`); const dependencyTreeRoots = new Set(pnpApi.getDependencyTreeRoots().map(locator => { @@ -44,7 +45,7 @@ const moduleWrapper = tsserver => { const resolved = isVirtual(str) ? pnpApi.resolveVirtual(str) : str; if (resolved) { const locator = pnpApi.findPackageLocator(resolved); - if (locator && dependencyTreeRoots.has(`${locator.name}@${locator.reference}`)) { + if (locator && (dependencyTreeRoots.has(`${locator.name}@${locator.reference}`) || isPortal(locator.reference))) { str = resolved; } } @@ -60,18 +61,26 @@ const moduleWrapper = tsserver => { // // Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910 // - // Update Oct 8 2021: VSCode changed their format in 1.61. + // Update 2021-10-08: VSCode changed their format in 1.61. // Before | ^zip:/c:/foo/bar.zip/package.json // After | ^/zip//c:/foo/bar.zip/package.json // + // Update 2022-04-06: VSCode changed the format in 1.66. + // Before | ^/zip//c:/foo/bar.zip/package.json + // After | ^/zip/c:/foo/bar.zip/package.json + // case `vscode <1.61`: { str = `^zip:${str}`; } break; - case `vscode`: { + case `vscode <1.66`: { str = `^/zip/${str}`; } break; + case `vscode`: { + str = `^/zip${str}`; + } break; + // To make "go to definition" work, // We have to resolve the actual file system path from virtual path // and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip) @@ -85,7 +94,7 @@ const moduleWrapper = tsserver => { // everything else is up to neovim case `neovim`: { str = normalize(resolved).replace(/\.zip\//, `.zip::`); - str = `zipfile:${str}`; + str = `zipfile://${str}`; } break; default: { @@ -100,8 +109,7 @@ const moduleWrapper = tsserver => { function fromEditorPath(str) { switch (hostInfo) { - case `coc-nvim`: - case `neovim`: { + case `coc-nvim`: { str = str.replace(/\.zip::/, `.zip/`); // The path for coc-nvim is in format of //zipfile://.yarn/... // So in order to convert it back, we use .* to match all the thing @@ -111,6 +119,12 @@ const moduleWrapper = tsserver => { : str.replace(/^.*zipfile:/, ``); } break; + case `neovim`: { + str = str.replace(/\.zip::/, `.zip/`); + // The path for neovim is in format of zipfile:////.yarn/... + return str.replace(/^zipfile:\/\//, ``); + } break; + case `vscode`: default: { return process.platform === `win32` @@ -143,8 +157,9 @@ const moduleWrapper = tsserver => { let hostInfo = `unknown`; Object.assign(Session.prototype, { - onMessage(/** @type {string} */ message) { - const parsedMessage = JSON.parse(message) + onMessage(/** @type {string | object} */ message) { + const isStringMessage = typeof message === 'string'; + const parsedMessage = isStringMessage ? JSON.parse(message) : message; if ( parsedMessage != null && @@ -153,14 +168,23 @@ const moduleWrapper = tsserver => { typeof parsedMessage.arguments.hostInfo === `string` ) { hostInfo = parsedMessage.arguments.hostInfo; - if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK && process.env.VSCODE_IPC_HOOK.match(/Code\/1\.([1-5][0-9]|60)\./)) { - hostInfo += ` <1.61`; + if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) { + if (/(\/|-)1\.([1-5][0-9]|60)\./.test(process.env.VSCODE_IPC_HOOK)) { + hostInfo += ` <1.61`; + } else if (/(\/|-)1\.(6[1-5])\./.test(process.env.VSCODE_IPC_HOOK)) { + hostInfo += ` <1.66`; + } } } - return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => { - return typeof value === `string` ? fromEditorPath(value) : value; - })); + const processedMessageJSON = JSON.stringify(parsedMessage, (key, value) => { + return typeof value === 'string' ? fromEditorPath(value) : value; + }); + + return originalOnMessage.call( + this, + isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON) + ); }, send(/** @type {any} */ msg) { diff --git a/.yarn/sdks/typescript/package.json b/.yarn/sdks/typescript/package.json index fae7e41..34ba1c4 100644 --- a/.yarn/sdks/typescript/package.json +++ b/.yarn/sdks/typescript/package.json @@ -1,6 +1,6 @@ { "name": "typescript", - "version": "4.5.4-sdk", + "version": "4.5.5-sdk", "main": "./lib/typescript.js", "type": "commonjs" } diff --git a/yarn.lock b/yarn.lock index 8b846a3..93a19a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1996,6 +1996,13 @@ __metadata: languageName: node linkType: hard +"dayjs@npm:^1.11.2": + version: 1.11.2 + resolution: "dayjs@npm:1.11.2" + checksum: 78f8bd04a9e5f5554aa06eacda65a7d59e162d39f621a46fd34fb3b51367c3662426d86b4e2f4ac535f81e0c4d5af3e8a83b37e672412eb556267d726c61f8f3 + languageName: node + linkType: hard + "debug@npm:2, debug@npm:^2.6.9": version: 2.6.9 resolution: "debug@npm:2.6.9" @@ -5560,6 +5567,7 @@ __metadata: "@types/recharts": ^1.8.23 "@walkhub/recharts": ^2.1.13 axios: ^0.25.0 + dayjs: ^1.11.2 eslint: 8.5.0 eslint-config-next: 12.0.7 next: 12.0.4